Introduction
PostScript is a programming language for describing pages, released by Adobe in 1984. A PostScript file is a program: a printer or a viewer runs it, and the program draws text, lines and images onto each page. It made desktop publishing possible and is still understood by many laser printers, though PDF, which grew out of it, has taken over most of its uses.
Encapsulated PostScript (EPS) is a restricted form for a single picture placed inside another document.
Structure
PostScript is stack based: values are pushed onto a stack, and operators such as
moveto, lineto and show take their arguments from
it. Most files follow Adobe’s Document Structuring Conventions, comments starting
with %% that let software find the pages without running the program.
The first line, %!PS-Adobe-3.0, declares this. Header comments such as
%%Pages and %%BoundingBox end at %%EndComments, a
prolog defines procedures, each page starts with %%Page:, and the file
ends with %%EOF.
%!PS-Adobe-3.0
%%Pages: 1
%%BoundingBox: 0 0 595 842
%%EndComments
%%Page: 1 1
/Helvetica findfont 24 scalefont setfont
72 750 moveto
(Hello, page one) show
showpage
%%EOF
Links
Software
- Ghostscript (Windows, macOS, Linux)
- Okular (Linux, Windows)
- Inkscape (Windows, macOS, Linux), by import through Ghostscript
Developers
- Ghostscript, C interpreter that can be built into other programs as a library
Reference
- PostScript Language Reference, third edition, Adobe, 1999
- PostScript Language Document Structuring Conventions Specification, version 3.0, Adobe