tags:

views:

18

answers:

1

Anyone know the right places to hook into ghostscript, so that when interpreting a ps file, I can get logs of all calls of the form:

draw_character(float x, float y, string font_name, int char_id); ?

Basically I want to take a postscript file, and get a list of where all characters are drawn to the screen.

Thanks!

A: 

I'm not sure if this answer is going to help you... but do you know how to harvest debugging information from Ghostscript on the commandline? Simply add "-dDEBUG" to the commandline and it will spit out lots of additional info. To get debugging info from only specific topics, you have these options:

-dCCFONTDEBUG  Compiled-in Fonts
-dCFFDEBUG     CFF Fonts
-dCMAPDEBUG    CMAP
-dDOCIEDEBUG   CIE color
-dEPSDEBUG     EPS handling
-dFAPIDEBUG    Font API
-dINITDEBUG    Initialization
-dPDFDEBUG     PDF Interpreter
-dPDFOPTDEBUG  PDF Optimizer (Linearizer)
-dPDFWRDEBUG   PDF Writer
-dSETPDDEBUG   setpagedevice
-dSTRESDEBUG   Static GS Resources
-dTTFDEBUG     TTF Fonts
-dVGIFDEBUG    ViewGIF
-dVJPGDEBUG    ViewJPEG

Possibly, a PostScript programmer guru could write a little PostScript program that could do what you want by re-defining one of the operators (showglyph?) in a way that it prints out the info you want instead of (or before) drawing each individual character and run that against your target PS file.

Maybe you should ask your question in comp.text.pdf or in comp.lang.postscript ?

pipitas

related questions