1 Introduction
PostScript is a graphic programming language developed by Adobe Systems that allows itsuser to produce high-quality graphics and text that can be printed. By high quality we meanthat an author has full control over the graphical output and can produce clean computer codein exactly the way he or she wants it, in contrast with the PostScript code produced by high-end software packages like
xfig
,
pictex
,
METAPOST
,
Adobe Illustrator
, and computeralgebra systems like
Maple
and
Mathematica
. A drawback of this ‘do-it-yourself’ approach isthat an author has to put effort in learning to write PostScript code and that he or she mustaccept less simplicity in return of high quality graphical output. This course is only meantas a short, hands-on introduction to PostScript for newcomers who want to produce rathersimple graphics, say e.g. teachers who want to produce neat graphics for their personallycreated tutorials and tests. The main objective is to get students started with PostScript.A more thorough, but also much longer introduction that also discusses the mathematicsbehinds graphics is the textbook
Mathematical Illustrations
of Bill Casselman [Cas05]. Forcomplete descriptions of the PostScript language we refer to the so-called red book [Pos99],green book [Pos88], and blue book [Pos86]. These are the ultimate reference manuals.We follow a few didactical guidelines in writing the course. Learning is best done fromexamples, learning is done from practice. The examples are often formatted in two columns,as follows:
1
newpath1 1 moveto91 1 lineto91 91 lineto1 91 lineto1 1 linetostroke
The exercises give you the opportunity to practice PostScript; the answers to the exercisesin which a picture or program must be created are provided separately as EncapsulatedPostScript files on a cd-rom and electronically via Internet.
2 Getting Started
PostScript is not a WYSIWYG drawing tool like
xfig
or
paint
. It is a graphic documentpreparation system. First, you write a plain text containing graphic formatting commandsinto a file by means of your favorite editor. Next, an interpreter allows you to previewthe graphical object. We will use two PostScript interpreters, viz.
AFPL Ghostscript
and
GSview
. Both interpreters can be downloaded without cost from
www.cs.wisc.edu/~ghost
.In this chapter we will describe the basics of this process of creating and viewing PostScript,as well as conversion into different graphic formats such as
bitmap
,
gif
, and
jpeg
.
1
On the left is printed the graphic result of the PostScript code on the right. Here, a square is drawn.
3
Add a Comment
exultantelectioleft a comment