What is Ghostscript?

Ghostscript is a high-performance PostScript and PDF interpreter and rendering engine with the most comprehensive set of page description languages (PDL’s) on the market today and technology conversion capabilities covering PDF, PostScript, PCL and XPS languages.

Ghostscript has been under active development for over 20 years, and offers an extremely versatile feature set and can be deployed across a wide range of platforms, modules, end uses (embedding in hardware, as an engine in document management systems, providing cloud solution integration and as an engine in leading PDF generators and tools).

What are GhostPDL, GhostPCL and GhostXPS?

The graphics library from Ghostscript is also used in several product variants – GhostPCL and GhostXPS. These are interpreters for the PCL and XPS file formats respectively. For customers who license all Ghostscript product variants, you may use GhostPDL to download this single archive and conveniently get all versions with one download.

Where can I download Ghostscript/GhostPDL?

You can download Ghostscript here.

Does Ghostscript support PDF 2.0 standard (ISO 32000-2:2017)?

Yes. Artifex has been a leader in PDF development for over twenty years. We were the first non-Adobe solution for PDF, the first non-Adobe solution that supported PDF 1.4 transparency, and were the first to support PDF 2.0 features.

In reviewing the PDF 2.0 specifications, there has been essentially no changes to the rendering model for PDF. The majority of additions to the PDF 2.0 draft specification is interactive elements (e.g., videos, sound, JavaScript, etc.). Until codecs are added to support video and sound, PDF 2.0 files with those elements cannot be successfully opened.

These standards were just recently released, and it will take some time to properly update and test our support for this new standard. We will keep our community of users and developers update on our progress as we move to incorporate these features into Ghostscript. Stay tuned!

How do I install Ghostscript on Windows?

Download the latest version. If you are unsure whether you want the 32bit or 64bit version, download the 32bit version. Once downloaded, run the installer and follow the on-screen instructions.

A word on which version to use and licensing:
The Ghostscript AGPL license is for developers who wish to share their entire application source code with the open-source community as free software under the AGPL “copyleft” terms. If you are downloading Ghostscript to evaluate it, use the AGPL release. If you are going to be using Ghostscript unchanged and won't be distributing it, then you can use the AGPL release.

If you are looking for a version to distribute with or without modifications, you will need to carefully check the text of the AGPL to see if it is appropriate for your use case.

As soon as you want to distribute Ghostscript in a closed source, proprietary environment, deploy it in a SaaS environment OR wish to receive technical support from Artifex, you have to purchase an Artifex commercial license. Artifex is the exclusive licensing agent for Ghostscript.

More information regarding licensing may be found on the Artifex licensing page. If you are uncertain as to whether you can use the AGPL version or require a commercial license, please contact us at Artifex Sales and we’ll be happy to help.

How do I install Ghostscript on Linux?

Ghostscript is supplied as part of every major Linux distribution. The exact instructions for installing it will differ, but a typical command might be:

apt-get install ghostscript

Alternatively, you can visit https://ghostscript.com/releases and download pre-built binaries of the latest version. These will work on most current 32bit and 64bit Linux PCs. Unpack the supplied archive, and copy the binary into a place on your path as required.

If you do not wish to use binaries, you can always build from source.

How do I build Ghostscript from source on Linux?

The source code for the latest release can again be found on the download page. The latest development versions can be downloaded from http://git.ghostscript.com/?p=ghostpdl.git.

Once you have downloaded (and unpacked) the source, then it can be built using:

./autogen.sh

(Not required for releases)

./configure
make

and optionally:

make install

How do I build Ghostscript from source on Windows?

The source code for the latest release can again be found on the download page. The latest development versions can be downloaded from http://git.ghostscript.com/?p=ghostpdl.git.

Once you have downloaded (and unpacked) the source, then it can be built using Microsoft Visual Studio 2005 or later, including express and community versions.

From within MSVC, choose File => Open Project/Solution and navigate to windows/ghostpdl.vcproj in the source. Once loaded, you can then "Build Solution" to build the binaries.

How do I view a PDF (or PostScript) with Ghostscript on Windows?

Install Ghostscript, then run the PDF you wish to view in an explorer window. If this does not start Ghostscript, then you may need to fiddle with your filetype settings.

Alternatively, Ghostscript can be invoked within a command window:

gswin32c.exe -sDEVICE=display

(For the 64bit version use gswin64c.exe instead)

Ghostscript is an interpreter, not a viewer. As such it offers almost no UI.

How do I view a PDF (or PostScript) with Ghostscript on Unix?

Install Ghostscript. If you have an X based windowing system, then Ghostscript will allow you to view a file in a window. You may be able to run a PostScript/PDF file direct from an explorer window, but this depends on the setup of your distribution.

More normally, Ghostscript can be invoked from a command line prompt (such as an xterm, or a terminal window):

gs -sDEVICE=display

Can I use Ghostscript to convert PS/PDFs to images?

Absolutely. For instance:

gs -sDEVICE=png16m -r300 -o page%d.png

will read inputfile, and render each page of it as a 300dpi PNG into page1.png, page2.png, page3.png etc in turn.

There are many, many more command line switches to control Ghostscript's behavior than we can possibly list here. Full documentation can be found our documentation page. See below for a list of places to look for additional help and information.

Can I use Ghostscript to convert PS/PDFs to other file formats?

Yes, Ghostscript can output several different file formats, including PDF, PostScript, PCL and XPS. Different file formats have different capabilities; for example, attempting to convert from a PDF into PostScript may lose some information. Even converting from PDF to PDF may lose some information. Below is a list of Ghostscript rendering and conversion capabilities:

Languages/Rendering
PDF
PostScript
PCL
XPS

Language/Conversion
PDF -> PS
PDF -> PCL
PDF -> XPS
PDF -> PDFA
PS -> PDF
PS -> PCL
PS -> XPS
PCL -> PDF
PCL -> PS
PCL -> XPS
XPS -> PDF
XPS -> PS
XPS -> PCL

For each conversion, Ghostscript produces a new file that has (as far as possible) the same appearance as the old file. This means that extra 'meta' information in the same file (such as embedded files, or document outlines) may not be transferred across.

Ghostscript has some advanced features to mitigate such losses, but we don't have the room to discuss them all here. Full documentation can be found on our documentation page. See below for a list of places to look for additional help and information.

Can I use Ghostscript to post-process PS/PDFs?

Absolutely. Ghostscript is used extensively by people wishing to convert from one standard of PDF to another and to optimize the output given.

The scope and scale of such tasks are far too large for us to attempt to address here. Full documentation can be found on our documentation page. See below for a list of places to look for additional help.

Are there options to control the quality of the output given?

Yes. Ghostscript can render at higher resolutions, or with anti-aliasing. Depending on the output device in use error diffusion and dithering can be used to optimize the rendition. There is even scope to use very high-quality mechanisms such as "Even-Toned" screening and trapping.

The scope and scale of such tasks are far too large for us to attempt to address here. Full documentation can be found on our documentation page. See below for a list of places to look for additional help.

Why doesn’t my text look as good as it should?

At a given resolution, such as screen resolution which is usually between 72 and 150 dots per inch, the most important option for improving text quality is:

-dTextAlphaBits=4

This should only be used if the output supports many shades of gray or colors (as all modern displays do), but when generating output for monochrome formats such as TIFF G4 (fax) output, this option can actually make text look worse.

Note that some things that look like text may not actually be text, but may come from images or outlines in the input file. To "smooth" everything, as Adobe Acrobat does by default, use:

			-dDOINTERPOLATE
			-dGraphicsAlphaBits=4
			-dTextAlphaBits=4
			

NOTE:The "GraphicsAlphaBits" and "TextAlphaBits", for historical reasons, remain in place, but have limitations and compatibility issues with certain "modern" features (for example, edges of patterns are not properly anti-aliased, and various problems can occur mixing these options with PDF transparency). Hence we implemented and now recommend using our "downscaler" feature. So, instead of -r300 -dGraphicsAlphaBits=4 -dTextAlphaBits=4 for an equivalent effect (without the aforementioned issues) we'd recommend: -r1200 -dDownScaleFactor=4.

Are there any specific discussion forums related to Ghostscript you would recommend?

You may find useful information in the forums we have noted above. In addition, here are links to a couple Stack Overflow forums with some Ghostscript tagged topics you may find helpful.

http://stackoverflow.com/questions/tagged/ghostscript

http://stackoverflow.com/tags/ghostscript/info

Can I embed Ghostscript in my own apps?

Yes. But the licensing selection, AGPL Ghostscript or Artifex Ghostscript, is very important.

If you are prepared to abide by all the stringent requirements of the AGPL, then you may distribute the AGPL version in your application for free. Be aware that the AGPL is a complex document with many restrictions – you should read it thoroughly and if necessary take legal advice before relying on this.

The Ghostscript AGPL license is for developers who wish to share their entire application source code with the open-source community as free software under the AGPL “copyleft” terms. If you are going to be using Ghostscript unchanged and won't be distributing it, then you can use the AGPL release.

If you are looking for a version to distribute with or without modifications, you will need to carefully check the text of the AGPL to see if it is appropriate for your distribution case.

As soon as you want to distribute Ghostscript in a closed source, proprietary environment OR wish to receive technical support from Artifex, you have to purchase an Artifex commercial license. Artifex is the exclusive licensing agent for Ghostscript.

The AGPL explicitly prohibits the deployment of AGPL software in a SaaS (Software as a Service) environment unless all of the software on the server (including the operating system software) is also released under the AGPL with full source code.

More information regarding licensing may be found on the Artifex licensing page. If you are uncertain as to whether you can use the AGPL version or require a commercial license, please contact Artifex Sales and we’ll be happy to help.

If you cannot (or are not prepared to) either follow the terms of the AGPL or get a commercial license from Artifex, then you may not use Ghostscript in any software that you distribute, on pain of legal action.

Does Ghostscript come with support?

Artifex offers a range of support options to its commercial customers and prospective customers. Contact Artifex Sales to discuss the various available options.

The AGPL version of Ghostscript comes with no warranty or guarantee of support, but there are various places where you can seek help. See next FAQ for different sources of information on Ghostscript.

Where can I get more information about how to use Ghostscript?

Full documentation can be found on our documentation page.

If you cannot find what you want, then a simple web search will (in many cases) produce results. If that fails, then there is a community of helpful people at: http://stackoverflow.com/search?q=ghostscript

If your problem is specifically with PostScript, then the Usenet group comp.lang.PostScript has PostScript experts on it.

If all else fails, you can always approach the Ghostscript developers on our Discord or IRC channels.

This channel is logged by Artifex and there is a search facility that might help you find past discussions relevant to your need. Our developers are very busy and are spread across several time zones, so please be patient; just be prepared to ask your question and then wait for a response.

Ghostscript mailing list

You can subscribe (or unsubscribe) to the Ghostscript mailing list here.

What should I do if I uncover a bug?

If you think Ghostscript contains a bug, you may submit a bug report at https://bugs.ghostscript.com. You will need to register before you can submit a bug report. This bug tracking system is NOT FOR QUESTIONS, but you may submit an "enhancement" request. Questions may be asked on our Discord channel #ghostscript or our irc.libera.chat IRC channel, which are monitored closely by our engineering team.

Bugs must include a command line, the original input PS or PDF file and the version of Ghostscript you are using. If you are a customer with a commercial license, your bug report will be given priority over non-customers. Please include your customer ID so we may easilty identify you. Non-customer bugs will be addressed "as time allows".