Re: Manipulating Postscript File
Re: Manipulating Postscript File
- Subject: Re: Manipulating Postscript File
- From: William Kyngesburye <email@hidden>
- Date: Thu, 24 Jan 2002 09:14:26 -0600
Ooh, that would be very difficult.
First, strings in PS are enclosed in parens (). Simple enough, and no
hex. But, where-ever there's kerning between letters, it has to stop the
string, move the pen back a bit, and continue with another string. So
"Some Ave.", where 'A' and 'v' are kerned, would come out:
(Some A)
move the pen
(ve.)
So, you could figure out what to look for, but you would need to know
what to put back too, including the extra move commands.
And this is clean postscript. When an application prints a file (thus
creating a PS file) a lot on application-specific redefined PS command
are stuck in there and text may get further mangled, or the other way it
may get reduced to raw PS.
If you're not discouraged, check out Adobe's technical documents. They
have the specs for PS in pdf format. First go to Support, then at the
bottom-right there's a link to Adobe Solutions Network for Developers.
How about this? Is FreeHand scriptable? (don't know, I use Illustrator)
You could write your script to do a Find and Replace Text within
FreeHand. That would be the best way. Or maybe you thought of this
already, and that's why you're trying to hack the print files.
Good luck
>
Here's the scenario:
>
>
I have a Freehand 9 file which needs to be printed using thousands of
>
different addresses. Instead of doing all that manually, I want to write a
>
script to make the substitutions. Here's what I'm hoping I can do:
>
>
I'd like to write a postscript file to disk just once, open the .ps file
in a
>
text editor such as BBEdit, do a search and replace with the new address and
>
save the file under a new name.
>
>
I won't have any trouble scripting most of this myself, but I am stuck on
>
searching and replacing in the .ps file and I don't know enough about
>
postscript to solve this myself. When I do a search for the address, it
>
fails. I think it's because the string is coded in hex instead of just as an
>
ascii string. If that's not correct, does anyone know why I can't find the
>
string?
>
>
Can anyone help me to learn how to search a Freehand 9 postscript file to
>
find a string of text and replace it with another string (which will
probably
>
need to be converted to hex, if that's in fact what's happening)? Any in
>
formation about this, complete or not, will be greatly appreciated.
>
>
Thanks in advance!
>
>
Ken Fleisher
>
email@hidden
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/
>
applescript-users
>
Do not post admin requests to the list. They will be ignored.
-----
William Kyngesburye <email@hidden>
http://webpages.charter.net/kyngchaos/
All generalizations are dangerous, even this one.