r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

World: r3wp

[PDF-Maker] discuss Gabriele's pdf-maker

do you think that /Encoding /Differences [
200 /Ccaron
232 /ccaron

doesn't work because it's PDF-1.3  and in that example it's PDF 1.6, 
maybe this is more recent feature?
yes, that's very likely.
i don't know how version support is these days, maybe it's worth 
upgrading to newer versions of the format.
you could change the header though and just try to set it to 1.6 
- though i don't know if everything else will work then. (going from 
1.3 to 1.4 didn't require any changes iirc)
I tried that and nothing happened then I changed the encoding object 
headers to <<
/Type /Encoding
/BaseEncoding /WinAnsiEncoding
/Differences [
and got error while opening (18)
the trailer needs to be redone
did you do the change in the pdf maker code or in the file?
in the pdf file ... I discovered one good news now ... I need csz 
( like ch sh zh in eng) .. I saw  that zh that I thought before doesn't 
have a glyph in standard fonts didn't make it to the generated pdf 
and if I add it by hand and update length of stream Zh works ... 
so now only Ch is the problem .. (because it's not represented in 
win1252 , the character with same code 200 in 1252 is E (arrow) 
so if  that differences would work and exchange 200 with Ccaron it 
would all work
I will try more
changing the pdf file directly will break it because the index at 
the end needs to point to all the objects in the file... so if objects 
move around the index needs to be redone.
it's possible to edit the pdf file by appending stuff to it, but 
you'll need to read the specs to make that work, it's not entirely 
trivial either.
the easiest way would be to change the pdf-maker code to actually 
produce what you need.
aha, thanks
that might have caused the error before then ..
do you know are there all glyphs displayed for these standard fonts 
so I could at least know if Ch ch are in there at all ?
I found an example of PDF from Haru library which uses all ISO8859 
encoding 1 - 20 ... it is version PDF-1.3 , it does use the /Differences 
for each encoding, it also defines widths for them, I intend to look 
at it and somehow transfer it to pdf-maker .. but I am not sure how 
successfull I will be as pdf-maker seems quite complex beast
It's not possible to use utf8 encoding with pdf-maker ?
I think not, and it's not a simple problem to solve.. PDF looks very 
horrible in this regard to me
I can't even make it support Latin2
I wish to have more time to play a little bit with the pdf-maker
it's very nice, but because of 1 letter that I can't generate in 
it Ch .. you have it too probably .. I need to find another solution 
.. and I have invoice nicely made in pdf-maker already
Yes... I would need latin2 encoding as well. So I hope you will solve 
it before I would like to use it:)
I need it today .. I have most stuff done and wanted to release app 
this week , so I can't afford to be stuck on this for days or weeks
the pdf reference documentation list all the characters in those 
fonts. you can download it from the adobe website.
let me know if you find out that a new version of the format supports 
unicode or that there is a simple way to implement it. to me it looks 
like the only way would be to create your own 1 or 2 byte encoding 
with the glyphs you use, or to do like OpenOffice does - it creates 
a separate font for each set of 256 different characters and then 
selects the correct font for each character.
I think solution for other encodings is by using that /Differences 
and defininf the glyph names . I looked at how Haru PDF library does 
it and it uses this method, but I wasn't able to make it work in 
my example ( but pdf-s are very complex so there is a bunch of parts 
that I didn't understand ). At the end I started writing binding 
to Haru, because having those characters is cruicial for that app. 
I can't make app for my country where invoices aren't able to display 
those characters.
Janko, AFAIK, that only works for 256 chars encodings. We need full 
Unicode support... Anyway, I'll see if I can add support for /Differences 
so that it will at least be useful to a good part of Europe.
Not sure when I'll be able to work on it though, so it's a good thing 
that you did the Haru binding.
Yes, I think PDF doesn't support Unicode (even by far) - I noticed 
that stated several times on adobe forums. It seems you can emulate 
these different older encodings with some special tricks like /Differences 
but it's all muddy water so I believe it's not the most joyfull thing 
to program or make work.
IIRC adobe is notorious for implementing the worst file formats possible.
Max, actually PDF is not a bad format, it just didn't evolve in a 
good direction. In particular, the format itself would allow adding 
Unicode support very easily. They're just not adding that for who 
knows what reason. (Probably just that their tools do things in other 
silly ways.)
A (worldwide) universal document format is really something where 
you would expect prime support for utf.
Gab, is there going to be any user documentation for pdf-maker 2?
I don't think I'll have the time to write it myself in the short 
term. I'd be very happy to help anyone willing to write it though.
just dictate it !
I'd be happy to help with that too.
Nick, another tutorial!
I had a quick look at the source code for the demo pdf .. and decided 
that it's too hard to grok.  We need some clues and from that someone 
can write something for users.
First question, is the translation function also relative to 0x0 
or to the latest 0x0 point?
always relative to absolute 0x0, or to the latest 0x0 set by the 
last translation?
So, if we ask you questions we can build a manual from that? :)
transformations of any kind are always relative to the current coordinate 
system which is determined by "previous" transformations.
so if you nest translations you get a translation with the sum of 
the two vectors.
(or you can think of all transformations as matrix multiplications, 
then everything becomes simple :)
ok, like postscript ...
so how to reset ??
gsave grestore ?
(re: demo pdf, it was mostly meant as a "test suite" so it uses most 
of the features)
i use nested blocks, so normally you don't need to reset