version 2, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
GS |
|
|
2 |
!!!GS |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
INITIALIZATION FILES |
|
|
7 |
X RESOURCES |
|
|
8 |
SWITCHES |
|
|
9 |
SPECIAL NAMES |
|
|
10 |
FILES |
|
|
11 |
ENVIRONMENT |
|
|
12 |
SEE ALSO |
|
|
13 |
BUGS |
|
|
14 |
VERSION |
|
|
15 |
AUTHOR |
|
|
16 |
---- |
|
|
17 |
!!NAME |
|
|
18 |
|
|
|
19 |
|
2 |
perry |
20 |
gs - Ghostscript (!PostScript and PDF language interpreter and previewer) |
1 |
perry |
21 |
!!SYNOPSIS |
|
|
22 |
|
|
|
23 |
|
|
|
24 |
__gs__ [[ ''options'' ] [[ ''files'' ] ... __(Unix, |
|
|
25 |
VMS) |
|
|
26 |
gswin32__ [[ ''options'' ] [[ ''files'' ] ... __(MS |
|
|
27 |
Windows) |
|
|
28 |
gswin32c__ [[ ''options'' ] [[ ''files'' ] ... __(MS |
|
|
29 |
Windows) |
|
|
30 |
gs386__ [[ ''options'' ] [[ ''files'' ] ... __(DOS |
|
|
31 |
for PC) |
|
|
32 |
gsos2__ [[ ''options'' ] [[ ''files'' ] ... |
|
|
33 |
__(OS/2)__ |
|
|
34 |
!!DESCRIPTION |
|
|
35 |
|
|
|
36 |
|
|
|
37 |
The __gs__ (__gswin32__, __gswin32c__, |
|
|
38 |
__gs386__, __gsos2__) command invokes |
|
|
39 |
__Ghostscript__, an interpreter of Adobe Systems' |
2 |
perry |
40 |
__!PostScript__(tm) and __Portable Document Format__ |
1 |
perry |
41 |
(PDF) languages. __gs__ reads |
|
|
42 |
__ |
|
|
43 |
|
|
|
44 |
|
|
|
45 |
The interpreter recognizes several switches described below, |
|
|
46 |
which may appear anywhere in the command line and apply to |
|
|
47 |
all files thereafter. Invoking Ghostscript with the |
|
|
48 |
__-h__ or __-?__ switch produces a message which shows |
|
|
49 |
several useful switches, all the devices known to that |
|
|
50 |
executable, and the search path for fonts; on Unix it also |
|
|
51 |
shows the location of detailed documentation. |
|
|
52 |
|
|
|
53 |
|
|
|
54 |
Ghostscript may be built able to use many different output |
|
|
55 |
devices. To see which devices your executable can use, run |
|
|
56 |
gs -h__ |
|
|
57 |
__ |
|
|
58 |
|
|
|
59 |
|
|
|
60 |
gs myfile.ps |
|
|
61 |
You can also check the set of available devices from within Ghostscript: invoke Ghostscript and type |
|
|
62 |
|
|
|
63 |
|
|
|
64 |
devicenames == |
|
|
65 |
but the first device on the resulting list may not be the default device you determine with gs -h____ |
|
|
66 |
|
|
|
67 |
|
2 |
perry |
68 |
-sDEVICE=!AbcXyz |
1 |
perry |
69 |
For example, for output to an Epson printer you might use the command |
|
|
70 |
|
|
|
71 |
|
|
|
72 |
gs -sDEVICE=epson myfile.ps |
|
|
73 |
The |
|
|
74 |
|
|
|
75 |
|
|
|
76 |
(epson) selectdevice |
|
|
77 |
(myfile.ps) run |
|
|
78 |
All output then goes to the printer until you select another device with the |
|
|
79 |
|
|
|
80 |
|
|
|
81 |
(vga) selectdevice |
|
|
82 |
or |
|
|
83 |
|
|
|
84 |
|
|
|
85 |
(x11) selectdevice |
|
|
86 |
Finally, you can specify a default device in the environment variable __GS_DEVICE__. The order of precedence for these alternatives from highest to lowest (Ghostscript uses the device defined highest in the list) is: |
|
|
87 |
|
|
|
88 |
|
|
|
89 |
selectdevice |
|
|
90 |
(command line) |
|
|
91 |
GS_DEVICE |
|
|
92 |
(first device in build list) |
|
|
93 |
Some printers can print at different resolutions (densities). To specify the resolution on such a printer, use the |
|
|
94 |
|
|
|
95 |
|
|
|
96 |
gs -sDEVICE= |
|
|
97 |
For example, on a 9-pin Epson-compatible printer, you get the lowest-density (fastest) mode with |
|
|
98 |
|
|
|
99 |
|
|
|
100 |
gs -sDEVICE=epson -r60x72 |
|
|
101 |
and the highest-density (best output quality) mode with |
|
|
102 |
|
|
|
103 |
|
|
|
104 |
gs -sDEVICE=epson -r240x72. |
|
|
105 |
If you select a printer as the output device, Ghostscript also allows you to choose where Ghostscript sends the output -- on Unix systems, usually to a temporary file. To send the output to a file |
|
|
106 |
|
|
|
107 |
|
|
|
108 |
-sOutputFile=foo.xyz |
|
|
109 |
You might want to print each page separately. To do this, send the output to a series of files |
|
|
110 |
|
|
|
111 |
|
|
|
112 |
-sOutputFile=foo%d.xyz |
|
|
113 |
Each resulting file receives one page of output, and the files are numbered in sequence. |
|
|
114 |
|
|
|
115 |
|
|
|
116 |
On Unix systems you can also send output to a pipe. For |
|
|
117 |
example, to pipe output to the lpr__ |
|
|
118 |
__ |
|
|
119 |
|
|
|
120 |
|
|
|
121 |
-sOutputFile=|lpr |
|
|
122 |
You can also send output to standard output for piping with the switch |
|
|
123 |
|
|
|
124 |
|
|
|
125 |
-sOutputFile=- |
|
|
126 |
In this case you must also use the __-q__ switch, to prevent Ghostscript from writing messages to standard output. |
|
|
127 |
|
|
|
128 |
|
|
|
129 |
To select a specific paper size, use the command line |
|
|
130 |
switch |
|
|
131 |
|
|
|
132 |
|
|
|
133 |
-sPAPERSIZE=a_known_paper_size |
|
|
134 |
for instance |
|
|
135 |
|
|
|
136 |
|
|
|
137 |
-sPAPERSIZE=a4 |
|
|
138 |
or |
|
|
139 |
|
|
|
140 |
|
|
|
141 |
-sPAPERSIZE=legal |
|
|
142 |
At this time, the known paper sizes, defined in the initialization file |
|
|
143 |
|
|
|
144 |
|
|
|
145 |
Note that the B paper sizes are ISO sizes: for information about using JIS B sizes, see __Use.htm__. |
|
|
146 |
|
|
|
147 |
|
|
|
148 |
Ghostscript can do many things other than print or view |
2 |
perry |
149 |
!PostScript and PDF files. For example, if you want to know |
|
|
150 |
the bounding box of a !PostScript (or EPS) file, Ghostscript |
1 |
perry |
151 |
provides a special |
|
|
152 |
|
|
|
153 |
|
|
|
154 |
gs -sDEVICE=bbox myfile.ps |
|
|
155 |
For example, using one of the example files distributed with Ghostscript, |
|
|
156 |
|
|
|
157 |
|
|
|
158 |
gs -sDEVICE=bbox golfer.ps |
|
|
159 |
prints out |
|
|
160 |
|
|
|
161 |
|
2 |
perry |
162 |
%%!BoundingBox: 0 25 583 732 |
|
|
163 |
%%!HiResBoundingBox: 0.808497 25.009496 582.994503 731.809445 |
1 |
perry |
164 |
!!INITIALIZATION FILES |
|
|
165 |
|
|
|
166 |
|
|
|
167 |
When looking for the initialization files |
|
|
168 |
|
|
|
169 |
|
|
|
170 |
1. |
|
|
171 |
|
|
|
172 |
|
|
|
173 |
the directories specified by the __-I__ switches in the |
|
|
174 |
command line (see below), if any; |
|
|
175 |
|
|
|
176 |
|
|
|
177 |
2. |
|
|
178 |
|
|
|
179 |
|
|
|
180 |
the directories specified by the __GS_LIB__ environment |
|
|
181 |
variable, if any; |
|
|
182 |
|
|
|
183 |
|
|
|
184 |
3. |
|
|
185 |
|
|
|
186 |
|
|
|
187 |
the directories specified by the __GS_LIB_DEFAULT__ macro |
|
|
188 |
in the Ghostscript makefile when the executable was built. |
|
|
189 |
When __gs__ is built on Unix, __GS_LIB_DEFAULT__ is |
|
|
190 |
usually |
|
|
191 |
__ |
|
|
192 |
|
|
|
193 |
|
|
|
194 |
Each of these (__GS_LIB_DEFAULT__, __GS_LIB__, and |
|
|
195 |
__-I__ parameter) may be either a single directory or a |
|
|
196 |
list of directories separated by __ |
|
|
197 |
!!X RESOURCES |
|
|
198 |
|
|
|
199 |
|
|
|
200 |
Ghostscript looks for the following resources under the |
|
|
201 |
program name |
|
|
202 |
|
|
|
203 |
|
|
|
204 |
__borderWidth__ |
|
|
205 |
|
|
|
206 |
|
|
|
207 |
The border width in pixels (default = 1). |
|
|
208 |
|
|
|
209 |
|
|
|
210 |
__borderColor__ |
|
|
211 |
|
|
|
212 |
|
|
|
213 |
The name of the border color (default = black). |
|
|
214 |
|
|
|
215 |
|
|
|
216 |
__geometry__ |
|
|
217 |
|
|
|
218 |
|
|
|
219 |
The window size and placement, WxH+X+Y (default is |
|
|
220 |
NULL). |
|
|
221 |
|
|
|
222 |
|
|
|
223 |
__xResolution__ |
|
|
224 |
|
|
|
225 |
|
|
|
226 |
The number of x pixels per inch (default is computed from |
2 |
perry |
227 |
__!WidthOfScreen__ and |
1 |
perry |
228 |
__WidthMMOfScreen__). |
|
|
229 |
|
|
|
230 |
|
|
|
231 |
__yResolution__ |
|
|
232 |
|
|
|
233 |
|
|
|
234 |
The number of y pixels per inch (default is computed from |
2 |
perry |
235 |
__!HeightOfScreen__ and |
1 |
perry |
236 |
__HeightMMOfScreen__). |
|
|
237 |
|
|
|
238 |
|
|
|
239 |
__useBackingPixmap__ |
|
|
240 |
|
|
|
241 |
|
|
|
242 |
Determines whether backing store is to be used for saving |
|
|
243 |
display window (default = true). |
|
|
244 |
|
|
|
245 |
|
|
|
246 |
See the usage document for a more complete list of |
|
|
247 |
resources. To set these resources on Unix, put them in a |
|
|
248 |
file such as |
|
|
249 |
|
|
|
250 |
|
|
|
251 |
Ghostscript*geometry: 612x792-0+0 |
|
|
252 |
Ghostscript*xResolution: 72 |
|
|
253 |
Ghostscript*yResolution: 72 |
|
|
254 |
Then merge these resources into the X server's resource database: |
|
|
255 |
|
|
|
256 |
|
|
|
257 |
% xrdb -merge ~/.Xresources |
|
|
258 |
!!SWITCHES |
|
|
259 |
|
|
|
260 |
|
|
|
261 |
__--__ ''filename arg1 ...'' |
|
|
262 |
|
|
|
263 |
|
|
|
264 |
Takes the next argument as a file name as usual, but takes |
|
|
265 |
all remaining arguments (even if they have the syntactic |
|
|
266 |
form of switches) and defines the name |
|
|
267 |
before__ running the file. When |
|
|
268 |
Ghostscript finishes executing the file, it exits back to |
|
|
269 |
the shell. |
|
|
270 |
|
|
|
271 |
|
|
|
272 |
__-D__''name''__=__''token'' |
|
|
273 |
|
|
|
274 |
|
|
|
275 |
__-d__''name''__=__''token'' |
|
|
276 |
|
|
|
277 |
|
|
|
278 |
Define a name in |
|
|
279 |
|
|
|
280 |
|
|
|
281 |
__-D__''name'' |
|
|
282 |
|
|
|
283 |
|
|
|
284 |
__-d__''name'' |
|
|
285 |
|
|
|
286 |
|
|
|
287 |
Define a name in |
|
|
288 |
|
|
|
289 |
|
|
|
290 |
__-S__''name''__=__''string'' |
|
|
291 |
|
|
|
292 |
|
|
|
293 |
__-s__''name''__=__''string'' |
|
|
294 |
|
|
|
295 |
|
|
|
296 |
Define a name in |
|
|
297 |
-d__. For example, |
|
|
298 |
__-dname=35__ is equivalent to the program fragment |
|
|
299 |
/name 35 def |
|
|
300 |
whereas __-sname=35__ is equivalent to |
|
|
301 |
/name (35) def |
|
|
302 |
|
|
|
303 |
|
|
|
304 |
__-q__ |
|
|
305 |
|
|
|
306 |
|
|
|
307 |
Quiet startup: suppress normal startup messages, and also do |
|
|
308 |
the equivalent of __-dQUIET__. |
|
|
309 |
|
|
|
310 |
|
|
|
311 |
__-g__''number1''__x__''number2'' |
|
|
312 |
|
|
|
313 |
|
|
|
314 |
Equivalent to __-dDEVICEWIDTH=__''number1'' and |
|
|
315 |
__-dDEVICEHEIGHT=__''number2''. This is for the |
|
|
316 |
benefit of devices (such as X11 windows) that require (or |
|
|
317 |
allow) width and height to be specified. |
|
|
318 |
|
|
|
319 |
|
|
|
320 |
__-r__''number'' |
|
|
321 |
|
|
|
322 |
|
|
|
323 |
__-r__''number1''__x__''number2'' |
|
|
324 |
|
|
|
325 |
|
|
|
326 |
Equivalent to __-dDEVICEXRESOLUTION=__''number1'' and |
|
|
327 |
__-dDEVICEYRESOLUTION=__''number2''. This is for the |
|
|
328 |
benefit of devices such as printers that support multiple X |
|
|
329 |
and Y resolutions. If only one number is given, it is used |
|
|
330 |
for both X and Y resolutions. |
|
|
331 |
|
|
|
332 |
|
|
|
333 |
__-I__''directories'' |
|
|
334 |
|
|
|
335 |
|
|
|
336 |
Adds the designated list of directories at the head of the |
|
|
337 |
search path for library files. |
|
|
338 |
|
|
|
339 |
|
|
|
340 |
__-__ |
|
|
341 |
|
|
|
342 |
|
|
|
343 |
This is not really a switch, but indicates to Ghostscript |
|
|
344 |
that standard input is coming from a file or a pipe and not |
|
|
345 |
interactively from the command line. Ghostscript reads from |
|
|
346 |
standard input until it reaches end-of-file, executing it |
|
|
347 |
like any other file, and then continues with processing the |
|
|
348 |
command line. When the command line has been entirely |
|
|
349 |
processed, Ghostscript exits rather than going into its |
|
|
350 |
interactive mode. |
|
|
351 |
|
|
|
352 |
|
|
|
353 |
Note that the normal initialization file |
|
|
354 |
-D__, |
|
|
355 |
__-d__, __-S__, or __-s__ cannot be changed |
|
|
356 |
(although, of course, they can be superseded by definitions |
|
|
357 |
in __ |
|
|
358 |
!!SPECIAL NAMES |
|
|
359 |
|
|
|
360 |
|
|
|
361 |
__-dDISKFONTS__ |
|
|
362 |
|
|
|
363 |
|
|
|
364 |
Causes individual character outlines to be loaded from the |
|
|
365 |
disk the first time they are encountered. (Normally |
|
|
366 |
Ghostscript loads all the character outlines when it loads a |
|
|
367 |
font.) This may allow loading more fonts into RAM, at the |
|
|
368 |
expense of slower rendering. |
|
|
369 |
|
|
|
370 |
|
|
|
371 |
__-dNOCACHE__ |
|
|
372 |
|
|
|
373 |
|
|
|
374 |
Disables character caching. Useful only for |
|
|
375 |
debugging. |
|
|
376 |
|
|
|
377 |
|
|
|
378 |
__-dNOBIND__ |
|
|
379 |
|
|
|
380 |
|
|
|
381 |
Disables the |
|
|
382 |
|
|
|
383 |
|
|
|
384 |
__-dNODISPLAY__ |
|
|
385 |
|
|
|
386 |
|
|
|
387 |
Suppresses the normal initialization of the output device. |
|
|
388 |
This may be useful when debugging. |
|
|
389 |
|
|
|
390 |
|
|
|
391 |
__-dNOPAUSE__ |
|
|
392 |
|
|
|
393 |
|
|
|
394 |
Disables the prompt and pause at the end of each page. This |
|
|
395 |
may be desirable for applications where another program is |
|
|
396 |
driving Ghostscript. |
|
|
397 |
|
|
|
398 |
|
|
|
399 |
__-dNOPLATFONTS__ |
|
|
400 |
|
|
|
401 |
|
|
|
402 |
Disables the use of fonts supplied by the underlying |
|
|
403 |
platform (for instance X Windows). This may be needed if the |
|
|
404 |
platform fonts look undesirably different from the scalable |
|
|
405 |
fonts. |
|
|
406 |
|
|
|
407 |
|
|
|
408 |
__-dSAFER__ |
|
|
409 |
|
|
|
410 |
|
|
|
411 |
Disables the |
|
|
412 |
|
|
|
413 |
|
|
|
414 |
__-dWRITESYSTEMDICT__ |
|
|
415 |
|
|
|
416 |
|
|
|
417 |
Leaves |
|
|
418 |
font2c__ |
2 |
perry |
419 |
and __pcharstr__, which must bypass normal !PostScript |
1 |
perry |
420 |
access protection. |
|
|
421 |
|
|
|
422 |
|
|
|
423 |
__-sDEVICE=__''device'' |
|
|
424 |
|
|
|
425 |
|
|
|
426 |
Selects an alternate initial output device, as described |
|
|
427 |
above. |
|
|
428 |
|
|
|
429 |
|
|
|
430 |
__-sOutputFile=__''filename'' |
|
|
431 |
|
|
|
432 |
|
|
|
433 |
Selects an alternate output file (or pipe) for the initial |
|
|
434 |
output device, as described above. |
|
|
435 |
!!FILES |
|
|
436 |
|
|
|
437 |
|
|
|
438 |
The locations of many Ghostscript run-time files are |
|
|
439 |
compiled into the executable when it is built. On Unix these |
|
|
440 |
are typically based in __/usr/local__, but this may be |
|
|
441 |
different on your system. Under DOS they are typically based |
|
|
442 |
in __C:GS__, but may be elsewhere, especially if you |
|
|
443 |
install Ghostscript with __GSview__. Run __gs |
|
|
444 |
-h__ |
|
|
445 |
__ |
|
|
446 |
|
|
|
447 |
|
|
|
448 |
__/usr/local/share/ghostscript/#.##/*__ |
|
|
449 |
|
|
|
450 |
|
|
|
451 |
Startup files, utilities, and basic font |
|
|
452 |
definitions |
|
|
453 |
|
|
|
454 |
|
|
|
455 |
__/usr/local/share/ghostscript/fonts/*__ |
|
|
456 |
|
|
|
457 |
|
|
|
458 |
More font definitions |
|
|
459 |
|
|
|
460 |
|
|
|
461 |
__/usr/local/share/ghostscript/#.##/examples/*__ |
|
|
462 |
|
|
|
463 |
|
|
|
464 |
Ghostscript demonstration files |
|
|
465 |
|
|
|
466 |
|
|
|
467 |
__/usr/local/share/ghostscript/#.##/doc/*__ |
|
|
468 |
|
|
|
469 |
|
|
|
470 |
Diverse document files |
|
|
471 |
!!ENVIRONMENT |
|
|
472 |
|
|
|
473 |
|
|
|
474 |
__GS_OPTIONS__ |
|
|
475 |
|
|
|
476 |
|
|
|
477 |
String of options to be processed before the command line |
|
|
478 |
options |
|
|
479 |
|
|
|
480 |
|
|
|
481 |
__GS_DEVICE__ |
|
|
482 |
|
|
|
483 |
|
|
|
484 |
Used to specify an output device |
|
|
485 |
|
|
|
486 |
|
|
|
487 |
__GS_FONTPATH__ |
|
|
488 |
|
|
|
489 |
|
|
|
490 |
Path names used to search for fonts |
|
|
491 |
|
|
|
492 |
|
|
|
493 |
__GS_LIB__ |
|
|
494 |
|
|
|
495 |
|
|
|
496 |
Path names for initialization files and fonts |
|
|
497 |
|
|
|
498 |
|
|
|
499 |
__TEMP__ |
|
|
500 |
|
|
|
501 |
|
|
|
502 |
Where temporary files are made |
|
|
503 |
!!SEE ALSO |
|
|
504 |
|
|
|
505 |
|
|
|
506 |
The various Ghostscript document files (above), especially |
|
|
507 |
__Use.htm__. |
|
|
508 |
!!BUGS |
|
|
509 |
|
|
|
510 |
|
|
|
511 |
See the Usenet news group comp.lang.postscript. |
|
|
512 |
!!VERSION |
|
|
513 |
|
|
|
514 |
|
|
|
515 |
This document was last revised for Ghostscript version |
|
|
516 |
6.53. |
|
|
517 |
!!AUTHOR |
|
|
518 |
|
|
|
519 |
|
|
|
520 |
L. Peter Deutsch |
|
|
521 |
---- |