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

Janko
12-May-2009
[636]
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
Oldes
12-May-2009
[637]
Yes... I would need latin2 encoding as well. So I hope you will solve 
it before I would like to use it:)
Janko
12-May-2009
[638]
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
Gabriele
13-May-2009
[639x2]
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.
Janko
13-May-2009
[641]
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.
Gabriele
15-May-2009
[642x2]
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.
Janko
15-May-2009
[644]
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.
Maxim
15-May-2009
[645]
IIRC adobe is notorious for implementing the worst file formats possible.
Gabriele
16-May-2009
[646]
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.)
Janko
16-May-2009
[647]
A (worldwide) universal document format is really something where 
you would expect prime support for utf.
Graham
22-Aug-2010
[648]
Gab, is there going to be any user documentation for pdf-maker 2?
Gabriele
22-Aug-2010
[649]
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.
Graham
22-Aug-2010
[650]
just dictate it !
NickA
22-Aug-2010
[651]
I'd be happy to help with that too.
Graham
22-Aug-2010
[652x4]
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?
Graham
23-Aug-2010
[656]
So, if we ask you questions we can build a manual from that? :)
Gabriele
23-Aug-2010
[657x3]
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 :)
Graham
23-Aug-2010
[660x3]
ok, like postscript ...
so how to reset ??
gsave grestore ?
Gabriele
23-Aug-2010
[663x2]
(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
Graham
23-Aug-2010
[665]
no reset?
Gabriele
23-Aug-2010
[666]
can you make an example where you need "reset"?
Graham
23-Aug-2010
[667x2]
well, I have 4 blocks of text I want to move around...
or a graphic ( how do you include jpgs? )
Gabriele
23-Aug-2010
[669]
apply translation 10 10 [ ... translated stuff here ...]  ... no 
more translated outside block...
Graham
23-Aug-2010
[670]
if I always use 0x0 .. then I can just translate to where I want
Gabriele
23-Aug-2010
[671]
you can think of the ] as a "reset" if you wish
Graham
23-Aug-2010
[672]
so outside the [ ] .. you're back at 0x0 ?
Gabriele
23-Aug-2010
[673x2]
exactly. the transformations are only in effect inside the block.
they are "local"
Graham
23-Aug-2010
[675x2]
ahh... well, I just assumed it was like PS and View
so how to include a JPG?
Gabriele
23-Aug-2010
[677x3]
let me check the syntax for the image command...
image x y w h load %file.jpg
i don't yet have a way to include the JPG data directly, i use the 
loaded image. this means that the image gets in the pdf without compression.
Graham
23-Aug-2010
[680]
and all measurements are in mm ?
Gabriele
23-Aug-2010
[681]
yes, unless you set transformations to use different units.
Graham
23-Aug-2010
[682x2]
can we use points instead then?
72 points to an inch
Gabriele
23-Aug-2010
[684]
i think one point is 0.35 mm, so     apply scaling 0.35 0.35 [...points 
inside here...]      should work
Graham
23-Aug-2010
[685]
ok, great