Encapsulated PostScript is defined by Adobe’s Technical Note 5002, “Encapsulated PostScript File Format Specification”, version 3.0 (1 May 1992), which builds on the Document Structuring Conventions of Technical Note 5001 (DSC 3.0). Earlier versions 1.2 and 2.0 of the EPS specification differ mainly in the version numbers on the first line. An EPS file is a PostScript program; this page covers what makes it an EPS file rather than the PostScript language itself.
%!PS-Adobe-3.0 EPSF-3.0
%%Creator: Example 1.0
%%Title: logo.eps
%%CreationDate: 12 Nov 2026
%%BoundingBox: 0 0 144 72
%%HiResBoundingBox: 0 0 144 72
%%LanguageLevel: 2
%%Pages: 1
%%EndComments
%%BeginProlog
%%EndProlog
%%Page: 1 1
0 0 1 setrgbcolor 0 0 144 72 rectfill
%%Trailer
%%EOF
Header line
The first line names the DSC version and the EPS version:
%!PS-Adobe-3.0 EPSF-3.0. Files written to the older versions start
%!PS-Adobe-2.0 EPSF-1.2 or %!PS-Adobe-2.0 EPSF-2.0. The
EPSF part is what marks the file as encapsulated; a reader should
accept any version number.
Required and common comments
DSC comments are lines that begin with %%. They come in a header that
ends at %%EndComments (or at the first line that is not a comment).
| Comment | Status in EPS | Meaning |
|---|---|---|
%%BoundingBox: llx lly urx ury | required | The smallest rectangle enclosing everything the file draws, in integer PostScript points (1/72 inch) in the default user space: lower-left x and y, upper-right x and y. |
%%HiResBoundingBox: | common | The same box in real numbers. Added after version 3.0 by Adobe programs; readers use it when present. |
%%Creator: | recommended | Program that made the file. |
%%Title: | recommended | Title or file name. |
%%CreationDate: | recommended | Date, in free form. |
%%For: | optional | Person or organisation the file was made for. |
%%Pages: | optional | 0 or 1; an EPS file has at most one page. |
%%LanguageLevel: | when needed | 2 or 3 if the file uses PostScript Level 2 or 3 features. |
%%Extensions: | when needed | Language extensions used, such as CMYK or DPS. |
%%DocumentData: | when needed | Clean7Bit, Clean8Bit or Binary: what bytes the file contains. |
%%DocumentNeededResources:, %%DocumentSuppliedResources: | recommended | Fonts, files and other resources the file needs from outside, or includes itself. Older files use %%DocumentFonts:. |
%%DocumentProcessColors:, %%DocumentCustomColors: | for separations | The process and spot colours used. |
%%EndComments | common | End of the header comments. |
%%BeginProlog … %%EndProlog | common | Procedure definitions. |
%%BeginSetup … %%EndSetup | optional | Setup code. |
%%Page: label ordinal | optional | Start of the page. |
%%Trailer, %%EOF | common | Trailer, where comments marked (atend) in the header are given, and end of file. |
%%BeginDocument: name … %%EndDocument | for nesting | Written by a program that places an EPS file inside its own PostScript, around the included file, so the structure stays readable. |
%%BeginPreview: … %%EndPreview | EPSI only | The preview bitmap, below. |
Rules for the PostScript
- It describes one page and must leave the graphics state, dictionary stack and operand stack as it found them, since it runs inside another program’s page.
- It must not use operators that reset the device or the page: among them
banddevice,clear,cleardictstack,copypage,erasepage,exitserver,framedevice,grestoreall,initclip,initgraphics,initmatrix,quit,renderbands,setglobal,setpagedevice,setsharedandstartjob. - Operators such as
setmatrix,settransfer,setscreen,sethalftone,setgstateandnulldeviceare to be used only with care, relative to the state they inherit. showpagemay appear; the program that includes the EPS file is expected to disable it.
DOS binary header
An EPS file with a TIFF or Windows Metafile preview, as written by Windows and many cross-platform programs, starts with a 30-byte binary header. Numbers are little-endian. The PostScript, the WMF and the TIFF sections follow at the offsets it gives.
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 4 | bytes | Magic | C5 D0 D3 C6: the letters “EPSF” with the high bit set. |
| 4 | 4 | u32 | PSStart | Offset of the PostScript section. |
| 8 | 4 | u32 | PSLength | Length of the PostScript section. |
| 12 | 4 | u32 | WMFStart | Offset of the Windows Metafile preview, or 0. |
| 16 | 4 | u32 | WMFLength | Its length, or 0. |
| 20 | 4 | u32 | TIFFStart | Offset of the TIFF preview, or 0. |
| 24 | 4 | u32 | TIFFLength | Its length, or 0. |
| 28 | 2 | u16 | Checksum | Checksum of bytes 0 to 27, or FFFF to ignore it. Writers almost always use FFFF. |
00000000 C5 D0 D3 C6 1E 00 00 00 A0 31 00 00 00 00 00 00
00000010 00 00 00 00 BE 31 00 00 2A 4C 00 00 FF FF
The WMF and TIFF previews are ordinary WMF and TIFF files. Programs that cannot run PostScript show the preview and print the PostScript part.
EPSI preview
Encapsulated PostScript Interchange keeps the preview inside the PostScript as comments, so the file stays plain text and works on any system. The preview comes after the header comments:
%%BeginPreview: 80 24 1 24
% FFFFFFFFFFFFFFFFFFFF
% …
%%EndPreview
The four numbers are the width and height in pixels, the bits per pixel (1, 2, 4 or
8) and the number of comment lines that follow. Each line starts with %
and a space and holds hexadecimal image data, rows from top to bottom.
Macintosh preview
On the classic Mac OS, the PostScript is the data fork of a file of type
EPSF, and the preview is a QuickDraw PICT resource with ID 256
in the resource fork. Copied to other systems the resource fork is usually lost,
leaving an EPS file with no preview.