PDF::Writer and unicode

12 views
Skip to first unread message

Simon Kröger

unread,
Dec 2, 2006, 9:40:39 AM12/2/06
to
Hi!

Ok, I know there is (or was) no easy way to do that, but the PDF::Writer doc says:

If all of the conditions are correct, the following code
should display the Japanese characters[...]

pdf.text("\xfe\xff\x65\xe5\x67\x2c\x8a\x9e")

Well obviously not all conditions are correct in my environment, i don't see
any Japanese character, i get "þÿeåg,Šž" (if my newsgroup client gets it right).

All i need are three special chars: ş ğ and ç

Is there any way to create a pdf document with these chars using PDF::Writer?

cheers and thanks

Simon

Austin Ziegler

unread,
Dec 2, 2006, 10:27:10 AM12/2/06
to
On 12/2/06, Simon Kröger <SimonK...@gmx.de> wrote:
> Hi!
> Ok, I know there is (or was) no easy way to do that, but the PDF::Writer doc says:
>
> If all of the conditions are correct, the following code
> should display the Japanese characters[...]
>
> pdf.text("\xfe\xff\x65\xe5\x67\x2c\x8a\x9e")
>
> Well obviously not all conditions are correct in my environment, i don't see
> any Japanese character, i get "þÿeåg,Šž" (if my newsgroup client gets it right).

Yes. You won't, either. The PDF::Writer document is incorrect; I
understand the reason why it won't, but I haven't been able to
implement it as of yet. There's a bit of wedding-related stuff for me
to clean up, but I should be able to get UTF-16 working sometime in
2007.

-austin
--
Austin Ziegler * halos...@gmail.com * http://www.halostatue.ca/
* aus...@halostatue.ca * http://www.halostatue.ca/feed/
* aus...@zieglers.ca

Simon Kröger

unread,
Dec 2, 2006, 6:25:56 PM12/2/06
to
Austin Ziegler wrote:

> Yes. You won't, either. The PDF::Writer document is incorrect; I
> understand the reason why it won't, but I haven't been able to
> implement it as of yet. There's a bit of wedding-related stuff for me
> to clean up, but I should be able to get UTF-16 working sometime in
> 2007.
>
> -austin

In other words: "no way" ?

That makes me sad, really. Thanks anyway for such a great tool,
it's a pity i can't use it.

(The character substitution table doesn't help me either, right?)

cheers

Simon

Austin Ziegler

unread,
Dec 3, 2006, 12:41:40 AM12/3/06
to
On 12/2/06, Simon Kröger <SimonK...@gmx.de> wrote:
> Austin Ziegler wrote:
> > Yes. You won't, either. The PDF::Writer document is incorrect; I
> > understand the reason why it won't, but I haven't been able to
> > implement it as of yet. There's a bit of wedding-related stuff for me
> > to clean up, but I should be able to get UTF-16 working sometime in
> > 2007.
> In other words: "no way" ?

No, "not yet."

The tools to do this within PDF::Writer don't yet exist and I will not
be adding them until sometime in the new year (I've had a far more
important project this year, and I'm merely one week after the event).

> (The character substitution table doesn't help me either, right?)

It can, sort of. You won't get Japanese out of it, but there's a patch
out there for PDF::Writer 1.1.3 (I have not integrated it into my code
because it changes a few things that I'm not comfortable changing for
future directions, at least the way they were changed) that will allow
you to use particular Japanese fonts in specific code pages. It works,
and it works amazingly well. But it's not going to be Unicode.

I'm not going to put timelines on any of this right now, but my first
order of business is to fix a few outstanding bugs (that's PDF::Writer
1.1.4) long overdue for fixes. I hope that the author of the Japanese
patch will work with me shortly thereafter for a monkeypatch version
of his code so that his code can simply extend mine. That's
PDF::Writer 1.1.5.

Then I have some serious decisions to make. When I did the
PDF::Presentation and PDF::SVG code last year, I rewrote some of the
code that generates the objects. This change is not backwards
compatible with PDF::Writer 1.1, but it makes the *writing* code
cleaner. However, it doesn't do anything to make creating the objects
from existing PDFs any better. So if I keep that code, which works
well, I'll spend some time pushing things out that will have to be
rewritten yet again to work with PDF::Reader[1]. Or, I can start
looking at the code I was experimenting with for the "next generation"
of Ruby PDF tools, which is far better for dealing with reading PDFs
but may be a little uglier for creation.

PDF::Writer is most certainly not dead, but as I have had to tell
people all year, getting married is more important to me than anyone's
PDF projects. I've got someone who is willing to help me with some
adjunct code, and I'm certainly interested in taking advantage of his
offer, but before we can move forward with any of this I have to sort
out several other things and even push a couple of other projects out
the door (there is a planned update to Transaction::Simple to
hopefully fix a significant memory leakage and speed up PDF::Writer as
well as make it possible to generate larger tables if necessary).

-austin
[1] I am well aware that someone else has created a project that they
are calling PDF::Reader. As far as I can tell, they have not made
anything that is ultimately compatible with PDF::Writer. It seems to
be a nice project, but it's not the PDF::Reader that I have been
planning. It doesn't much matter because when I get around to actually
making this all work, I will probably end up making it a different
name. If I don't, however, don't be surprised if there are conflicts
between my PDF::Reader and this other project's PDF::Reader.

Kouhei Sutou

unread,
Dec 3, 2006, 6:39:18 AM12/3/06
to
Hi,

In <eks395$ld$1...@online.de>
"PDF::Writer and unicode" on Sat, 2 Dec 2006 23:45:08 +0900,
You can do the thing if you use Pango and cairo (Ruby/Pango
and rcairo).

Thanks,
--
kou
Reply all
Reply to author
Forward
0 new messages