pdf2ps
Convert PDF files to PostScript
SYNOPSIS
pdf2ps [gs_options] input.pdf output.ps
Note: All `gs_options` are passed directly to the underlying `gs` (Ghostscript) command.
PARAMETERS
-r
Sets the output resolution for the PostScript file in DPI (dots per inch). For example, -r300 sets the resolution to 300 DPI.
-dCompatibilityLevel=
Specifies the PostScript language level for the output file. Common values are 1.0, 2.0, or 3.0. Higher levels support more advanced PostScript features.
-dProcessColorModel=
Defines the color model for processing. Examples include /DeviceRGB, /DeviceCMYK, or /DeviceGray.
-dNOCACHE
Prevents Ghostscript from caching objects, which can sometimes resolve issues with complex documents but may increase processing time.
-dFIXEDMEDIA
Ensures that the output media size is fixed to the document's original size, preventing scaling or resizing by the printer or viewer.
input.pdf
The path to the input PDF file to be converted.
output.ps
The path where the converted PostScript file will be saved.
DESCRIPTION
pdf2ps is a command-line utility that converts a Portable Document Format (PDF) file into a PostScript (PS) file. It acts as a convenient wrapper script around the powerful gs (Ghostscript) interpreter. When pdf2ps is invoked, it essentially calls gs with specific arguments tailored for PDF to PS conversion, typically using the ps2write device or similar PostScript output devices.
This tool is valuable for tasks requiring PostScript input, such as printing to older PostScript printers, embedding documents into larger PostScript workflows, or manipulating document content using PostScript-specific tools. Users can pass various Ghostscript options through pdf2ps to control aspects like resolution, color model, and PostScript compatibility level of the output.
CAVEATS
- pdf2ps relies entirely on Ghostscript. Its capabilities and limitations are those of the gs command.
- Complex PDF features (e.g., transparency, certain PDF/X features, interactive elements) may not convert perfectly to PostScript, especially older PostScript levels.
- Fonts might be substituted or converted to outlines if they are not embedded or available on the system.
- The resulting PostScript file can sometimes be very large, especially for high-resolution output or documents with many images.
UNDERLYING MECHANISM
pdf2ps is typically a shell script that constructs and executes a gs (Ghostscript) command. It sets default parameters like the output device (e.g., ps2write or pswrite) and then passes any user-specified options directly to gs. This means that for advanced control, understanding gs options is beneficial.
HISTORY
pdf2ps has been a standard utility provided as part of the Ghostscript distribution for many years. It serves as a convenient script to expose the PDF to PostScript conversion capabilities of gs in a user-friendly manner, abstracting away some of the direct Ghostscript command-line complexities for this specific task.