2 .\" This file is an edited version of /sys/src/cmd/gs/man/gs.1, to
3 .\" document the local installation and remove needless background.
10 gs \- Aladdin Ghostscript (PostScript and PDF language interpreter)
20 Ghostscript is a programming language similar to Adobe Systems'
21 PostScript and PDF languages, which are in turn similar to Forth.
25 in sequence and executes them as Ghostscript programs.
26 After doing this, it reads further input from the standard input.
30 is named, however, it represents the standard input, which is read
31 in order and not after the files on the command line.
32 Each line is interpreted separately.
33 The `quit' command, or end-of-file, exits the interpreter.
35 The interpreter recognizes several switches described below, which may appear
36 anywhere in the command line and apply to all files thereafter.
42 options give help and list the available devices; the default is
44 which produces compressed image files suitable for viewing with
50 automatically; see its manual).
52 Ghostscript may be built with multiple output devices. Ghostscript
53 normally opens the first one and directs output to it. To use device xyz
54 as the initial output device, include the switch
58 in the command line. This switch must precede the first PostScript
59 file and only its first invocation has any effect.
60 Output devices can also be selected by the word
62 in the input language, or by setting the environment variable
64 The order of precedence for
65 these alternatives, highest to lowest, is:
74 directly to a scratch file.
75 To send the output to a series of files
80 -sOutputFile=foo%d.xyz
86 format specification. Each file will receive one page of output.
87 If the file name begins with a pipe character,
88 the output will be sent as standard input to the following pipeline.
95 will send the files to standard output; this also requires enabling the
98 .SS "Initialization files"
99 When looking for the initialization files
102 to fonts, or the file for the
104 operator, Ghostscript first looks for the file (if
105 it doesn't start with a slash) in the current directory, then in these
106 directories in the following order:
109 Any directories specified by
111 switches in the command
115 Any directories specified by the
117 environment variable;
121 .BR /sys/lib/ghostscript ,
122 .BR /sys/lib/ghostscript/font ,
124 .BR /sys/lib/postscript/font .
131 a single directory or a colon-separated list.
134 .BI -- " filename arg1 ..."
135 Take the next argument as a file name as usual, but take all
136 remaining arguments (even if they have the syntactic form of switches)
137 and define the name ARGUMENTS in userdict (not systemdict) as an
138 array of those strings,
140 running the file. When Ghostscript
141 finishes executing the file, it exits back to the shell.
146 Define a name in systemdict with the given definition. The token must
147 be exactly one token (as defined by the `token' operator) and must not
148 contain any white space.
153 Define a name in systemdict with value=null.
158 Define a name in systemdict with a given string as value. This is
176 Quiet startup: suppress normal startup messages, and also do the
180 .BI -g number1 x number2
182 .BI -dDEVICEWIDTH= number1
184 .BI -dDEVICEHEIGHT= number2\f1.
185 This is for the benefit of devices, such as windows,
186 that allow width and height to be specified.
190 .BI -r number1 x number2
192 .BI -dDEVICEXRESOLUTION= number1
194 \fL-dDEVICE\%YRESOLUTION= \f2\%number2\f1.
195 This is for the benefit of devices, such as printers,
196 that support multiple X and Y resolutions.
197 If only one number is given, it is used for both X and Y resolutions.
200 Adds the designated list of directories at the head of the
201 search path for library files.
203 Note that gs_init.ps makes systemdict read-only, so the values of names
204 defined with -D/d/S/s cannot be changed (although, of course, they can be
205 superseded by definitions in userdict or other dictionaries.)
209 Exit after the last file has been processed.
210 This is equivalent to listing
212 at the end of the list of files.
215 Causes individual character outlines to be loaded from the disk
216 the first time they are encountered. (Normally Ghostscript loads all the
217 character outlines when it loads a font.) This may allow loading more
218 fonts into RAM, at the expense of slower rendering.
221 Disables character caching. Only useful for debugging.
224 Disables the `bind' operator. Only useful for debugging.
227 Suppresses the normal initialization of the output device.
228 This may be useful when debugging.
231 Disables the prompt and pause at the end of each page.
232 This may be desirable for applications where another program
236 `driving' Ghostscript.
244 ability to open files in any mode other than read-only. This may be
245 desirable for spoolers or other sensitive environments.
248 directory may still be opened for writing.
251 Leaves systemdict writable. This is necessary when running
252 special utility programs such as font2c and pcharstr, which must bypass
253 normal PostScript access protection.
256 Selects an alternate initial output device, as described above.
258 .BI -sOutputFile= filename
259 Selects an alternate output file (or pipe) for the initial output
260 device, as described above.
263 .B /sys/lib/ghostscript/*
264 Startup-files, utilities, examples, and basic font definitions.
266 .B /sys/lib/ghostscript/fonts/*
267 Additional font definitions.
274 The Ghostscript document files in
278 subdirectories of the source directory.
280 The treatment of standard input is non-standard.