How to install Ghostscript

## Table of contents

> - Overview of how to install Ghostscript
> - Installing Ghostscript on Unix
>   - 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

You need the file `gs` to run Ghostscript on Unix, and installing Ghostscript on a Unix system requires building it first: please read how to build Ghostscript on Unix in the documentation on building Ghostscript, especially regarding how to decide which makefile to use and how you may need to edit it. After building, execute "`make install`" to install the executable and all the required and ancillary files.

The makefile installs all the files except fonts under the directory defined in the makefile as "`prefix`", `/usr/local` by default. The fonts should be installed in {prefix}`/share/ghostscript/fonts`. Consult the makefile for more details. If 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.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

## Additional notes on Linux

Red Hat Linux 6 and later installs the Ghostscript base 35 fonts in `/usr/share/fonts/default/Type1`, and the other Ghostscript fonts in `/usr/share/fonts/default/ghostscript`.

For Linux, you can 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`

# Installing Ghostscript on MS Windows

Aladdin Enterprises usually distributes Ghostscript releases for Windows as self-extracting archive files, since this is the most convenient form for users. However, we or other parties may distribute releases in the form of plain zip archives.

The self-extracting archive is normally named `gs###w32.exe`, where ### is the release number (e.g., 403 for Ghostscript 4.03, 600 for Ghostscript 6.0).

The zip archive is normally named `gs###w32.zip`, where ### is the release number (e.g., 403 for Ghostscript 4.03, 600 for Ghostscript 6.0).

Only one of `gs###w32.exe` or `gs###w32.zip` is required.

## Windows 95/98 and NT 4

To install a self-extracting Ghostscript archive on Windows 95/98 or Windows NT 4, 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.

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/

## Win32s (Windows 3.1) and Windows NT 3.5

To install Ghostscript on Win32s (partial 32-bit environment under MS Windows 3.1), or Windows NT 3.5 you need the same archive file. However, the self extracting archive will not automatically run and install the Ghostscript. You must manually unzip this archive and install it. To install Ghostscript, execute the following commands in a Command Prompt window (replacing ### with the release number):

> `c:
> mkdir \Aladdin
> cd \Aladdin
> ftp get gs###w32.zip
> unzip gs###w32.zip`

If the file is named `.zip` and not `.exe`, unzip it using

> `unzip gs###w32.zip`

After unpacking the archive, create a shortcut to

> `c:\Aladdin\gs#.#\bin\gswin32.exe`

If you place Ghostscript in a different directory, you will need to set `GS_LIB` or use the command line option `-I`. See Use.htm for details.

## General Windows configuration

The archive includes files in these subdirectories:

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

Note that the subdirectory is only #.#, not #.##, if the release number ends in 00. E.g., for release 6.0, ### is 600, but #.# is 6.0.

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

> `GS16SPL.EXE` |  | Print spooler for Win32s (Windows 3.1) only; must be in the same directory as `GSWIN32.EXE`
> `GSWIN32.EXE` |  | 32-bit Ghostscript using windows
> `GSWIN32C.EXE` |  | 32-bit Ghostscript using only the command line
> `GSDLL32.DLL` |  | 32-bit dynamic link library containing most of Ghostscript's functionality

See "Installing Ghostscript on DOS" 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 |  | Win95 or WinNT
> Prompt for a printer port |  | Win32s (Windows 3.1)

This can be modified as follows.

> `-sOutputFile="LPT1:"`
>   Output to the named port.
> `-sOutputFile="\\spool\printer name"` (Windows 95 or Windows NT)
>   Output to the named printer.
> `-sOutputFile="\\spool"` (Windows 95 or Windows NT)
>   Prompt for the name of a printer. Only local printers are supported.

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\Aladdin Ghostscript\#.##`

or if that fails, under the key

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

where #.## is the Ghostscript version number. This does not work under Win32s (that is, Windows 3.1, which doesn't support named registry values).

If the environment variable `GS_DLL` is defined, Ghostscript tries to load the Ghostscript dynamic link library (DLL) with the name given. If this fails, Ghostscript tries to load `GSDLL32.DLL` from the current directory, the search path or the same directory as the Ghostscript executable.

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

# 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.

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 documentation on building Ghostscript for more details.

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

You need the files `GS386.EXE` and `DOS4GW.EXE` to run Ghostscript. 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 (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 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. 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

# Installing Ghostscript on OS/2 2.x

The Ghostscript OS/2 implementation is designed for OS/2 2.1 or later. A few people have used it successfully under OS/2 2.0, but it has had very little testing. 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 "`os2pm`" 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.9b. You must have the EMX DLLs on your `LIBPATH`; they are available in a package `emxrt*.zip` from many places on the Internet, so you can find the package by using a search engine or an ftp lookup service such as the one at

> http://ftpsearch.lycos.com/

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 below 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; Aladdin Enterprises takes 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

A command file `gspm.cmd` containing the following line may be useful:

> `@c:\gs\gsos2.exe -Ic:/gs;c:/gs/fonts;c:/psfonts -sDEVICE=os2pm -dBitsPerPixel=8 -sPAPERSIZE=a4 %1 %2 %3 %4 %5 %6 %7 %8`

While drawing, the `os2pm` driver updates the display every 5 seconds. On slow computers this is undesirable, and a different interval can be specified in milliseconds with the `-dUpdateInterval` option, with a default of `-dUpdateInterval=5000`; to disable update, use `-dUpdateInterval=0`.

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`.

If you run `GS386` in the OS/2 2.0 or 2.1 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.

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 © 1996, 1997, 1998 Aladdin Enterprises. All rights reserved.

This file is part of Aladdin Ghostscript. See the Aladdin Free Public License (the "License") for full details of the terms of using, copying, modifying, and redistributing Aladdin Ghostscript.

Ghostscript version 6.0, 3 February 2000