PostScript is an optimum programming language used for printing graphics and text. It was introduced by Adobe in 1985 .The main purpose of PostScript was to provide a convenient language in which to describe images in a device independent manner. Meaning that the image is described without reference to any specific device features (e.g. printer resolution).
The language itself is typically interpreted to be as stack-based. A program pushes arguments for an operator onto a stack and then invokes the operator. As an example, let us say we want to multiply 20 and 144. We would use the following PostScript code:
20 144 mul
The answer can be left there to be used by another operator later in the program.
The main purpose of PostScript is to draw graphics on the page and even text is a kind of graphic. The main task is constructing paths which may be used to create the image
A path is a collection of, possibly disconnected, lines and areas describing the image. A path is not drawn itself, after it is specified it can be lines or filled areas making the appropriate marks on the page. There is a special type of path called the clipping path; this is a rectangular path within which future drawing is constrained and matches the border of the paper.
Postscript uses a stack, otherwise known as a LIFO (Last In First Out) stack to store programs and data. A postscript interpreter places the postscript program on the stack and executes it, instructions that require data will read that data from the stack. For example, there is an operator in postscript for multiplying two numbers, mul. it requires two arguments, namely the two numbers that are to be multiplied together. In postscript this might be specified as
10 20 mul
The interpreter would place 10 and then 20 onto the stack. The operator mul would remove 20 and then 10 from the stack, multiply them together and leave the result, 200, on the stack. A Path is a collection of, possibly disconnected, lines and areas describing the image and it can be lines or filled areas making the appropriate marks on the page. There is a special type of path called the rectangle clipping path, this is a path within which future drawing is constrained that matches the border of the paper.
The coordinate system is an independent device and can be changed, that is, scaled, rotated, and translated. This is often done to form a more convenient system for the particular drawing being created. The initial coordinate system has the x axis to the right and y axis upwards, the origin is located at the bottom left hand corner of the page. The units are of "points" which are 1/72 of an inch long
A number of operators and data are named Basic Drawing Commands; some operators like new path don't need arguments, others like line to take two arguments from the stack. The text on the left also acts as a link to a printable form of the postscript file. There are also a relative move to and line to commands, namely, rmoveto and rlineto. The drawing commands such as stroke and fill destroy the current path; the way around this is to use gsave that saves the current path so that it can be reinstated with grestore

