Postscript editing with Ghostscript
Hi,
I am a student that is currently working with a project where we are supposed to read something from a postscript file and place it in a new postscript file.
I want to edit a postscript file with the help of ghostscript to make an output with certain values I have picked out of the original postscript file.
Right now I have a file that does this, but I want to get the fonts that are embedded in a hexadecimal string and decode it so I get the ASCII symbol from it.
The original file have objects that look something like this
/g5 <1C60D8A8C9B64EDFFB83C6241DB110BEE5AB2FAD9D94B39ED5E81E7411B
66E9361DDE78FC667AB91EF9824>
And what I want to do is to pick them out and check them against some dictionary in the postscript code (systemdict???) and pick out its value.
Does anyone have something like this or an example to do this?
Right now my code to pick out the file starts something like this:
(%stdout) (w) file def
where I get the file and now I want to search for let's say the string "<1C60D8" and copy everything that is between this and the symbol ">"
After that I want to check what the hexadecimal code hides underneath it, which in this case is a "E" in Arial.
If anyone have any info on how to do this I would be very happy.
Best regards.
