PDF::Writer and unicode

  • Thread starter Simon Kröger
  • Start date
S

Simon Kröger

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
 
A

Austin Ziegler

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 "=FE=FFe=E5g,=8A=9E" (if my newsgroup clien=
t 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
--=20
Austin Ziegler * (e-mail address removed) * http://www.halostatue.ca/
* (e-mail address removed) * http://www.halostatue.ca/feed/
* (e-mail address removed)
 
S

Simon Kröger

Austin said:
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
 
A

Austin Ziegler

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.
--=20
Austin Ziegler * (e-mail address removed) * http://www.halostatue.ca/
* (e-mail address removed) * http://www.halostatue.ca/feed/
* (e-mail address removed)
 
K

Kouhei Sutou

SGksDQoNCkluIDxla3MzOTUkbGQkMUBvbmxpbmUuZGU+DQogICJQREY6OldyaXRlciBhbmQgdW5p
Y29kZSIgb24gU2F0LCAyIERlYyAyMDA2IDIzOjQ1OjA4ICswOTAwLA0KICBTaW1vbiBLcsO2Z2Vy
IDxTaW1vbktyb2VnZXJAZ214LmRlPiB3cm90ZToNCg0KPiBPaywgSSBrbm93IHRoZXJlIGlzIChv
ciB3YXMpIG5vIGVhc3kgd2F5IHRvIGRvIHRoYXQsIGJ1dCB0aGUgUERGOjpXcml0ZXIgZG9jIHNh
eXM6DQo+IA0KPiAgIElmIGFsbCBvZiB0aGUgY29uZGl0aW9ucyBhcmUgY29ycmVjdCwgdGhlIGZv
bGxvd2luZyBjb2RlDQo+ICAgc2hvdWxkIGRpc3BsYXkgdGhlIEphcGFuZXNlIGNoYXJhY3RlcnNb
Li4uXQ0KPiANCj4gICBwZGYudGV4dCgiXHhmZVx4ZmZceDY1XHhlNVx4NjdceDJjXHg4YVx4OWUi
KQ0KPiANCj4gV2VsbCBvYnZpb3VzbHkgbm90IGFsbCBjb25kaXRpb25zIGFyZSBjb3JyZWN0IGlu
IG15IGVudmlyb25tZW50LCBpIGRvbid0IHNlZQ0KPiBhbnkgSmFwYW5lc2UgY2hhcmFjdGVyLCBp
IGdldCAiw77Dv2XDpWcsxaDFviIgKGlmIG15IG5ld3Nncm91cCBjbGllbnQgZ2V0cyBpdCByaWdo
dCkuDQo+IA0KPiBBbGwgaSBuZWVkIGFyZSB0aHJlZSBzcGVjaWFsIGNoYXJzOiDFnyDEnyBhbmQg
w6cNCj4gDQo+IElzIHRoZXJlIGFueSB3YXkgdG8gY3JlYXRlIGEgcGRmIGRvY3VtZW50IHdpdGgg
dGhlc2UgY2hhcnMgdXNpbmcgUERGOjpXcml0ZXI/DQoNCllvdSBjYW4gZG8gdGhlIHRoaW5nIGlm
IHlvdSB1c2UgUGFuZ28gYW5kIGNhaXJvIChSdWJ5L1BhbmdvDQphbmQgcmNhaXJvKS4NCg0KVGhh
bmtzLA0KLS0NCmtvdQ0K
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top