PostScript

From MobileRead

Jump to: navigation, search

PostScript (PS) is a page description language and programming language used primarily in the electronic and desktop publishing areas.

Adobe® PostScript® 3™ is the current implementation of PostScript. It is a worldwide printing and imaging standard. The PostScript programming language was originally developed by Adobe Systems to communicate complex graphic printing instructions to digital printers. It is now built into many laser printers for high-quality rendering of both raster and vector graphics.

An important feature of the PostScript language is that it is device independent. This means that it produces good-looking images regardless of the resolution or color rendering method of the output device, and it takes full advantage of the capabilities built into the device. The Adobe Portable Document Format (PDF) is a more structured, compact subset of the PostScript language. Almost anything that can be done in PostScript can be done in PDF.

Type 1 fonts are a specialized form of PostScript program and are the original file format used for type display on all PostScript printers. The PostScript language was later extended to provide support for the later TrueType and OpenType® font standards. Any new Adobe PostScript language device made today supports all three font standards.

The language

PostScript is a complete programming language. It is generally automatically generated by another program but there is no reason that a human could not hand code in this language. It uses RPN (Reverse polish notation) where the data is first input into a stack and then the operator is used to produce the action needed which is replaces the input on the stack. Used in this way there is no need for parenthesis as there would be for Algebraic notation. RPN math to compute (3 + 4) x (5 - 1) might look like:

3 4 add 5 1 sub mul

An example of the PS programming language to produce Hello world! as an output.

%!PS
/Courier findfont
20 scalefont
setfont
72 500 moveto
(Hello world!) show
showpage

For more information

Personal tools
MobileRead Networks