summaryrefslogtreecommitdiff
path: root/doc/src/Install.rst
blob: a403dab19c3f1cc5181350f07feddbb4ee868d3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
.. Copyright (C) 2001-2022 Artifex Software, Inc.
.. All Rights Reserved.

.. title:: How to Install Ghostscript


.. include:: header.rst

.. _Install.htm:
.. _HowToInstallGhostscript:


How to Install Ghostscript
===================================




Overview of how to install Ghostscript
----------------------------------------

You must have four things to run Ghostscript:

#. The Ghostscript executable file; on some operating systems, more than one file is required. These are entirely platform-specific. See below for details.

#. 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 :ref:`PostScript files distributed with Ghostscript<PsFiles.htm>`.

   - ``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 :ref:`-dNOFONTMAP switch<UseDNoFontMap>`.

#. 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 :ref:`documentation on fonts<Fonts.htm>`.


The :ref:`usage documentation<Use.htm>` 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:


.. code-block:: bash

   ./configure
   make


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

.. code-block:: bash

   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 :ref:`how to build Ghostscript on Unix<MakeHowToBuildForUnix>` 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 :ref:`usage documentation<Use.htm>` 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 :ref:`how to build Ghostscript as a shared object<Make_SharedObject>` for more details.


Additional notes on Linux
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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


.. code-block:: bash

   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 a binary installer, for the convenience of most users.

Windows 3.1 (16-bit)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

Windows 95, 98, Me
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The last version to be available as a binary for Windows 95/98/Me was 8.60. Although building from source with Visual Studio 2003 should produce a working binary for those versions.

Windows NT4, 2000, XP, 2003 or Vista (32-bit)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The installer is normally named ``gs###w32.exe``, where ``###`` is the release number (e.g., 871 for Ghostscript 8.71, 910 for Ghostscript 9.10).

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

The x64 installer 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 Ghostscript on Windows, you should run the installer executable.

The installer is NSIS-based and 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).


General Windows configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The installer includes files in these subdirectories:

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


The actual executable files for the 32-bit Windows install, in the ``gs#.##\bin`` subdirectory, are:


.. list-table::
      :widths: 20 80
      :header-rows: 0

      * - GSWIN32C.EXE
        - Ghostscript as a 32-bit Windows command line 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.


For the 64-bit Windows install, also in the ``gs#.##\bin`` subdirectory, they are:


.. list-table::
      :widths: 20 80
      :header-rows: 0

      * - GSWIN64C.EXE
        - Ghostscript as a 64-bit Windows command line program. This is usually the preferred executable.
      * - GSWIN64.EXE
        - 64-bit Ghostscript using its own window for commands.
      * - GSDLL64.DLL
        - 64-bit dynamic link library containing most of Ghostscript's functionality.


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

.. code-block:: bash

   -sOutputFile="%printer%printer name"

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

.. code-block:: bash

   HKEY_CURRENT_USER\Software\GPL Ghostscript\#.##

or if that fails, under the key:

.. code-block:: bash

   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 installer will create registry values for the environment variables ``GS_LIB`` and ``GS_DLL``.


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

Alternatively, an uninstall shortcut is also available in the Start Menu group.




Installing Ghostscript on OpenVMS
-------------------------------------------

Support for OpenVMS has stagnated (and almost certainly bit-rotted), and as the core development team has no access to an OpenVMS environment, we are unable to bring it up to date. We will consider patches from contributors if any wish to take on the task of getting it working again. Given the very limited appeal of OpenVMS these days, however, we are unlikely to consider patches with invasive code changes.

You need the file ``GS.EXE`` to run Ghostscript on OpenVMS, and installing Ghostscript on an OpenVMS system requires building it first.

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:

   .. code-block:: bash

      $ 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:

   .. code-block:: bash

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

   .. code-block:: bash

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



.. External links

.. _RPM: http://www.rpm.org/


.. include:: footer.rst