% This file was converted from HTML to LaTeX with Nathan Torkington's
% html2latex program
% Version 0.9b
\chapter{What is PostScript?}

PostScript is a programming language optimized for printing graphics 
and text (whether on paper, film, or CRT is immaterial).  In the 
jargon of the day, it is a {\bf page description language}.  It was 
introduced by Adobe in 1985 and first (to my knowledge) appeared in 
the Apple LaserWriter.  The main purpose of PostScript was to provide 
a convenient language in which to describe images in a device 
independent manner.  This device independence means that the image is 
described without reference to any specific device features ({\it 
e.g.} printer resolution) so that the same description could be used 
on any PostScript printer (say, a LaserWriter or a Linotron) without 
modification.  In practice, some PostScript files do make assumptions 
about the target device (such as its resolution or the number of paper 
trays it has), but this is bad practice and limits portability.
 
The language itself, which is typically interpreted, is stack-based in 
the same manner as an RPN calculator.  A program pushes arguments to 
an operator onto a stack and then invokes the operator.  Typically, 
the operator will have some result which is left at the top of the 
stack.  As an example, let us say we want to multiply 12 and 134.  We 
would use the following PostScript code:

\begin{verbatim}
    12 134 mul
\end{verbatim}

The first two words `\code{12}' and `\code{134}' push the numbers 12 
and 134 onto the stack.  `\code{mul}' invokes the multiply operator 
which pops two values off the stack, multiplies them, and then pushes 
the result back onto the stack.  The resulting value can be left there 
to be used by another operator later in the program.
 
To follow the conventions used by Adobe in their manuals, I will 
synopsize operators using the following scheme:

\begin{center}
  {\it arg-1} {\it arg-2} \ldots {\bf operator} {\it result}
\end{center}

This scheme means that, to use {\bf operator}, you must push arguments 
{\it arg-1}, {\it arg-2}, and so on before invoking the operator.  
{\bf operator} will return the result: {\it result}.  Many operators 
return no result (they have some side-effect); these will be shown as 
returning `{\bf -}'.
