PostScript is a programming language

PostScript is a high-level programming language which resembles the programming language Forth somewhat. Just like some HP calculators, it uses reverse Polish notation (RPN). Since PostScript is virtually always used to describe where something is located on a page, it has a coordinate system. By default the lower left corner of the page is considered to be its starting point. Distances or measurements are usually expressed in points. There are 72 points in an inch. 1 point measures 0.352 mm.

The fact that it is a computer language means that it has its own vocabulary and grammar that are used to create a list of instructions that tell a computer system what to do. You can find the famous “Red book” which describes the syntax here. As with all computer languages, the slightest deviation from the well defined conventions of the language results in an error message and a computer system that refuses to do anything at all. If you print a job to a PostScript device and a network glitch causes the ’showpage’ command to arrive as “shopage” at the output device, the system will happily generate an ‘undefined’ error message and refuse to print your job, even though it has already processed your entire page and the ’showpage’ command is simply there to tell the output device that it can start outputting your masterpiece.

PostScript is a high-end programming language, which means that even mere humans can still look at the instructions and understand what they mean. If you open a PostScript program with a word processor or editor, it may look like this:

%%BeginProlog %%BeginResource: procset AdobePS_Win_Feature_Safe 4.2 0 userdict begin/lucas 21690 def /featurebegin{countdictstack lucas[}bind def /featurecleanup {stopped {cleartomark dup lucas eq{pop exit}if}loop countdictstack exch sub dup 0 gt{{end}repeat}{pop}ifelse}bind def end %%EndResource

It can take a while to understand what the above gibberish means, but you can learn to make sense of it. Of course, this will take years and by the time you are that proficient in programming, your youth will have passed, your computer screen will be more important to you than anything else in the world and the opposite sex will remain a complete mystery to you for the rest of your life (although I am willing to admit that I don’t know how to program and can’t make much sense of women either.)

17 November 2008

2 Responses to “PostScript is a programming language”

  1. rajasekar says:

    please easy to understand details

    • Laurens says:

      I don’t exactly understand what you mean. If you’re asking me to expand this page and add a lot more detail: that is not on my agenda. PostScript is on the way out and gradually getting replaced by PDF. There is no point, for me at least, in spending any more time on it.

Leave a Comment

Polls

I use Adobe InDesign to create

View Results

Loading ... Loading ...

Advertising