Note that there are some explanatory texts on larger screens.

plurals
  1. POFind string and convert to ASCII with PostScript
    text
    copied!<p>I am a total newbie when it comes to postscript programming and I was trying to find a solution to my problem with the help of the geniuses in here.</p> <p>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.</p> <p>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.</p> <p>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.</p> <p>The original file have objects that look something like this</p> <p>/g5 &lt;1C60D8A8C9B64EDFFB83C6241DB110BEE5AB2FAD9D94B39ED5E81E7411B 66E9361DDE78FC667AB91EF9824></p> <p>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.</p> <p>Does anyone have something like this or an example to do this?</p> <p>Right now my code to pick out the file starts something like this: (%stdout) (w) file def</p> <p>where I get the file and now I want to search for let's say the string "&lt;1C60D8" and copy everything that is between this and the symbol ">"</p> <p>After that I want to check what the hexadecimal code hides underneath it, which in this case is a "E" in Arial.</p> <p>I want to extract the text so I can have it in a new file without the hexadecimal strings and in pure ASCII format. So becomes a "P" for example. After that I can make a software that picks out the "P" from the new postscript file and puts it on my homepage, and the final result is a homepage with everyones test results from the last exam for example.</p> <p>Right now I am using ghostscript and the following command line which I found on the internet somewhere to extract the information in the file.</p> <p>gswin32c.exe -q -dNODISPLAY -dNOPAUSE -sFONTPATH=C:\WINDOWS\Fonts -dBATCH extract.ps input.ps > output.ps</p> <p>where extract.ps is the file in which I need to do some encoding to retrieve the hexadecimal string and encode it and lastly output it so it becomes an "normal" font, and also write in some coordinates of where they should lie.</p> <p>If you have any knowlegde of how I should start that would be awesome. Right now I am thinking that this probably wont work and I'll have to do another approach like the other students, but since I found out that PostScript is a programming language I thought I could make it.</p> <p>Right now I am thinking I probably need to do something like this in the beginning. (%Stdout)(w) test{ dup ???? writestring check against systemdict? gcheck?? } bind def show test???</p> <p>I am currently trying to read some literature that I found on the internet but it is very difficult!</p> <p>If you know how to solve the problem, with an example, please let me know </p> <p>Best regards!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload