[comp.lang.postscript] PS to ASCII?

d85-kai@nada.kth.se (Kai-Mikael J{{-Aro) (11/16/89)

Is there a driver which will convert a PostScript program to "nearest
ASCII equivalent"?  I have some PS files that mainly produce text, so
I'd like to be able to just make a plain dumb-screen legible version
of them...
-- 
Kai-Mikael J{{-Aro	d85-kai@nada.kth.se
"You know how Einstein had bad grades as a kid?  Well, mine are even WORSE!"
	- Calvin

spage@cup.portal.com (S spage Page) (11/20/89)

PostScript cranks out text mainly through the use of the `show' operator and
its variants.  This takes a PostScript string, which is ASCII characters in
parentheses.  Most programs which generate PostScript have a prologue which
defines custom procedures, e.g. "J takes an offset on the current line and
outputs text, M takes a vertical offset and prints text at the left margin."

The result is that you can "see" the text pretty easily in the PostScript
output file, and you might be able to write a filter which pulls out all the
stuff in parentheses.  If you really care you could try to convert special
characters in the encoding like em-dashes and fancy quotes to plain ASCII.
However, you'll probably have more trouble with spaces.  Lots of programs
output tiny text strings (no wonder their PS output prints slowly!) and it's
hard to tell where the spaces should go.

Good luck, your mileage will vary.
=S