Ghostscript is a processor for PostScript and PDF files. It can rasterize these files to a wide variety of printers, devices for screen preview, and image file formats. Since applications tend to prepare pages for printing in a high-level format such as PostScript, most Unix users with low-level bitmap printers, such as inkjets, use GhostScript as part of the printing process. In addition, Ghostscript is capable of converting PostScript files, functionality comparable to Adobe Acrobat Distiller, but on the command line. In addition, Ghostscript is used for file import and viewing by a great many other applications, including xv, ImageMagick, gimp, and xdvi. Several GUI wrappers for viewing PostScript and PDF files exist, including GSview, ghostview, gv, ggv, and kghostview. This is far from a comprehensive list.
| Tags | multimedia Graphics Graphics Conversion Viewers Software Development Interpreters |
|---|---|
| Licenses | AFPL |
| Operating Systems | BeOS Mac OS X Mac OS X Windows Windows Windows OS Independent OS/2 POSIX |
| Implementation | C |
Recent releases


Changes: Improvements were made for overprint and spot color support in documents with transparency, as well as for PDF and PS output. Proper handling of PDF-specific text rendering modes was implemented. Support for reading AES-encrypted PDF documents was added. Handling of CJK text, especially in vertical writing modes, was improved. The memory footprint with certain files at high resolutions was reduced. Several long-standing bugs in the PCL drivers with respect to duplex, resolution, and paper tray selection were fixed. Many other bugs were fixed.


Changes: Support for multi-threaded rendering using "-dNumRenderingThreads=n" was implemented. Images are now always interpolated in their source colorspace. Support for OpenPrinting Vector devices was upgraded to version 1.0. Two new experimental devices, a cairo output device and the svgwrite device, were added. Several robustness and performance improvements were made for large files, invalid PDF, and font handling.


Changes: The tiffsep device was fixed for using more than 8 colorants. Shadings, overprinting, and transparency were optimized and are substantially faster. Changes were made to prevent nearly unbounded growth in memory usage and corresponding performance problems on a few test cases. The 'pdfwrite' device was improved to fix some compatibility issues with PDF/A and to improve some font embedding and other issues. The halftone tile cache sizes and cache effectiveness were improved to help the performance when tiling with large cells or threshold arrays. Many other issues were resolved.


Changes: Several bugs were fixed. The default device on Unix-oriented builds was changed again to the x11alpha device, which provides antialiasing for display.


Changes: This release finalizes the merge with ESP Ghostscript, adding support for CUPS raster printer drivers. It also contains IJS and OpenPrinting Vector interfaces for driver plug-ins, all built-in printer drivers listed in the OpenPrinting database, X display drivers in a separate shared library, and many other improvements and bugfixes. The build process is now autotools-based. Temporarily, the GCC build defaults to the 'bbox' device instead of the 'x11' device. The GPL is also now applicable to the newest Ghostscript version, removing any functional differences between AFPL and GPL Ghostscript.
- All comments
Recent commentsI found a way using GNU Make, pdfinfo (from the poppler package), egrep, sed and bc. The following Makefile will concatenate the files, inserting empty pages where needed so that each subdocument starts on a new paper:
pagecount = $(shell pdfinfo $(1)|egrep "^Pages: *[[:digit:]]+"|sed "s@^Pages: *\([[:digit:]]\+\)@\1@")
odd = $(shell echo $(pagecount)%2|bc|grep 1)
filled = $(1) $(if $(call odd,$(1)),emptypage.pdf)
whole.pdf: 1.pdf 2.pdf 3.pdf 4.pdf 5.pdf 6.pdf 7.pdf 8.pdf 9.pdf
gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=$@ -dBATCH $(foreach x,$^,$(call filled,$x)) || rm -f $@
The following command is useful for concatenating PDF-files:
gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=out.pdf -dBATCH a.pdf b.pdf
But I need to modify this so that each subdocument starts on a new paper. This means that if a subdocument has an odd number of pages, an empty page must be inserted after it. Has anyone succeeded with this?
This is wonderful!
I am so amazed that a group of individuals could get together and produce such a useful piece of work -- and then just give it away! Your Unix system is definitely not complete until it has the latest version of GhostScript.
Don't forget that if you use any recent version of RedHat, your copy of GhostScript is probably out of date.