PostScript tricks and hacksDuplex printingHacking PostScript

Hacking PostScript

Ordinarily, PostScript is written by a computer program, and humans rarely need to code PostScript by hand. However, if you want to know the elements of how the PostScript language works, you may consult Peter J. Weingartner's  First Guide To PostScript. Also available on the World-Wide Web are links to PostScript resources and the FAQ list from the newsgroup comp.lang.postscript.

sample
PostScript graphic Here is an example of a simple hand-coded PostScript file.
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 135 110
/Helvetica findfont 60 scalefont setfont
/print696 {0 0 moveto (696) show} def
.90 -.03 .10 
{dup 1 exch sub 0 setrgbcolor print696
            2 .5 translate 1 rotate  } for
0 0 1.0 setrgbcolor print696
showpage

If you want to do general hacking of existing PostScript files, then you can try the PSUtils package. It can select and rearrange pages, alter the document paper size, put multiple pages on a single physical sheet of paper, and so forth.

If you have a non-PostScript printer at home, you may think that you cannot print PostScript files. Surprisingly, it is actually possible to print PostScript files on virtually any printer by using the program  Ghostscript.


logo The Math 696 course pages were last modified April 5, 2005.
These pages are copyright © 1995-2005 by Harold P. Boas. All rights reserved.
 
PostScript tricks and hacksDuplex printingHacking PostScript