ps2pdf
Convert PostScript files to PDF
SYNOPSIS
ps2pdf [options] input.ps [output.pdf]
PARAMETERS
input.ps
The path to the input PostScript file to be converted.
output.pdf
The desired path for the output PDF file. If omitted, a default filename based on the input is often used, or output goes to standard output depending on environment.
-dCompatibilityLevel=X.Y
Sets the PDF compatibility level for the output file (e.g., -dCompatibilityLevel=1.4 for PDF 1.4). This impacts which PDF features can be used.
-dPDFSETTINGS=/value
Controls the output quality and size. Common values include /screen (low quality, small size), /ebook (medium quality), /printer (high quality), /prepress (highest quality, largest size), and /default (general purpose).
-sPAPERSIZE=name
Specifies the output paper size (e.g., a4, letter, legal). The PostScript file's media size might be overridden.
-rDPI
Sets the resolution for rasterization (downsampling of images) in dots per inch (e.g., -r300 for 300 DPI). Lower values reduce file size but also image quality.
-dQUIET
Suppresses informational messages during conversion, showing only errors or warnings.
-dEmbedAllFonts=true/false
Controls whether all fonts used in the PostScript file are embedded in the PDF. Setting to true ensures portability but increases file size.
-dSubsetFonts=true/false
Controls whether embedded fonts are subsetted to include only characters used. Setting to true helps reduce file size without losing font appearance.
DESCRIPTION
ps2pdf is a powerful utility designed to convert files from the PostScript (PS) format to the Portable Document Format (PDF).
It acts as a convenient wrapper script around the more general purpose Ghostscript (gs) interpreter, specifically configuring it to output PDF.
This command is indispensable for document processing workflows, allowing users to transform high-quality PostScript documents, often generated by applications like LaTeX or DTP software, into widely viewable and portable PDF files.
It handles various aspects of the conversion, including font embedding, image compression, and optimization, depending on the options provided.
By default, ps2pdf aims to produce a high-quality PDF that is reasonably sized, but it offers extensive customization through options passed directly to Ghostscript to fine-tune the output for specific uses, such as screen viewing, printing, or prepress production.
CAVEATS
Since ps2pdf is a wrapper for Ghostscript, its capabilities and limitations are inherited from Ghostscript itself.
Complex or malformed PostScript files may not convert perfectly, or may produce unexpected results.
Resource usage (memory and CPU) can be significant for very large or intricate PostScript documents.
While ps2pdf often invokes Ghostscript with security-enhancing options like -dSAFER, exercising caution with untrusted PostScript sources is always advisable.
<B>PDFSETTINGS OPTIONS</B>
The -dPDFSETTINGS=/value option is critical for controlling the balance between file size and quality:
/screen: Low quality, small size. Suitable for on-screen viewing.
/ebook: Medium quality, medium size. Suitable for e-readers or web distribution.
/printer: High quality, larger size. Suitable for desktop printers.
/prepress: Highest quality, largest size. Suitable for high-end print production with no downsampling or compression.
/default: General purpose setting, balances quality and size.
<B>PDF COMPATIBILITY LEVELS (PS2PDF1X)</B>
Ghostscript and ps2pdf can generate PDFs conforming to different PDF versions. Special wrapper scripts often exist:
ps2pdf12 (or ps2pdf1.2): Generates PDF 1.2 compatible files.
ps2pdf13 (or ps2pdf1.3): Generates PDF 1.3 compatible files.
ps2pdf14 (or ps2pdf1.4): Generates PDF 1.4 compatible files.
These scripts are essentially shortcuts for invoking ps2pdf with the appropriate -dCompatibilityLevel option set.
HISTORY
ps2pdf emerged as a part of the Ghostscript distribution, a project initiated by L. Peter Deutsch and later maintained by Artifex Software.
Ghostscript itself began development in the late 1980s, providing an open-source interpreter for PostScript and PDF.
As PDF gained prominence, ps2pdf was created as a convenient command-line tool to simplify the common task of converting PostScript to PDF, abstracting away the complex Ghostscript parameters.
Its evolution has closely mirrored the development of new PDF versions, leading to specialized scripts like ps2pdf12, ps2pdf13, and ps2pdf14 (or their 1.X counterparts) that target specific PDF compatibility levels.
SEE ALSO
gs(1), pstops(1), pdfinfo(1), pdftops(1), pdfseparate(1), pdfunite(1)