[prog] GhostScript

Almut Behrens almut-behrens at gmx.net
Wed Apr 9 02:04:05 EST 2003

On Tue, Apr 08, 2003 at 02:08:08PM +1000, Sue Stones wrote:
> I am trying to learn how to use postscript - a fairly slow process, since I 
> don't have much info on it.  I have discovered "print" for printing strings 
> doens't work, at least with GhostView.  But using "show" does.

...nice to see that there's someone trying to learn one of the more
"exotic" programming languages like PostScript :)

Have you come across the PostScript Language Reference Manual by Adobe?
It's THE reference documentation on PosctScript. It's available as a
regular paper book, but you can also download it for free as a PDF
file (7.5 MB) directly from Adobe:


Many other freely available documents around PostScript can be found


Although the above book is primarily meant as a reference manual, it
also has some introductory chapters, which are not as bad as one might
expect from a reference book.

While I myself was in the process of learning PostScript I found the
book "PostScript by Example" by Henry McGilton and Mary Campione (ISBN
0-201-63228-4) quite useful. It doesn't go much into depths, but has
plenty of ready-to-run cookbook examples and diagrams to whet your
appetite. Not sure whether it's still available, though (1st ed. 1992).

> I have just discovered that gostscript can be run from the comand line using 
> "gs".  But the tutorial that I found on the web suggests that this comand 
> opens a second window which displays the results of the postscript comands.  
> This doesn't happen on my system (Mandrake 9).  
> Does anyone know if it is really supposed to open annother window, and is 
> there something else that I should know in order to use it.

in fact it is supposed to open a seperate rendering window directly
after you type gs -- at least when using one of the X drivers.
Error messages (if any) are supposed to be printed to the terminal
where you started gs from.
You might try to tell gs explicitly to use the x11 device driver, via
-sDEVICE=x11 (or -sDEVICE=x11alpha -- the anti-aliasing version of it).
"gs -h" should display a list of available devices. The first one in
the list (determined at compile time) should be the default, IIRC.

If that doesn't work, there's something wrong with your ghostscript, I
guess. Can you display other (non-hand-written) PostScript documents
with gs?


P.S.  If you get stuck somewhere, just keep posting here -- I have
done quite a number of projects involving low-level hand-coding of
postscript, and I'd be happy to help out...

More information about the Programming mailing list