# How to install Ghostscript

## Table of contents

> - Overview of how to install Ghostscript
> - Installing Ghostscript on Unix
>   - Ghostscript as a shared object
>   - Additional notes on Linux
> - Installing Ghostscript on MS Windows
> - Installing Ghostscript on OpenVMS
> - Installing Ghostscript on DOS
> - Installing Ghostscript on OS/2 2.x

For other information, see the Ghostscript overview and "How to build Ghostscript from source code".

## Overview of how to install Ghostscript

You must have three things to run Ghostscript:

1. The Ghostscript executable file; on some operating systems, more than one file is required. These are entirely platform-specific. See below for details.
2. Initialization files that Ghostscript reads in when it starts up; these are the same on all platforms.
   - `gs_`*`.ps` unless Ghostscript was compiled using the "compiled initialization files" option. See the documentation of PostScript files distributed with Ghostscript.
   - `pdf_`*`.ps` if Ghostscript was compiled with the ability to interpret Adobe Portable Document Format (PDF) files, that is, `pdf.dev` was included in `FEATURE_DEVS` when Ghostscript was built.
   - `Fontmap` and `Fontmap.GS` (or the appropriate `Fontmap.`xxx for your platform), unless you plan always to invoke Ghostscript with the `-dNOFONTMAP` switch.
3. Fonts, for rendering text. These are platform-independent, but if you already have fonts of the right kind on your platform, you may be able to use those. See below for details. Also see the documentation on fonts.

The usage documentation describes the search algorithms used to find initialization files and font files. The per-platform descriptions that follow tell you where to install these files.

## Installing Ghostscript on Unix

Ghostscript uses the common configure, build and install method common to many modern software packages. In general the following with suffice to build ghostscript:

> `./configure
> make`

and then it may be installed in the default location with:

> `make install`

This last command may need to be performed with super user privileges.

You can set the installation directory by adding `--prefix=path` to the configure invocation in the first step. The default prefix is `/usr/local`, which is to say the `gs` executable is installed as `/usr/local/bin/gs`.

A list of similar configuration options is available via `./configure --help`

For more detailed information on building Ghostscript see how to build Ghostscript on Unix in the documentation on building Ghostscript, especially regarding information on using the older hand edited makefile approach. Whatever configuration method you use, execute "`make install`" to install the executable and all the required and ancillary files after the build is complete.

### Fonts

The makefile installs all the files except fonts under the directory defined in the makefile as `prefix`. Fonts need to be installed separately. The fonts should be installed in `{prefix}/share/ghostscript/fonts`. (That is, `/usr/local/share/ghostscript/fonts/` if you used the default configuration above.)

If you have Adobe Acrobat installed, you can use the Acrobat fonts in place of the ones distributed with with Ghostscript by adding the Acrobat fonts directory to `GS_FONTPATH` and removing these fonts from `Fontmap.GS`:

> Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique, Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique, Symbol, Times-Bold, Times-BoldItalic, Times-Italic, Times-Roman, ZapfDingbats

Similarly, you can have ghostscript use other fonts on your system by adding entries to the fontmap or adding the directories to the GS_FONTMAP environment variable. See the usage documentation for more information. For example, many linux distributions place fonts under `/usr/share/fonts`.

### Ghostscript as a shared object

If you've built Ghostscript as a shared object, instead of '`make install`', you must use '`make soinstall`'. See how to build Ghostscript as a shared object for more details.

### Additional notes on Linux

For Linux, you may be able to install or upgrade Ghostscript from precompiled RPM files using:

> `rpm -U ghostscript-N.NN-1.i386.rpm
> rpm -U ghostscript-fonts-N.NN-1.noarch.rpm`

However, please note that we do not create RPMs for Ghostscript, and we take no responsibility for RPMs created by others.

## Installing Ghostscript on MS Windows

We usually distribute Ghostscript releases for Windows as self-extracting archive files, since this is the most convenient form for users. These files can also be unpacked as if they were plain zip files.

#### Windows 3.1 (16-bit)

The last version to run on 16-bit Windows 3.1 was Ghostscript 4.03.

#### Windows 95, 98, Me, NT4, 2000, XP, 2003 or Vista (32-bit)

The self-extracting archive is normally named `gs###w32.exe`, where ### is the release number (e.g., 650 for Ghostscript 6.50, 700 for Ghostscript 7.00).

#### Windows XP x64 edition, 2003 or Vista (64-bit)

The x64 self-extracting archive is normally named `gs###w64.exe` This is for 64-bit Windows operating systems based on the x64 instruction set. Do not use this on 64-bit processors running 32-bit Windows.

### Installing

To install a self-extracting Ghostscript archive on Windows, you need just this self-extracting archive file. Run this file to install Ghostscript.

Alternatively, if you have the zip file, unzip it to a temporary directory then run the included `setupgs.exe`. After the setup program has finished, remove the temporary files.

The `setupgs.exe` executable in the zip file (and also in the self-extracting archive) supports a primitive form of unattended installation: if it is invoked with exactly one argument, that one argument is treated as the target installation directory for unattended silent batch installation.

The NSIS-based installer (see also Release.htm supports a few standard NSIS options: `/NCRC` disables the CRC check, `/S` runs the installer or uninstaller silently, `/D` sets the default installation directory (It must be the last parameter used in the command line and must not contain any quotes, even if the path contains spaces. Only absolute paths are supported.)

After installing Ghostscript, it is strongly recommended that you install the GSview previewer, which provides an easier to use graphical interface for Ghostscript. Information on GSview is available from:

> http://www.cs.wisc.edu/~ghost/gsview/

### General Windows configuration

The archive includes files in these subdirectories:

> `gs#.##\bin
> gs#.##\examples
> gs#.##\lib
> gs#.##\doc
> gs#.##\Resource
> fonts`

The actual executable files, in the `gs#.##\bin` subdirectory, are:

> `GSWIN32C.EXE` |  | Ghostscript as a command line Windows program. This is usually the preferred executable.
> `GSWIN32.EXE` |  | 32-bit Ghostscript using its own window for commands
> `GSDLL32.DLL` |  | 32-bit dynamic link library containing most of Ghostscript's functionality

See "Using fonts from Adobe Type Manager" below for information about using Adobe Type Manager, Adobe Type Basics, or Adobe Acrobat fonts. If your system uses TrueType fonts, you can get them converted to a Ghostscript-compatible format at the time you select your "printer" by doing the following:

> 1. Open control panel and double-click on the "Printers" icon.
> 2. Select your PostScript printer.
> 3. Choose Setup.
> 4. Choose Options.
> 5. Choose Advanced.
> 6. At the top of the dialog box you will see TrueType Fonts Send to Printer As: Choose (drop-down menu) Adobe Type 1.
> 7. Uncheck Use Printer Fonts for All TrueType Fonts and Use Substitution Table.
> 8. OK.
> 9. OK etc.

That's it! Your TrueType fonts will automatically be downloaded in your PostScript file for Ghostscript to use.

For printer devices, the default output is the default printer. This can be modified as follows.

> `-sOutputFile="%printer%printer name"`
>   Output to the named printer. If your printer is named "HP DeskJet 500" then you would use `-sOutputFile="%printer%HP DeskJet 500"`.

If Ghostscript fails to find an environment variable, it looks for a registry value of the same name under the key

> `HKEY_CURRENT_USER\Software\GPL Ghostscript\#.##`

or if that fails, under the key

> `HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript\#.##`

where #.## is the Ghostscript version number.

Ghostscript will attempt to load the Ghostscript dynamic link library `GSDLL32.DLL` in the following order:

- In the same directory as the Ghostscript executable.
- If the environment variable `GS_DLL` is defined, Ghostscript tries to load the Ghostscript dynamic link library (DLL) with the name given.
- Using the standard Windows library search method: the directory from which the application loaded, the current directory, the Windows system directory, the Windows directory and the directories listed in the PATH environment variable.

The Ghostscript setup program will create registry values for the environment variables `GS_LIB` and `GS_DLL`.

### Using fonts from Adobe Type Manager

If you have Adobe Type Manager (ATM) 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 Use.htm for more information about `GS_LIB`). Before you do this, please read carefully the license that accompanies the ATM fonts; we take no responsibility for any possible violations of such licenses. Similarly, if you have Adobe Type Basics, you may wish to replace `FONTMAP` with `FONTMAP.ATB`. Finally, if you have neither ATM nor ATB but you have Adobe Acrobat installed, you can use the Acrobat fonts in place of the ones provided with Ghostscript by adding the Acrobat fonts directory to `GS_FONTPATH` and removing these fonts from `FONTMAP`:

> Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique, Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique, Symbol, Times-Bold, Times-BoldItalic, Times-Italic, Times-Roman, ZapfDingbats

### Uninstalling Ghostscript on Windows

To uninstall Ghostscript, use the Control Panel, Add/Remove Programs and remove "Ghostscript #.##" and "Ghostscript Fonts". (The entries may be called "GPL Ghostscript" or "AFPL Ghostscript", rather than just "Ghostscript", depending on what version of Ghostscript was installed.)

## Installing Ghostscript on OpenVMS

You need the file `GS.EXE` to run Ghostscript on OpenVMS, and installing Ghostscript on an OpenVMS system requires building it first: please read how to build Ghostscript on VMS in the documentation on building Ghostscript.

The following installation steps assume that the Ghostscript directory is `DISK1:[DIR.GHOSTSCRIPT]`. Yours will almost certainly be in a different location so adjust the following commands accordingly.

- Download the fonts and unpack them into `DISK1:[DIR.GHOSTSCRIPT.LIB]`.
- Enable access to the program and support files for all users with:

  >     $ set file/prot=w:re DISK1:[DIR]GHOSTSCRIPT.dir
  >     $ set file/prot=w:re DISK1:[DIR.GHOSTSCRIPT...]*.*

- Optionally, add the Ghostscript help instructions to your system wide help file:

  >     $ lib/help sys$help:HELPLIB.HLB DISK1:[DIR.GHOSTSCRIPT.DOC]GS-VMS.HLP

- Lastly, add the following lines to the appropriate system wide or user specific login script.

  >     $ define gs_exe DISK1:[DIR.GHOSTSCRIPT.BIN]
  >     $ define gs_lib DISK1:[DIR.GHOSTSCRIPT.EXE]
  >     $ gs :== $gs_exe:gs.exe

If you have DECWindows/Motif installed, you may wish to replace the `FONTMAP.GS` file with `FONTMAP.VMS`. Read the comment at the beginning of the latter file for more information.

## Installing Ghostscript on DOS

The last version to run on DOS was Aladdin Ghostscript 5.10, which used a 386 DOS extender.

If you are running MS Windows, then use the MS Windows Ghostscript command line executable `GSWIN32C.EXE`.

## Installing Ghostscript on OS/2 2.x

The Ghostscript OS/2 implementation is designed for OS/2 2.1 or later. You need these files to run Ghostscript on OS/2:

> `GSOS2.EXE` |  | A text application that will run windowed or full screen
> `GSDLL2.DLL` |  | A dynamic link library that must be in the same directory as `GSOS2.EXE` or on the `LIBPATH`.
> `GSPMDRV.EXE` |  | An "external driver" used by the `display` device, which is normally the default device and which displays output in a Presentation Manager window; `GSPMDRV.EXE` must be located in the same directory as `GSOS2.EXE` or on the `PATH`

`GSOS2.EXE`, `GSDLL2.DLL` and `GSPMDRV.EXE` are compiled using EMX/GCC 0.9d. You must have the EMX DLLs on your `LIBPATH`; they are available in a package `emxrt.zip` from many places on the Internet.

The system menu of the Ghostscript Image window includes a "Copy" command to copy the currently displayed bitmap to the Clipboard.

OS/2 comes with some Adobe Type Manager fonts. If you wish to use these with Ghostscript, you should replace the `FONTMAP` file with `FONTMAP.OS2`, and add to the environment variable `GS_LIB` (see Use.htm for more information about `GS_LIB`) the name of the directory where the fonts are located, usually `C:\PSFONTS`. Before you do this, please read carefully the license that accompanies the ATM fonts; we take no responsibility for any possible violations of such licenses.

Since `GSOS2.EXE` is not a PM application, it cannot determine the depth of the PM display. You must provide this information using the `-dBitsPerPixel` option. Valid values are 1, 4, 8 (the default), and 24.

> Use |  | For
> `-dBitsPerPixel=1` |  | VGA monochrome
> `-dBitsPerPixel=4` |  | VGA standard
> `-dBitsPerPixel=8` |  | SVGA 256 colors

Standard VGA is very slow because it uses double buffering to avoid bugs and because of 1-plane to 4-plane conversion; it's better to use a 256-color display driver. Many display drivers have bugs which cause 1 bit-per-pixel bitmaps to be displayed incorrectly.

`GSOS2.EXE` and `GSPMDRV.EXE` will stay in memory for the number of minutes specified in the environment variable `GS_LOAD`.

For printer devices, output goes to the default queue. To print to a specified queue, use `-sOutputFile=\\spool\NullLPT1`, where `NullLPT1` is the queue's physical name.

Copyright © 2000-2006 Artifex Software, Inc. All rights reserved.

This software is provided AS-IS with no warranty, either express or implied. This software is distributed under license and may not be copied, modified or distributed except as expressly authorized under the terms of that license. Refer to licensing information at http://www.artifex.com/ or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134, San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.

Ghostscript version 9.02, 30 March 2011