[Gs-dgs-devel] [OT] Postscript internals

Adam Fedor fedor@doc.com
Wed, 25 Sep 2002 13:20:02 -0400


Postscript doesn't know anything about right margins or left margins or alignment. You just move the current point to where you want to draw a string, then draw it. If you have variable lenght text, it's likely you will have to move the current point to compensate for it yourself.

-----Original Message-----
From: Eric Persson [mailto:eric@persson.tm]
Sent: Wednesday, September 25, 2002 9:35 AM
To: gs-dgs-devel@ghostscript.com
Subject: [Gs-dgs-devel] [OT] Postscript internals


Hi,

This might be a bit off-topic but its partly related, since this is a 
lowtraffic mailinglist I hope noone is angry with me for this post. :)

I have created a webform in php/html which takes values from a form an 
inserts the values into a postscriptfile. I have placed small hooks in 
the postscriptfiles, for example VARIABLE_12 and so on. And then I just 
replace them with the value from the form.
This works quite well most of the time, but problems occur when text is 
aligned to the right in the postscriptfile. If the textstring inserted 
is longer than the variable,( VARIABLE_12 is 11 characters, and lets say 
I insert VERYLONGSTRING which is 14 characters ) the text flows to the 
right instead of the text starting further to the left. The right margin 
will not be kept correct. Similar things happens when using centered 
strings.

Does anyone know if there is a soloution to this? Or perhaps something I 
could do to fix it?

Any ideas/thoughts/questions is appreciated...

Best regards,
	Eric Persson

_______________________________________________
Gs-dgs-devel mailing list
Gs-dgs-devel@ghostscript.com
http://www.ghostscript.com/mailman/listinfo/gs-dgs-devel