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

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
[694x3]
the other way it moves faster off the page
I think Nick has enough to start the tutorial :)
The question for tomorrow is .. how to get a block of text fully 
justified with microkerning
Gabriele
23-Aug-2010
[697]
simplest form (default values used for everything):

textbox [
    "This is an example"
]
Graham
23-Aug-2010
[698]
that does both left and right justification?
Gabriele
23-Aug-2010
[699x2]
yes, that is the default.
(you'll need a longer string to see it of course :)
Graham
23-Aug-2010
[701]
do you have a hyphenation dictionary?
Gabriele
23-Aug-2010
[702]
no, you have to handle that.
Graham
23-Aug-2010
[703]
so does it just wrap on words?
Gabriele
23-Aug-2010
[704x2]
yes.
you can define hyphenation points with --