Department of Engineering

IT Services

What is Encapsulated PostScript?

From the Postscript FAQ -

Encapsulated PostScript (EPS) is a standard format for importing and exporting PostScript language files in all environments. It is usually a single page PostScript language program that describes an illustration. The purpose of the EPS file is to be included as an illustration in other PostScript language page descriptions. The EPS file can contain any combination of text, graphics, and images. An EPS file is the same as any other PostScript language page description, with some restrictions.

EPS files can optionally contain a bitmapped image preview, so that systems that can't render PostScript directly can at least display a crude representation of what the graphic will look like. There are three preview formats: Mac (PICT), IBM (tiff), and a platform independent preview called EPSI.

The recommended form for a preview image is "Interchange" format and is described fully in the "red book", second edition. Interchange format represents the image as a series of hex strings placed in the EPS file as PostScript comments. The entire file remains an ASCII file.

An EPS file must be a conforming file, that is, it must conform to the Adobe Document Structuring Conventions (DSC). At a minimum, it must include a header comment,%!PS-Adobe-3.0 EPSF-3.0, and a bounding box comment,%%BoundingBox: llx lly urx ury, that describes the bounds of the illustration. (The specification does not require the EPSF version, but many programs will reject a file that does not have it.)

The EPS file must not use operators that initialize or permanently change the state of the machine in a manner that cannot be undone by the enclosing application's use of save and restore (eg. the operators starting with "init" like initgraphics). As a special case, the EPS program may use the showpage operator. The importing application is responsible for disabling the normal effects of showpage.

The EPS file should make no environment-sensitive decisions (the importing application may be trying to attain some special effect, and the EPS program shouldn't mess this up), although it can use some device-dependent tricks to improve appearance such as a snap-to-pixel algorithm.

The complete EPS specification is available from Adobe. Read Appendix G (Document Structuring Conventions, V3.0) and Appendix H (Encapsulated PostScript File Format, V3.0) in the new PostScript red book: PostScript Language Reference Manual, Second Edition.

A variation of EPS embeds the preview image and PostScript text in a binary file which contains a header and the preview image in either a TIFF or MetaFile format. The header defines where in the file each section (EPS, TIFF, or MetaFile) starts and ends.

Note - to convert a ps file to eps, local linux users can try ps2epsi.