[comp.lang.postscript] PS Utilities

poirot@aio.jsc.nasa.gov (Daniel T. Poirot) (05/08/91)

In article <1991May5.214431.27894@neon.Stanford.EDU> rokicki@neon.Stanford.EDU (Tomas G. Rokicki) writes:

>                                           Adobe should write and make
>available a simple C routine that properly reads and parses a properly
>formed PostScript file, passing resource requirements up to the next higher
>level and performing any other relevant operations.  

>Heck, I can envision a single tool---a C program with a few prolog
>files---that would take example output from an application and test it in
>all of the above ways, and print out an analysis of the PostScript and
>suggestions for improvements.

>-tom

How about even an INDENT program?  I have had to look at postscript files
from all sorts of sources.  If there was a program like indent(1) that
would at least know where to put in newlines, random ps files could be
filtered into something you could at least READ.
-- 
Daniel Poirot           poirot@aio.jsc.nasa.gov
NASA JSC                "The mind is a terrible thing."
ER3                     tel: (713)483-8793
Houston, TX 77058       fax: (713)483-3204

lee@sq.sq.com (Liam R. E. Quin) (05/10/91)

poirot@aio.jsc.nasa.gov (Daniel T. Poirot) writes:
>How about even an INDENT program?  I have had to look at postscript files
>from all sorts of sources. [...]


This might not help you, but there is a PostScript indent program included
in Sun's OpenWindows.  It's called "psindent".  They don't seem to include
the source for it, though.

From the man page, it has quite a few options!

NAME
     psindent - format POSTSCRIPT language or NeWS source

SYNOPSIS
     psindent   [   [ -ba | +ba ]   [ -bb | +bb ]   [ -bs | +bs ]
     [ -cba | +cba ]        [ -cbb | +cbb ]       [ -cea | +cea ]
     [ -ceb | +ceb ] [ -da | +da ] [ -db | +db ]  [ -dba | +dba ]
     [ -dbb | +dbb ]        [ -dea | +dea ]       [ -deb | +deb ]
     [ -ea | +ea ] [ -eb | +eb ] [ -gra | +gra ]  [ -grb | +grb ]
     [ -gsa | +gsa ]  [ -gsb | +gsb ] [ -ia | +ia ] [ -ib | +ib ]
     [ -ib | +ib ]        [ -lba | +lba ]         [ -lbb | +lbb ]
     [ -lca | +lca ]        [ -lcb | +lcb ]       [ -rba | +rba ]
     [ -rbb | +rbb ] [ -rca | +rca ] [ -rcb | +rcb ] ]  [  input-
     file ... ]

Pretty wild, eh?

Lee

-- 
Liam Russell Quin, SoftQuad Inc., Toronto... 416 963 8337... lee@sq.com
	   `What one person finds valuable others do not even notice.
	    And they do not notice that they do not notice.'
-- Scott Kim, `Interdisciplinary Communication', in `The Art of [HCI] Design'

gaudreau@juggler.East.Sun.COM (Joe Gaudreau (Dances with PostScript)) (05/18/91)

lee@sq.sq.com (Liam R. E. Quin) writes:
=poirot@aio.jsc.nasa.gov (Daniel T. Poirot) writes:
=>How about even an INDENT program?  I have had to look at postscript files
=>from all sorts of sources. [...]

There is also the PostScript mode for Emacs...  I write a lot of PS code
(please no more headers!) daily and wouldn't dream of not having this
Emacs extension!!!

Cheers,

Joe
-=-

-- 
/Joe-Gaudreau {ps-hacker c[++]^2 juggler add add nice-guy mul} bind def
Fone:  (508)671-0461
INet:  gaudreau@East.Sun.Com
UUCP:  sun!suneast!gaudreau
Snail: Sun Microsystems Inc - BDC, 2 Federal St, Billerica, MA  01821
The opinions I juggle may not be mine, but they aren't my employer's either.