This file is part of Ghostscript.
Ghostscript is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. No author or distributor accepts responsibility to anyone for the consequences of using it or for whether it serves any particular purpose or works at all, unless he says so in writing. Refer to the Ghostscript General Public License for full details.
Everyone is granted permission to copy, modify and redistribute Ghostscript, but only under the conditions described in the Ghostscript General Public License. A copy of this license is supposed to have been given to you along with Ghostscript so you can know your rights and responsibilities. It should be in a file named COPYING. Among other things, the copyright notice and this notice must be preserved on all copies.
For an overview of Ghostscript and a list of the documentation files, see README.
******************************************** ******** How to install Ghostscript ******** ********************************************
To run Ghostscript, you need the executable program, and also some
external initialization files:
The file name of the executable program depends on the environment; see the instructions for the specific platforms below.
The Ghostscript fileset includes a set of fonts (.gsf files); you should have them on line as well.
You should install all the files, including the fonts, in the same directory as the executable and initialization files. By default, this is the directory in which you did the compilation. Consult the command file (VMS-CC.MAK or VMS-GCC.MAK) for more details.
If you have DECWindows/Motif installed, you may wish to replace the FONTMAP file with the file FONTMAP.VMS. Read the comment at the beginning of the latter file for more information.
You should install all the files except the fonts in C:\GS, and the fonts in C:\GS\FONTS.
If you have Adobe Type Manager fonts installed on your system, and you wish to use them with Ghostscript, you may wish to replace the FONTMAP file with FONTMAP.ATM, and to add to the environment variable GS_LIB the name of the directory where the fonts are located (see below for more information about GS_LIB). Before you do this, please read carefully the license that accompanies the ATM fonts; Aladdin Enterprises takes no responsibility for any possible violations of such licenses.
You should install all the files except the fonts in C:\GS, and the fonts in C:\GS\FONTS.
See under "MS-DOS" above for information about using Adobe Type Manager fonts with Ghostscript.
If you run GS386 in the OS/2 2.0 DOS Box, you must select the "ENABLED" setting for the DPMI_DOS_API option of the DOS Box. GS386 will not run with the "AUTO" setting.
************************************** ******** Shell scripts for Ghostscript **************************************
> pv.sh - preview a specified page of a dvi file in an X window.
> sysvlp.sh - System V 3.2 lp interface for parallel printer.
> pj-gs.sh - printing on an H-P PaintJet under HP-UX.
> unix-lpr.sh - queue filter for lpr under Unix.
> lprsetup.sh - setup for unix-lpr.sh.
If one of these serves your needs, you may be able to skip most of the rest of this document.
********************************************************* ********* How to use the Ghostscript interpreter ******** *********************************************************
You can get a help message by invoking Ghostscript with
gs -h or gs -?This message also lists the available devices. For a little more information, a one-line description of each device appears near the beginning of the file devs.mak.
(vga) selectdevice or (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
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 the printer (PRN) on MS-DOS systems, and to a scratch file on Unix or VMS systems. To send the output to a series of files foo1.xyz, foo2.xyz, ..., use the switch
To find out what devices are available, type
Printing on a Hewlett-Packard LaserJet at full resolution (300 DPI) requires a printer with at least 1.5 Mb of memory. 150 DPI printing requires only .5 Mb. You can select 150 DPI printing with the command line switch
On MS-DOS systems using the Borland compiler, if Ghostscript gives you a 'limitcheck in setdevice' error, it may mean Ghostscript's standard buffer size wasn't large enough. Likewise, if Ghostscript gives you a 'VMerror in setdevice' error, it means the buffer size was too large. You can use the -dBufferSpace= switch to set the buffer size to a different value, e.g.,
When Ghostscript starts up, it also looks at the GS_FONTPATH environment variable, which is also a list of directories. It goes to those directories and looks for all files that appear to contain PostScript fonts; it then effectively adds all those files and fonts to its internal copy of the Fontmap (the catalog of fonts and the files that contain them).
Ghostscript currently doesn't do a very good job of deleting temporary files when it exits; you may have to delete them manually from time to time.
********************************************* ******** Notes on specific platforms ******** *********************************************
If you are on an X Windows display (for which gs is built), you can do
If you are using the BGI driver, two additional environment variables become relevant:
BGIPATH - defines the directory where Ghostscript will look for the appropriate BGI driver. If BGIPATH is not defined, Ghostscript will look in the directory defined as BGIDIR in the makefile. In either case, if no driver is found in the designated directory, Ghostscript will look in the current directory.
BGIUSER - a string of the form nn.dname, where nn is a hexadecimal number giving a display mode and dname is the name of a file containing a user-supplied BGI driver. If BGIUSER is defined and the BGI device is selected, Ghostscript will supply nn as the display mode and will obtain the driver from the file named dname.
Some applications, such as Microsoft Word, require a prologue in front of the PostScript files they output. In the case of Word, this is one of the *.ini files included with the Word distribution. Other applications may require other prologues. These may be specified on the Ghostscript command line, e.g.,
Name Class Default ---- ----- ------- background Background white foreground Foreground black borderColor BorderColor black borderWidth BorderWidth 1 geometry Geometry NULL xResolution Resolution ** yResolution Resolution ** useExternalFonts UseExternalFonts true useScalableFonts UseScalableFonts true logExternalFonts LogExternalFonts false externalFontTolerance ExternalFontTolerance 10.0 palette Palette Color maxGrayRamp MaxGrayRamp 128 maxRGBRamp MaxRGBRamp 5 useBackingPixmap UseBackingPixmap true useXPutImage UseXPutImage true useXSetTile UseXSetTile true regularFonts RegularFonts see below symbolFonts SymbolFonts see below dingbatFonts DingbatFonts see below ** Calculated from display metrics. Notes on Resources: The geometry resource only affects window placement. Resolution is given in pixels per inch. The font tolerance gives largest acceptable difference in height of the screen font. The tolerance is expressed as a percentage of the height of the desired font. The palette resource can be used to restrict ghostscript to using a grayscale or monochrome palette. The maxRGBRamp and maxGrayRamp control the maximum number of colors that ghostscript allocates ahead of time for the dither cube/ramp. Ghostscript will never preallocate more than half of the cells in a colormap.To use native X11 fonts, ghostscript must map PostScript font names to the XLFD font names. The regularFonts, symbolFonts, and dingbatFonts resources give the name mapping for different encodings. The XLFD font name in the mapping must contain seven dashes. The X driver adds the additional size and encoding fields to bring the total number of dashes in the font name to 14. Here are the default font mappings:
Regular Fonts: (Fonts available in standard or ISO-Latin-1 encoding)
AvantGarde-Book:-Adobe-ITC Avant Garde Gothic-Book-R-Normal--\n\ AvantGarde-BookOblique:-Adobe-ITC Avant Garde Gothic-Book-O-Normal--\n\ AvantGarde-Demi:-Adobe-ITC Avant Garde Gothic-Demi-R-Normal--\n\ AvantGarde-DemiOblique:-Adobe-ITC Avant Garde Gothic-Demi-O-Normal--\n\ Bookman-Demi:-Adobe-ITC Bookman-Demi-R-Normal--\n\ Bookman-DemiItalic:-Adobe-ITC Bookman-Demi-I-Normal--\n\ Bookman-Light:-Adobe-ITC Bookman-Light-R-Normal--\n\ Bookman-LightItalic:-Adobe-ITC Bookman-Light-I-Normal--\n\ Courier:-Adobe-Courier-Medium-R-Normal--\n\ Courier-Bold:-Adobe-Courier-Bold-R-Normal--\n\ Courier-BoldOblique:-Adobe-Courier-Bold-O-Normal--\n\ Courier-Oblique:-Adobe-Courier-Medium-O-Normal--\n\ Helvetica:-Adobe-Helvetica-Medium-R-Normal--\n\ Helvetica-Bold:-Adobe-Helvetica-Bold-R-Normal--\n\ Helvetica-BoldOblique:-Adobe-Helvetica-Bold-O-Normal--\n\ Helvetica-Narrow:-Adobe-Helvetica-Medium-R-Narrow--\n\ Helvetica-Narrow-Bold:-Adobe-Helvetica-Bold-R-Narrow--\n\ Helvetica-Narrow-BoldOblique:-Adobe-Helvetica-Bold-O-Narrow--\n\ Helvetica-Narrow-Oblique:-Adobe-Helvetica-Medium-O-Narrow--\n\ Helvetica-Oblique:-Adobe-Helvetica-Medium-O-Normal--\n\ NewCenturySchlbk-Bold:-Adobe-New Century Schoolbook-Bold-R-Normal--\n\ NewCenturySchlbk-BoldItalic:-Adobe-New Century Schoolbook-Bold-I-Normal--\n\ NewCenturySchlbk-Italic:-Adobe-New Century Schoolbook-Medium-I-Normal--\n\ NewCenturySchlbk-Roman:-Adobe-New Century Schoolbook-Medium-R-Normal--\n\ Palatino-Bold:-Adobe-Palatino-Bold-R-Normal--\n\ Palatino-BoldItalic:-Adobe-Palatino-Bold-I-Normal--\n\ Palatino-Italic:-Adobe-Palatino-Medium-I-Normal--\n\ Palatino-Roman:-Adobe-Palatino-Medium-R-Normal--\n\ Times-Bold:-Adobe-Times-Bold-R-Normal--\n\ Times-BoldItalic:-Adobe-Times-Bold-I-Normal--\n\ Times-Italic:-Adobe-Times-Medium-I-Normal--\n\ Times-Roman:-Adobe-Times-Medium-R-Normal--\n\ ZapfChancery-MediumItalic:-Adobe-ITC Zapf Chancery-Medium-I-Normal-- Symbol Fonts: (using Symbol encoding) Symbol: -Adobe-Symbol-Medium-R-Normal-- Dingbat Fonts: (using Dingbat encoding) ZapfDingbats: -Adobe-ITC Zapf Dingbats-Medium-R-Normal--To set these resources, put them in a file (such as ~/.Xdefaults) in the following form:
Ghostscript*geometry: -0+0
Ghostscript*xResolution: 72
Ghostscript*yResolution: 72
Then load the defaults into the X server:
% xrdb -merge ~/.Xdefaults
On H-P systems, Ghostscript will take advantage of the "HP XLFD Enhancements" to use native X11 fonts for fonts that are anamorphically scaled, rotated, or mirrored. If the user has installed these changes to their X or font server, they will automatically be used when appropriate.
@filename Causes Ghostscript to read filename and treat its contents the same as the command line. (This is intended primarily for getting around DOS' 128-character limit on the length of a command line.) Switches or file names in the file may be separated by any amount of white space (space, tab, line break); there is no limit on the size of the file. -- 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. -Dname=token -dname=token Define a name in systemdict with the given definition. The token must be exactly one token (as defined by the 'token' operator) and must not contain any whitespace. -Dname -dname Define a name in systemdict with value=null. -Sname=string -sname=string Define a name in systemdict with a given string as value. This is different from -d. For example, -dname=35 is equivalent to the program fragment /name 35 def whereas -sname=35 is equivalent to /name (35) def -q Quiet startup -- suppress normal startup messages, and also do the equivalent of -dQUIET. -ffilename Executes the given file, even if its name begins with a -. -gnumber1xnumber2 Equivalent to -dDEVICEWIDTH=number1 and -dDEVICEHEIGHT=number2. This is for the benefit of devices (such as X11 windows and VESA displays) that require (or allow) width and height to be specified. -rnumber -rnumber1xnumber2 Equivalent to -dDEVICEXRESOLUTION=number1 and -dDEVICEYRESOLUTION=number2. This is for the benefit of devices (such as printers) that support multiple X and Y resolutions. -Idirectories Adds the designated list of directories at the head of the search path for library files. - This is not really a switch. It indicates to Ghostscript that the standard input is coming from a file or a pipe. Ghostscript reads from stdin until reaching end-of-file, executing it like any other file, and then continues processing the command line. At the end of the command line, Ghostscript exits rather than going into its interactive mode.Note that gs_init.ps makes systemdict read-only, so the values of names defined with -D/d/S/s cannot be changed (although, of course, they can be superseded by definitions in userdict or other dictionaries.)
-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. -dNOBIND disables the 'bind' operator. Only useful for debugging. -dNOCACHE disables character caching. Only useful 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 (X Windows or Microsoft Windows). This may be needed if the platform fonts look undesirably different from the scalable fonts. -dSAFER disables the deletefile and renamefile operators, and the ability to open files in any mode other than read-only. This may be desirable for spoolers or other sensitive environments. -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.
-A Turn on allocator debugging (gs_malloc and gs_free). -e Turn on tracing of error returns from operators. -E Abort when any operator returns with an error. -Mn Force the interpreter's allocator to acquire additional memory in units of nK, rather than the default (currently 20K on MS-DOS systems, 50K on Unix). n is a positive decimal integer (not exceeding 63 on MS-DOS systems). -Zxxx Turn on debugging printout. Each of the xxx characters selects an option: if the string is empty, all options are selected. Case is significant. 1 = type 1 font interpreter (type1addpath) 2 = curve subdivider/rasterizer a = allocator (large blocks only) A = allocator (all calls) b = bitmap image processor B = bitmap images, detail c = color/halftone mapper d = dictionary put/undef f = fill algorithm (summary) F = fill algorithm (detail) g = gsave/grestore[all] h = halftone renderer i = interpreter, just names I = interpreter, everything k = character cache & xfonts K = character cache, every access l = command lists, bands L = command lists, everything m = makefont and font cache n = name lookup (new names only) o = outliner (stroke) p = path tracer q = clipping r = arc renderer s = scanner t = tiling algorithm u = undo saver (for save/restore) U = undo saver, more detail v = rectangle fill V = device-level output w = compression encoder/decoder x = transformations y = Type 1 hints Y = Type 1 hints, every access z = trapezoid fill