LinuxCommandLibrary

ps2epsi

Convert PostScript files to EPSI format

SYNOPSIS

ps2epsi [options] input.ps [output.epsi]

PARAMETERS

input.ps
    The path to the input PostScript file that needs to be converted to EPSI format.

output.epsi
    The optional path for the output EPSI file. If this argument is omitted, the converted EPSI content is written to standard output (stdout).

-dfeature
    Directly passes a -d option to the underlying Ghostscript command. This controls various features or settings, such as -dSAFER for security or -dEPSCrop to automatically crop the output to the bounding box.

-sparam=value
    Directly passes a -s option to the underlying Ghostscript command. This is used for setting string parameters, for example, -sPAPERSIZE=a4 to define the paper size or -sDEVICE=epswrite to specify the output device.

-rresolution
    Sets the resolution (in dots per inch, DPI) for the embedded bitmap preview. Common values include 72, 150, or 300 DPI, affecting the preview's clarity.

-gwidthxheight
    Specifies the dimensions (in pixels) for the embedded bitmap preview. For instance, -g512x512 would create a 512x512 pixel preview.

DESCRIPTION

ps2epsi is a utility designed to transform a standard PostScript file into an Encapsulated PostScript (EPS) file, specifically in the EPSI format. The distinguishing feature of EPSI is the inclusion of a low-resolution bitmap preview (typically TIFF or PICT) directly within the PostScript file. This embedded preview enables applications, especially older desktop publishing software, to display a visual representation of the graphic without needing to fully render the complex PostScript code. This significantly improves performance and workflow when placing graphics. Internally, ps2epsi commonly acts as a wrapper script, leveraging the powerful Ghostscript (gs) interpreter to perform the conversion and generate the preview.

CAVEATS

ps2epsi is frequently a simple shell wrapper around the gs (Ghostscript) command. Consequently, its exact behavior and available features can vary significantly depending on the specific Ghostscript version and how the script is implemented on a given system.

The embedded bitmap preview is typically low-resolution and primarily intended for screen display or layout purposes, not for high-quality printing. Complex or interactive PostScript constructs might not be perfectly encapsulated or result in an accurate preview. Issues with bounding boxes can arise if the input PostScript lacks a proper %%BoundingBox comment or if graphics extend beyond the defined page size, potentially leading to clipping or misrepresentation of content.

While still useful for compatibility, the EPSI format is less critical in modern workflows, as many contemporary applications prefer 'pure' EPS or PDF/X formats, which offer more robust preview solutions (e.g., embedded JPEG) or direct rendering capabilities.

PREVIEW FORMAT

The embedded bitmap preview generated by ps2epsi typically adheres to either the TIFF or PICT image formats. TIFF is more commonly used in Unix-like environments and Windows, whereas PICT was historically prevalent on Apple Macintosh systems. The specific format used can sometimes be influenced by the Ghostscript configuration or the version of the ps2epsi script.

BOUNDING BOX (<B>%%BOUNDINGBOX</B>)

For ps2epsi to function optimally and produce accurate results, it is highly recommended that the input PostScript file includes a valid %%BoundingBox comment. This comment defines the precise extent of the graphics within the PostScript file. If this comment is missing, incorrect, or if the graphic extends outside of it, ps2epsi might default to using the page size as the bounding box, which could lead to undesired clipping of the artwork or an inaccurate representation.

HISTORY

ps2epsi has been a long-standing utility, traditionally distributed as part of the Ghostscript package. Its origins date back to the early days of desktop publishing and graphic arts, where there was a significant need for a lightweight method to display PostScript content without requiring a full rendering engine. The EPSI format, with its embedded TIFF or PICT previews, gained prominence as an efficient solution for placing graphics in page layout applications. Although its direct usage has somewhat declined with the advent of PDF and more sophisticated EPS parsing capabilities in modern software, it remains a valuable tool for maintaining compatibility with legacy systems and workflows.

SEE ALSO

gs(1), epstool(1), ps2pdf(1), convert(1) (ImageMagick), pdf2ps(1)

Copied to clipboard