|
|
The interpreter recognizes several switches described below, which may appear anywhere in the command line and apply to all files thereafter.
You can get a help message by invoking Ghostscript with the -h or -? option. This message also lists the available devices.
Ghostscript may be built with multiple output devices. Ghostscript normally opens the first one and directs output to it. To use device xyz as the initial output device, include the switch
-sDEVICE=xyzin the command line. Note that this switch must precede the first .ps file, and only its first invocation has any effect. For example, for printer output in a normal configuration that includes an Epson printer driver, you might use the shell command
gs -sDEVICE=epson myfile.psinstead of just
gs myfile.psAlternatively, you can type
(epson) selectdevice (myfile.ps) runAll output then goes to the printer instead of the display until further notice. You can switch devices at any time by using the selectdevice procedure, e.g.,
(vga) selectdeviceor
(epson) selectdeviceAs yet a third alternative, you can define an environment variable GS_DEVICE as the desired default device name. The order of precedence for these alternatives, highest to lowest, is:
selectdevice (command line) GS_DEVICE (first device in build list)
To select the density on a printer, use
gs -sDEVICE=<device> -r<xres>x<yres>For example, on a 9-pin Epson-compatible printer, you can get the lowest-density (fastest) mode with
gs -sDEVICE=epson -r60x72and the highest-density mode with
gs -sDEVICE=epson -r240x72.
If you select a printer as the output device, Ghostscript also allows you to control where the device sends its output. Normally, output goes directly to a scratch file on Unix systems. To send the output to a series of files foo1.xyz, foo2.xyz, ..., use the switch
-sOutputFile=foo%d.xyzThe %d is a printf format specification; you can use other formats like %02d. Each file will receive one page of output. Alternatively, to send the output to a single file foo.xyz, with all the pages concatenated, use the switch
-sOutputFile=foo.xyz
On Unix systems, you can send the output directly to a pipe. For example, to pipe the output to the command `lpr' (which, on many Unix systems, is the command that spools output for a printer), use the switch
-sOutputFile=lprYou can also send output to stdout for piping with the switch
-sOutputFile=-In this case you must also use the -q switch, to prevent Ghostscript from writing messages to stdout.
To find out what devices are available, type
devicenames ==after starting up Ghostscript. Alternatively, you can use the -h or -? switch in the command line; the help message also lists the available devices.
When looking for the initialization files (gs_*.ps), the files related to fonts, or the file for the `run' operator, Ghostscript first tries opening the file with the name as given (i.e., using the current working directory if none is specified). If this fails, and the file name doesn't specify an explicit directory or drive (i.e., doesn't begin with `/' on Unix systems), Ghostscript will try directories in the following order:
Each of these (GS_LIB_DEFAULT, GS_LIB, and -I parameter) may be either a single directory, or a list of directories separated by a `:'.
See the file `use.doc' for a more complete list of resources.
To set these resources, put them in a file (such as ~/.Xresources) in the following form:
Ghostscript*geometry: 612x792-0+0 Ghostscript*xResolution: 72 Ghostscript*yResolution: 72
Then load the defaults into the X server:
% xrdb -merge ~/.Xresources
|
|
Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97