POSTSCRIPT or PS
- Last UpdatedNov 24, 2025
- 7 minute read
(The POSTSCRIPT and PS drivers are identical.)
Models
These drivers produce output suitable for any printer that can interpret the Postscript page description language.
The driver default options give output suitable for immediate use with the commonest laser printers, which take A4 paper and which produce monochrome and grey-scale output at a resolution of 300 dots per inch (for example, the QMS-810 printer).
The drivers provide a very wide range of options that may be used with PLOT’s soft driver facility to create drivers for other forms of Postscript output (see Creating your Own Device Drivers). For example, printers with different paper sizes or with paper tray selection.
Description
Postscript is a widely used page description language that efficiently describes the appearance of text, images and drawings on the printed page.
Output
The output from these drivers is an ASCII record structured file that conforms to the standard structuring conventions for Postscript multiple page documents. It contains the complete Postscript program needed to print the document defined by the input pseudo code file.
The output is in device code that may be sent directly to the laser printer or may be included in another document as an illustration. The laser printer is treated as a plotter with a single pen, grey-scale pens or colour pens, which can draw vectors in all line styles for both normal and thick lines.
The drawing is scaled to form an image that fills the specified paper size, with options to set margin widths, page orientation, and so on. Other options allow you to control features such as a summarizing banner page, page headers and footers, and page layout.
It may be useful to override the parameters of this driver in the PLOTDRIVERS file, for example to use PDMS colours by default. See the description of this file for further details.
Options
The POSTSCRIPT/PS drivers provide many options. You can specify these either directly, as PLOT command line arguments (see Running PLOT), or indirectly, as parameters in a soft driver definition (see Creating your Own Device Drivers).
For convenience, the descriptions of the driver options are split into two functional groups:
-
Layout options, which control the overall page presentation.
-
General options, which control the banner page and the detailed graphics plotting (including monochrome/grey-scale/colour, scaling, resolution, ).
The syntax for using each option is as follows (individual options must be separated by commas):
[Key: int = an integer; string = a text string]
Layout Options
|
LAyout type |
Defines the output page layout as type, where type is one of the following: |
|---|---|
|
Drawing - |
this produces a PostScript file that takes dimensions from the input plot file and the output is matched to the input. It is unscaled and is not rotated. This layout is suitable for use when a PostScript file is to be used later to produce a pdf file. |
|
Landscape - |
uses the whole page for graphics. The drawing is rotated by 90 degrees and is positioned into the bottom right-hand corner of the image area of the page. If the width and height allow it the drawing will be output unscaled and the message '1:1 SCALE' is displayed and is repeated in the annotation of the output file. If the drawing is oversize it will be rescaled to fill the page (retaining the original width/height ratio). |
|
The output file is a complete PostScript document that may contain many pages and may start with a banner page. |
|
|
The values from the MAP option are used directly with this option. There are no margin or other adjustment factors. The positioning is applied before the rotation, its x values increase to the right, and y values increase upwards. |
|
|
Portrait - |
this is identical to the Landscape layout except that it is positioned into the bottom left-hand corner of the image area of the page and there is no rotation of the drawing. |
|
Whole - |
uses the whole page for graphics, except for a 7 mm margin on all four sides. The drawing is rescaled (retaining the original width/height ratio) and rotated to fill the page as efficiently as possible. The output file is a complete PostScript document that may contain many pages and may start with a banner page. |
|
Margin - |
uses the whole page for graphics, except for a 26 mm margin on all four sides (to allow for punch holes and header/footer texts, ). The drawing is rescaled (retaining the original width/height ratio) and rotated to fill the page as efficiently as possible. The output file is a complete Postscript document that may contain many pages and may start with a banner page. |
|
Figure - |
this layout is identical to MARGIN, except that the drawing is not rotated. |
|
Include - |
produces a file suitable for inclusion in another PostScript document. The layout is identical to FIGURE, but the file contains none of the general Postscript commands to print pages (since these will be provided by the document in which the file is included). |
The LAYOUT MARGIN and LAYOUT FIGURE settings provide locations for three header texts and three footer texts at the left, centre and right of the page, in the top and bottom margins, respectively. These are set as follows:
|
TL string |
Sets the left-hand header text (TL=Top Left) to string. |
|
Default: empty string. |
|
|
TC string |
Sets the central header text (TC=Top Centre) to string. |
|
Default: empty string. |
|
|
TR string |
Sets the right-hand header text (TR=Top Right) to string. |
|
Default: empty string. |
|
|
BL string |
Sets the left-hand footer text (BL=Bottom Left) to string. |
|
Default: empty string. |
|
|
BC string |
Sets the central footer text (BC=Bottom Centre) to string. |
|
Default: empty string. |
|
|
BR string |
Sets the right-hand footer text (BR=Bottom Right) to string. |
|
Default: empty string. |
Note: If a header or footer text is to include spaces, string must be enclosed between single quotes.
You may include the following special characters within header and footer texts:
|
# |
is replaced in the printed output by the current page number (with pages being numbered automatically, starting from a number which you may define). |
|
% |
is replaced in the current date (in the format day, month, year). |
|
PAge int |
Defines an initial page number for the translation of the # character when using automatic page numbering. The default is PAGE 1. |
As an example of the page layout options as part of a command:
plot ps drg.pl drg.out "LA M, TL 'Page #', TR Figure, BC %"
This sets the page layout as follows:
-
Layout is of the type 'Margin' (that means, 26 mm margins all round).
-
Left-head header reads 'Page 1', 'Page 2',
-
Right-hand header text reads 'Figure'.
-
centered footer shows the current date.
General Options
|
BAnner Y/N |
Specifies whether or not a banner page is output at the head of the document. Default: BA Y |
|---|---|
|
EOt Y/N |
Specifies whether the EOT character is output at the end of the PostScript file. This is a communication character required previously for direct operation of a printer but may need to be omitted when a print spooler is being used. Default: EOT Y |
|
IGraphics Y/N |
Allows the use of the initgraphics command. (You should not normally need to change this setting.) Default: IG N |
|
PType string |
Sets page type to string. Where string is a sequence of printer specific PostScript commands to be inserted into the output file at the point where paper size and tray selection might take place. This option does not affect anything else (for example, scaling). |
|
For example, below is an example of the PostScript command to set up a printer to select a particular paper try, perhaps one containing A3 sized paper. The PostScript string used with PTYPE is not standard and needs to be obtained for each model of printer. Below are two examples showing how the printer specific commands might look like to select a particular tray and to select manual feed. |
|
|
PTYPE 'statusdict begin 2 setpapertray end' |
|
|
PTYPE 'statusdict begin /manualfeed true def end' |
|
|
Default: PT |
|
|
MAp x y val1 val2 |
Defines the position of the plot on the paper (x and y coordinates of its origin expressed in mm). It defines the plot dimensions as val1 wide by val2 high. Default: MA 0 0 283.6 197.3 |
|
STeps val |
Sets the printer steps per inch (that means, the printer resolution) to val. Default: ST 300 |
|
GRay |
Selects grey-scale output to represent colors. |
|
MOno Selects monochrome output. |
|
|
RGb Selects RGB color output (using default color definitions |
|
|
Default colour representation: MONO |
|
|
RGb pen r g b |
Selects RGB color mode and defines the red/green/blue colour mix for the specified logical pen number (pen must be in the range 0-15). Default: The colors of the graphics screen device (see following table). |
|
Number |
Color |
Red |
Green |
Blue |
|
0 |
White |
1 |
1 |
1 |
|
1 |
Black |
0 |
0 |
0 |
|
2 |
Orange |
1 |
0.5 |
0 |
|
3 |
Green |
0 |
1 |
0 |
|
4 |
Red |
1 |
0 |
0 |
|
5 |
Blue |
0 |
0.78 |
1 |
|
6 |
Magenta |
0.78 |
0 |
1 |
|
7 |
Yellow |
1 |
1 |
0 |
|
8 |
Sand |
1 |
0.78 |
0 |
|
9 |
Yellow |
1 |
1 |
0 |
|
10 |
Cyan |
0 |
1 |
1 |
|
11 |
Indig |
0 |
0 |
1 |
|
12 |
Violet |
0.5 |
0 |
0.5 |
|
13 |
Light Grey |
0.75 |
0.75 |
0.75 |
|
14 |
Mid Grey |
0.5 |
0.5 |
0.5 |
|
15 |
Dark Grey |
0.25 |
0.25 |
0.25 |
|
FOntname string |
This specifies the font name to be used for text. It is present in the plot file (not as vectors) if the HIGH option is selected. This font is also used for the user name on the banner page. Default: FONT Courier |
|
FLush |
Changes the format of the output file so that a new line is used for each graphical primitive instead of packing each output line. The resulting output file is slightly larger as a result. Default: Not selected. |
|
HIgh |
Specifies that higher-level primitives may be used for text and other output. Default: Not selected. |
As an example a command with the general Postscript control options:
plot ps drg.pl drg.out "BA Y,MA 5 5 250 175,ST 400,
RGB 9 0 1 0.5"
This has the following effects on the printed output:
-
The banner page is printed.
-
The graphical plots have their origins moved 5 mm in each direction from the page origin and the plot sizes are reduced to 250 mm wide by 175 mm high (landscape format).
-
The printer resolution is set to 400 dots per inch.
-
The colour for logical pen number 9 is redefined as the colour mix (0 red)/(1 green)/(0.5 blue).
The overall default settings for all POSTSCRIPT/PS driver options (both layout and general options) are equivalent to:
"BA N,LA L,MA 0 0 283.6 197.3,MO,IG N,PT,ST 300"
Example
|
plot ps view.pl fig1.ps |
|
|
(Output to file, for example, for inclusion in another file) |
|
|
plot postscript view.pl fig1.ps |
|
|
(Output to file, for example, for inclusion in another file) |
|
|
plot postscript view.pl -2 |
|
|
(output direct to printer) |
|
|
plot ps view.pl -2 "LA M,BR 'Page #',MA 10 40 100 70" |
|
|
(Note nested quotation marks. These are needed as 'Page #' is all one string) |
|