Table of contents
Download Ghostview plugins for Mac to collection of Ghostscript plugins.
For other information, see the Ghostscriptoverview.
Ghostview Ghostview is an X11 user interface for Ghostscript, allowing you to view and navigate PostScript files. There are several derivatives of Ghostview that are now in common use. GV is a version of Ghostview with an improved user interface and the ability to display PDF files. Unable to activate port ghostview. Warning: the following items did not execute (for ghostview): org.macports.activate Error: Status 1 encountered during processing. I would be grateful to anyone who could suggest what to do next Regards, Alan Fry.
Overview
ps2pdf is a work-alike for nearly all the functionality (butnot the user interface) of Adobe's AcrobatTMDistillerTM product: it converts PostScript filesto Portable Document Format (PDF) files.ps2pdf is implemented as a very small command script (batchfile) that invokes Ghostscript, selecting a special 'output device' calledpdfwrite. In order to use ps2pdf, thepdfwrite device must be included in the makefile whenGhostscript was compiled; see the documentation on buildingGhostscript for details: this is currently the case on all platforms, inGhostscript as we distribute it.
Usage
The usage for ps2pdf is
ps2pdf[options] input.[e]ps output.pdf
or, on Unix systems and some versions of Windows NT and OS/2
ps2pdfinput.[e]ps
which is equivalent to
ps2pdfinput.[e]ps input.pdf
There are actually several different ps2pdf* scripts:the name ps2pdf above refers to any of them.
- ps2pdf12 will always produce PDF 1.2 output (Acrobat3-and-later compatible).
- ps2pdf13 will always produce PDF 1.3 output (Acrobat4-and-later compatible).
- ps2pdf14 will always produce PDF 1.4 output (Acrobat5-and-later compatible).
- ps2pdf per se currently produces PDF 1.2 output (Acrobat3-and-later compatible). However, this may change in the future. If youcare about the compatibility level of the output, useps2pdf12, ps2pdf13, orps2pdf14, or use the-dCompatibilityLevel=1.x switch in the commandline.
All of these scripts actually call a script named ps2pdfwror ps2pdfxx. The Unix ps2pdfwr scriptassumes that the Ghostscript executable is named gs; it isunlikely that you will need to change this. The DOS and MS Windowsps2pdfxx.bat script uses the value of theGSC environment variable, if defined, as the name of theexecutable; otherwise the script assumes the executable is namedgswin32c. So in these environments, if the executable has adifferent name, you must set GSC to the name of theexecutable.
Options
The options in the command line may include any switches that maybe used with Ghostscript's PostScript and PDF interpreter (see here for a complete list), although almost noneof them are useful with ps2pdf. The following may beuseful:
- -rresolution
- Sets the resolution for pattern fills and for fonts that must beconverted to bitmaps.
- -dProcessColorModel=device_color_space
- Setsthe color space to be used for device-dependent colors in theoutput. device_color_space may be /DeviceGray,/DeviceRGB, or /DeviceCMYK; the defaultvalue is /DeviceRGB.
More importantly, options may include-dparameter=value or-sparameter=string switches for setting'distiller parameters', Adobe's documented parameters for controlling theconversion process. The PostScript setdistillerparams andcurrentdistillerparams operators are also recognized whenrunning ps2pdf, and provide an equivalent way to set theseparameters from within the PostScript input file.
ps2pdf also recognizes the following switches:
- /screen selects low-resolution output similar to theAcrobat Distiller 'Screen Optimized' setting.
- /printer selects output similar to the Acrobat Distiller'Print Optimized' setting.
- /prepress selects output similar to Acrobat Distiller'Prepress Optimized' setting.
- /default selects output intended to be useful across awide variety of uses, possibly at the expense of a larger output file.
ps2pdf recognizes all of the Acrobat Distiller 4 parametersdocumented inAdobe Technical Note #5151. Cells in the table containing '=' mean thatthe value of the parameter is the same as in the 'default' column.
Parameter name | Notes | default | screen | printer | prepress |
---|---|---|---|---|---|
ASCII85EncodePages | false | = | = | = | |
AlwaysEmbed | [] | = | = | = | |
AntiAliasColorImages | (0) | false | = | = | = |
AntiAliasGrayImages | (0) | false | = | = | = |
AntiAliasMonoImages | (0) | false | = | = | = |
AutoFilterColorImages | (1) | true | = | = | = |
AutoFilterGrayImages | (1) | true | = | = | = |
AutoPositionEPSFiles | (0) | true | = | = | = |
AutoRotatePages | /PageByPage | /PageByPage | /None | /None | |
Binding | (0) | /Left | = | = | = |
CalCMYKProfile | (0) | () | = | = | = |
CalGrayProfile | (0) | () | = | = | = |
CalRGBProfile | (0) | () | = | = | = |
CannotEmbedFontPolicy | (0) | /Warning | /Warning | /Warning | /Error |
ColorACSImageDict | (note 7) | (note 7) | (note 8) | (note 9) | |
ColorConversionStrategy | (0,6) | /LeaveColorUnchanged | /sRGB | /UseDeviceIndependentColor | /LeaveColorUnchanged |
ColorImageDepth | -1 | = | = | = | |
ColorImageDict | (note 7) | = | = | = | |
ColorImageFilter | /DCTEncode | = | = | = | |
ColorImageDownsampleThreshold | 1.5 | = | = | = | |
ColorImageDownsampleType | (3) | /Subsample | /Average | /Bicubic | /Bicubic |
ColorImageResolution | 72 | 72 | 300 | 300 | |
CompatibilityLevel | 1.3 | 1.2 | 1.3 | 1.3 | |
CompressPages | true | = | = | = | |
ConvertCMYKImagesToRGB | true | = | = | = | |
ConvertImagesToIndexed | (0) | true | = | = | = |
CoreDistVersion | 4000 | = | = | = | |
CreateJobTicket | (0) | false | false | true | true |
DefaultRenderingIntent | /Default | = | = | = | |
DetectBlends | (0) | true | = | = | = |
DoThumbnails | (0) | false | false | false | true |
DownsampleColorImages | false | true | false | false | |
DownsampleGrayImages | false | true | false | false | |
DownsampleMonoImages | false | true | false | false | |
EmbedAllFonts | true | false | true | true | |
EmitDSCWarnings | (0) | false | = | = | = |
EncodeColorImages | true | = | = | = | |
EncodeGrayImages | true | = | = | = | |
EncodeMonoImages | true | = | = | = | |
EndPage | (0) | -1 | = | = | = |
GrayACSImageDict | (note 7) | (note 7) | (note 8) | = | |
GrayImageDepth | -1 | = | = | = | |
GrayImageDict | (note 7) | = | = | = | |
GrayImageDownsampleThreshold | 1.5 | = | = | = | |
GrayImageDownsampleType | (3) | /Subsample | /Average | /Bicubic | /Bicubic |
GrayImageFilter | /DCTEncode | = | = | = | |
GrayImageResolution | 72 | 72 | 300 | 300 | |
ImageMemory | (0) | 500000 | = | = | = |
LockDistillerParams | false | = | = | = | |
LZWEncodePages | (2) | false | = | = | = |
MaxSubsetPct | 100 | = | = | = | |
MonoImageDepth | -1 | = | = | = | |
MonoImageDict | < | = | = | = | |
MonoImageDownsampleThreshold | 1.5 | = | = | = | |
MonoImageDownsampleType | /Subsample | /Average | /Bicubic | /Bicubic | |
MonoImageFilter | /CCITTFaxEncode | = | = | = | |
MonoImageResolution | 300 | 300 | 1200 | 1200 | |
NeverEmbed | [] | = | = | = | |
OPM | 1 | = | = | = | |
Optimize | (0,5) | false | true | true | true |
ParseDSCComments | true | = | = | = | |
ParseDSCCommentsForDocInfo | true | false | true | true | |
PreserveCopyPage | (0) | true | = | = | = |
PreserveEPSInfo | (0) | true | = | = | = |
PreserveHalftoneInfo | false | = | = | = | |
PreserveOPIComments | (0) | false | false | true | true |
PreserveOverprintSettings | false | false | true | true | |
sRGBProfile | (0) | () | = | = | = |
StartPage | (0) | 1 | = | = | = |
SubsetFonts | true | = | = | = | |
TransferFunctionInfo | (4) | /Preserve | = | = | = |
UCRandBGInfo | /Remove | /Remove | /Preserve | /Preserve | |
UseFlateCompression | true | = | = | = | |
UsePrologue | (0) | false | = | = | = |
(note 0) This parameter can be set and queried, but currently has no effect.
(note 1) AutoFilterxxxImages doesn't examine the image todecide between JPEG and LZW or Flate compression: it uses JPEG compressionif the image has 8 bits per component and does not use an Indexed colorspace, and LZW or Flate compression otherwise.
(note 2) Because of Unisys's threats regarding the Welch patent,ps2pdf cannot actually use LZW compression: instead, ittreats all requests for LZW compression as calling for Flate compression ifUseFlateCompression is true andCompatibilityLevel >= 1.2, and ignores them otherwise.
(note 3) The xxxDownsampleType parameters can also have thevalue /Bicubic (a Distiller 4 feature), which is currently treated asequivalent to /Average.
(note 4) Currently, the transfer function is always applied. If thecorresponding parameter is set to /Preserve, the functionsetting is also copied into the PDF file.
(note 5) Optimization (linearization) is implemented with a separateprogram, pdfoptinput.pdfoutput.pdf; theOptimize parameter has no effect.
(note 6) Currently, colors for images and shadings are left in the colorspace specified in the PostScript input, except forConvertCMYKImagesToRGB; the current color in the graphicsstate (used for fill, stroke, text, and imagemask) is always converted tothe color space specified by the current value ofProcessColorModel. The intended behavior is the same as forAcrobat Distiller, except that if ColorConversionStrategy isset to /UseDeviceDependentColor, colors are converted to thecolor space specified by ProcessColorModel rather thanalways to /DeviceRGB.
(note 7) The default image parameter dictionary is
<< /QFactor 0.9 /Blend 1 /HSamples [2 1 1 2] /VSamples [2 1 1 2] >>
(note 8) The printer ACS image parameter dictionary is
<< /QFactor 0.55 /Blend 1 /HSamples [2 1 1 2] /VSamples [2 1 1 2] >>
(note 9) The prepress ACS image parameter dictionary is
<< /QFactor 0.25 /HSamples [1 1 1 1] /VSamples [1 1 1 1] >>
Limitations
ps2pdf will sometimes convert text to high-resolutionbitmapped fonts rather than to embedded outline fonts. This will occur whenthe PostScript file uses Type 3, CIDFontType 1, or CIDFontType 4 fonts, orType 0 fonts that reference any of these; it may also occur in some cases ifthe input file uses fonts with non-standard encodings, or in some other rarecases.
The PDF output always represents the colors of text and graphics inDeviceGray or DeviceRGB color space (or DeviceCMYK if theProcessColorModel parameter has been set to/DeviceCMYK); all other color spaces are converted to these.However, for images, it will retain the original color space for DeviceGray,DeviceRGB, DeviceCMYK, certain CIEBased spaces, and Indexed spaces based onthese.
ps2pdf will sometimes convert PostScript constructs tolower-level ones, even if a higher-level construct is available. Forexample, if the PostScript file uses charpath to set aclipping path consisting of text, ps2pdf will write theclipping path as a path in the PDF file, rather than as text, even thoughPDF is able to express clipping with text. This is only a performanceissue, and will be improved incrementally over time.
Some applications, such as HIGZ, produce PostScript files that useridiculously large coordinates. On such files, ps2pdf maycause a limitcheck error. If this occurs, try reducing thedefault internal resolution of 720 dpi by using the -rswitch, e.g., ps2pdf -r300 somefile.ps.
ps2pdf ignores the PDF 1.3 (Acrobat 4.x) pdfmarks related todocument content structure: StRoleMap,StClassMap, StPNE,StBookmarkRoot, StPush,StPop, StPopAll, StBMC,StBDC, EMC, StOBJ,StAttr, StStore, StRetrieve,NamespacePush, NamespacePop, andNI. While this causes some structural information to beomitted from the output file, the displayed and printed output are normallynot affected.
ps2pdf currently has only very limited support for PDF 1.4.It writes out the blend mode, constant alpha, and text knockout graphicsstate parameters, and it handles images with soft masks, but it does nothandle transparency groups, or soft masks in the graphics state. (Note thatthere is no standard way to specify any of these things in PostScript, sothese statements only apply when the input file is already a PDF 1.4 file.)
Known problems
Distiller parameters should only be saved by save andrestored by restore, but they are also saved bygsave and restored by grestore.
Changing the value of the CompressPages parameter after anymarks have been made on the page may cause a crash.
If the input file downloads Type 1 fonts incrementally, the output file maycontain embedded fonts with some information missing from theFontDescriptor, which may crash Acrobat Reader 4 or produce incorrectcharacter spacing.
Comparison of ps2pdf andAcrobat Distiller
According to users, the greatest benefit of ps2pdf is thatit is more robust than Acrobat Distiller: it will process complex anddifficult PostScript files that Acrobat Distiller is not able to handle.
For certain documents, ps2pdf is much faster than AdobeDistiller, and may be suitable for run-time conversions. George White,a heavy user of ps2pdf, remarks:
I haven't seen a head to head comparison, but Distiller seemsslower when running on what should be a faster system (for instance,Distiller on a PPC Mac vs a 25 MHz 68040 NeXT runningps2pdf), so I think this is fair -- also, one of MarkDoyle's postings indicated that Distiller was not fast enough for use as arun-time server. In contrast, I find that I can use ps2pdfas a post-processor during routine document creation.
On the other hand, there are some documents for which ps2pdfmay be much slower than Acrobat Distiller. Caveat user.
ps2pdf usually produces output that is comparable in size tothe output of Acrobat Distiller; however, it sometimes produces much largeroutput, especially if the input file involves pattern fills.
Many users report that the combination of ps2pdf withAcrobat Reader is superior to using a generic PostScript viewer(psview or ghostview), particularly fordocuments with many pages where the navigational support in PDF filesreduces the overhead involved in navigating conventional PostScriptdocuments.
Acknowledgments
Thanks to George N. White III <aa056@chebucto.ns.ca> of the OceanSciences Division of the Bedford Institute of Oceanography in Dartmouth,Nova Scotia for extensive testing of early versions ofps2pdf, and for contributing most of this writeup.
Thanks to Martin Hosken of SIL International <http://www.sil.org> for help with testingps2pdf with a wide variety of international fonts.
Copyright © 1996, 2000 Aladdin Enterprises. All rightsreserved.
This file is part of AFPL Ghostscript. See theAladdin Free Public License (the 'License') forfull details of the terms of using, copying, modifying, and redistributingAFPL Ghostscript.
Ghostview Mac Download
Ghostscript version 7.03, 20 October 2001