ps2pdfwr
Convert PostScript files to PDF
SYNOPSIS
ps2pdfwr [options] <input.ps> [output.pdf]
Note: Most options are passed directly to the underlying gs command.
PARAMETERS
input.ps
(Required) The path to the PostScript file to be converted.
output.pdf
(Optional) The desired name for the output PDF file. If not specified, it defaults to the input filename with a ".pdf" extension.
-dCompatibilityLevel=<version>
Sets the PDF compatibility level (e.g., 1.4, 1.5).
-dPDFSETTINGS=/screen
(Implicit Default) This setting is internally applied by ps2pdfwr to optimize for screen viewing, resulting in smaller files. Users can override this by passing other -dPDFSETTINGS values directly to ps2pdfwr, which will then be passed to gs. Other common values include /ebook, /printer, /prepress, /default.
-dDownsampleColorImages=<bool>
Enables or disables downsampling of color images (e.g., true or false).
-dColorImageResolution=<dpi>
Sets the target resolution for downsampled color images (e.g., 72, 150).
-sPAPERSIZE=<size>
Sets the paper size for the output PDF (e.g., a4, letter). This might affect layout if the PostScript is not resolution-independent.
-dNOPAUSE
Disables pausing after each page, useful for scripting.
-dBATCH
Processes the input file and exits, preventing interactive prompts.
-q
Suppresses startup messages and reduces output verbosity.
DESCRIPTION
ps2pdfwr is a specialized shell script that utilizes the powerful Ghostscript (gs) interpreter to convert PostScript (PS) files into PDF documents. The "wr" in its name stands for "writer" or "web," indicating that its default settings are optimized for producing smaller file sizes, suitable for screen viewing, web distribution, or email attachments. This is typically achieved by applying aggressive compression, downsampling images, and subsetting fonts.
While it offers a convenient way to generate compact PDFs, users should be aware that the resulting document might have a lower visual quality compared to PDFs generated with higher-quality settings, such as those produced by ps2pdf without specific "screen" settings.
CAVEATS
Quality vs. Size: ps2pdfwr prioritizes small file size, which often means lower image resolution and potential compromises in visual fidelity compared to print-optimized settings.
PostScript Features: Not all complex PostScript features or transparency effects may be perfectly translated to PDF, especially with aggressive compression settings.
Dependencies: Requires Ghostscript (gs) to be installed and accessible in the system's PATH.
DEFAULT INTERNAL SETTINGS
ps2pdfwr internally configures Ghostscript with settings equivalent to -dPDFSETTINGS=/screen. This includes aggressive image downsampling (e.g., typically to 72 dpi for color/grayscale images), embedding only necessary font subsets, and applying high compression. These defaults are designed to ensure the output PDF is as small as possible while remaining readable on a screen.
USE CASES
This command is ideal for converting large PostScript documents into compact PDFs for email attachments, web publishing, online document previews, or any scenario where bandwidth or storage is a concern, and absolute print fidelity is not the primary requirement.
HISTORY
The ps2pdf family of scripts, including ps2pdfwr, ps2pdf12, ps2pdf13, and ps2pdf14, are long-standing components of the Ghostscript distribution. They were developed to simplify common PostScript-to-PDF conversion tasks by wrapping the complex gs command with predefined settings. ps2pdfwr specifically emerged to address the need for web-friendly, smaller PDF files, making it a convenient tool for document sharing where file size is critical.