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

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
Gabriele
23-Aug-2010
[686]
(if you need greater precision, you can probably find the exact conversion 
factor on google)
Graham
23-Aug-2010
[687]
so 

for i 1 100 10 [
	apply transformation i i [
		image i i w h load %file.jpg		
	]
]

would work?
Gabriele
23-Aug-2010
[688x2]
transformation
 = ?
translation?
Graham
23-Aug-2010
[690]
translation :)
Gabriele
23-Aug-2010
[691]
if so yes, but maybe you want 0 0 for the image origin?
Graham
23-Aug-2010
[692]
oh yeah ...
Gabriele
23-Aug-2010
[693]
the x and y for images are there so that you don't have to use a 
translation each time :)
Graham
23-Aug-2010
[694]
the other way it moves faster off the page