|-- filename arg1 ...|
|Takes the next argument as a file name as usual, but takes all remaining arguments (even if they have the syntactic form of switches) and defines the name "ARGUMENTS" in "userdict" (not "systemdict") as an array of those strings, before running the file. When Ghostscript finishes executing the file, it exits back to the shell.|
|Define a name in "systemdict" with the given definition. The token must be exactly one token (as defined by the "token" operator) and may contain no whitespace.|
|-dname||Define a name in "systemdict" with value=null.|
Define a name in "systemdict" with a given string as value. This is
different from -d. For example, -dname=35 is equivalent to the
/name 35 def
whereas -sname=35 is equivalent to
/name (35) def
|-P||Makes Ghostscript to look first in the current directory for library files. By default, Ghostscript no longer looks in the current directory, unless, of course, the first explicitly supplied directory is "." in -I. See also the INITIALIZATION FILES section below, and bundled Use.htm for detailed discussion on search paths and how Ghostcript finds files.|
|-q||Quiet startup: suppress normal startup messages, and also do the equivalent of -dQUIET.|
|Equivalent to -dDEVICEWIDTH=number1 and -dDEVICEHEIGHT=number2. This is for the benefit of devices (such as X11 windows) that require (or allow) width and height to be specified.|
|Equivalent to -dDEVICEXRESOLUTION=number1 and -dDEVICEYRESOLUTION=number2. This is for the benefit of devices such as printers that support multiple X and Y resolutions. If only one number is given, it is used for both X and Y resolutions.|
|Adds the designated list of directories at the head of the search path for library files.|
|-||This is not really a switch, but indicates to Ghostscript that standard input is coming from a file or a pipe and not interactively from the command line. Ghostscript reads from standard input until it reaches end-of-file, executing it like any other file, and then continues with processing the command line. When the command line has been entirely processed, Ghostscript exits rather than going into its interactive mode.|
-dDISKFONTS Causes individual character outlines to be loaded from the disk the first time they are encountered. (Normally Ghostscript loads all the character outlines when it loads a font.) This may allow loading more fonts into RAM, at the expense of slower rendering. -dNOCACHE Disables character caching. Useful only for debugging. -dNOBIND Disables the "bind" operator. Useful only for debugging. -dNODISPLAY Suppresses the normal initialization of the output device. This may be useful when debugging. -dNOPAUSE Disables the prompt and pause at the end of each page. This may be desirable for applications where another program is driving Ghostscript. -dNOPLATFONTS Disables the use of fonts supplied by the underlying platform (for instance X Windows). This may be needed if the platform fonts look undesirably different from the scalable fonts. -dSAFER Restricts file operations the job can perform. Strongly recommended for spoolers, conversion scripts or other sensitive environments where a badly written or malicious PostScript program code must be prevented from changing important files. -dWRITESYSTEMDICT Leaves "systemdict" writable. This is necessary when running special utility programs such as font2c and pcharstr, which must bypass normal PostScript access protection. -sDEVICE=device Selects an alternate initial output device, as described above. -sOutputFile=filename Selects an alternate output file (or pipe) for the initial output device, as described above.
The -dSAFER option disables the "deletefile" and "renamefile" operators and prohibits opening piped commands ("%pipe%cmd"). Only "%stdout" and "%stderr" can be opened for writing. It also disables reading from files, except for "%stdin", files given as a command line argument, and files contained in paths given by LIBPATH and FONTPATH or specified by the system params /FontResourceDir and /GenericResourceDir.
This mode also sets the .LockSafetyParams parameter of the initial output device to protect against programs that attempt to write to files using the OutputFile device parameter. Since the device parameters specified on the command line, including OutputFile, are set prior to SAFER mode, use of "-sOutputFile=..." on the command line is unrestricted.
SAFER mode prevents changing the /GenericResourceDir, /FontResourceDir, /SystemParamsPassword, and /StartJobPassword.
While SAFER mode is not the default, it is the default for many wrapper scripts such as ps2pdf and may be the default in a subsequent release of Ghostscript. Thus when running programs that need to open files or set restricted parameters you should pass the -dNOSAFER command line option or its synonym -dDELAYSAFER.
When running with -dNOSAFER it is possible to perform a "save" followed by ".setsafe", execute a file or procedure in SAFER mode, and then use "restore" to return to NOSAFER mode. In order to prevent the save object from being restored by the foreign file or procedure, the ".runandhide" operator should be used to hide the save object from the restricted procedure.
The locations of many Ghostscript run-time files are compiled into the executable when it is built. On Unix these are typically based in /usr/local, but this may be different on your system. Under DOS they are typically based in C:\GS, but may be elsewhere, especially if you install Ghostscript with GSview. Run "gs -h" to find the location of Ghostscript documentation on your system, from which you can get more details.
/usr/local/share/ghostscript/#.##/* Startup files, utilities, and basic font definitions /usr/local/share/ghostscript/fonts/* More font definitions /usr/local/share/ghostscript/#.##/examples/* Ghostscript demonstration files /usr/local/share/ghostscript/#.##/doc/* Diverse document files
When looking for the initialization files "gs_*.ps", the files related to fonts, or the file for the "run" operator, Ghostscript first tries to open the file with the name as given, using the current working directory if no directory is specified. If this fails, and the file name doesnt specify an explicit directory or drive (for instance, doesnt contain "/" on Unix systems or "\" on MS Windows systems), Ghostscript tries directories in this 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 ":".
1. the directories specified by the -I switches in the command line (see below), if any; 2. the directories specified by the GS_LIB environment variable, if any; 3. the directories specified by the GS_LIB_DEFAULT macro in the Ghostscript makefile when the executable was built. When gs is built on Unix, GS_LIB_DEFAULT is usually "/usr/local/share/ghostscript/#.##:/usr/local/share/ghostscript/fonts" where "#.##" represents the Ghostscript version number.
GS_OPTIONS String of options to be processed before the command line options GS_DEVICE Used to specify an output device GS_FONTPATH Path names used to search for fonts GS_LIB Path names for initialization files and fonts TEMP Where temporary files are made
Ghostscript, or more properly the X11 display device, looks for the following resources under the program name "Ghostscript":
See the usage document for a more complete list of resources. To set these resources on Unix, put them in a file such as "~/.Xresources" in the following form:
borderWidth The border width in pixels (default = 1). borderColor The name of the border color (default = black). geometry The window size and placement, WxH+X+Y (default is NULL). xResolution The number of x pixels per inch (default is computed from WidthOfScreen and WidthMMOfScreen). yResolution The number of y pixels per inch (default is computed from HeightOfScreen and HeightMMOfScreen). useBackingPixmap Determines whether backing store is to be used for saving display window (default = true).
Ghostscript*geometry: 612x792-0+0 Ghostscript*xResolution: 72 Ghostscript*yResolution: 72
Then merge these resources into the X servers resource database:
% xrdb -merge ~/.Xresources
The various Ghostscript document files (above), especially Use.htm.
See http://bugs.ghostscript.com/ and the Usenet news group comp.lang.postscript.
This document was last revised for Ghostscript version 9.06.
Artifex Software, Inc. are the primary maintainers of Ghostscript. Russell J. Lang, gsview at ghostgum.com.au, is the author of most of the MS Windows code in Ghostscript.
|9.06||GS (1)||8 August 2012|