PostScript

.ps · Vector images

A PostScript file (.ps) is not a picture of a document but a program that draws it. Printers with a PostScript interpreter execute that program and produce the pages. Today you meet .ps files mostly in three places: when “Print to file” was ticked in a print dialog, in scientific and Unix workflows (LaTeX via dvips, gnuplot, older papers on preprint servers), and in print shops that still accept PostScript.

History

Adobe released PostScript in 1984. In March 1985 the Apple LaserWriter became the first printer with a built-in PostScript interpreter, and together with PageMaker it started desktop publishing. Language Level 2 followed in 1990 (better colour handling, compression filters) and PostScript 3 in 1997; the last reference manual dates from 1999. Adobe has said there will be no fourth version. New features such as transparency and layers went into PDF instead, which is derived from PostScript's imaging model.

How PostScript works

The file is plain text (sometimes with binary image data) in a stack-based programming language. A line like 100 200 moveto 300 200 lineto stroke draws a line. Because it is a real language with loops and procedures, a page can only be displayed by running the code; you cannot simply jump to page 50 without interpreting what comes before it. That is the main difference from PDF, where every page is a ready-made object.

Well-behaved files follow the Document Structuring Conventions (DSC): the first line starts with %!PS-Adobe-3.0, and comments such as %%Pages: and %%Page: mark the structure so that spoolers and viewers can count and reorder pages. Fonts are usually embedded as Type 1 or Type 42 (TrueType) fonts. A PostScript file can contain vector graphics, text and raster images, but no transparency, hyperlinks, forms or bookmarks in the PDF sense.

A special single-page variant meant for placing into other documents is EPS. Type 1 fonts (PFB, PFA) come from the same family. Adobe stopped supporting them in its applications after January 2023 (Adobe announcement); fonts already embedded in PS, EPS and PDF files still display.

How to open a PS file

The interpreter behind almost every free viewer is Ghostscript.

  • Windows: install Ghostscript and then SumatraPDF, which opens .ps files once Ghostscript is present. Windows itself has no PostScript viewer.
  • macOS: Preview opened PostScript up to macOS 12 Monterey. Since macOS 13 Ventura it no longer does, so you need a third-party app or a conversion to PDF.
  • Linux: Okular and Evince (Document Viewer) display PS directly; on the command line ps2pdf file.ps creates a PDF.
  • Phones: neither Android nor iOS has native support; converting to PDF is the practical route.

Editing PostScript is possible only in a text editor (for programmers) or by importing it into a vector editor such as Inkscape, which also goes through Ghostscript.

Common problems

“Print to file” created a .ps (or .prn) file

The output went through a PostScript printer driver. Convert the file to PDF and you have a normal document. If the driver was not PostScript (PCL, for example), the file is printer data that only that printer understands.

PS file won't open on Mac

See above: since Ventura, Preview refuses .ps. Convert it to PDF; the result opens in Preview again.

Wrong page size or cut-off margins

PostScript files often hard-code Letter or A4. When the target paper differs, the printer crops or scales. Converting to PDF keeps the page size that the file itself requests.

Garbled text after converting

Text extraction depends on how the fonts are encoded. Old dvips output with bitmap Type 3 fonts often gives no usable text at all, even though it prints fine.

Converting PostScript

On our servers the PostScript program runs in a restricted mode that blocks any file access from inside it:

  • PS to PDF: all pages, fonts embedded, text stays text. This is the most common and most useful conversion.
  • PS to PNG, SVG, EPS: the first page, via PDF (PNG at 150 dpi).
  • PS to JPG: first page at 150 dpi, quality 90, white background. PS to TIFF keeps all pages in one file.
  • PS to TXT: text extraction, with the font limitation described above.

If you then need the content as an image or Word file, the PDF pages PDF to JPG and PDF to DOCX explain what to expect.

Facts

DeveloperAdobe
First release1984 (first printer 1985)
Current versionPostScript 3 (1997), DSC 3.0
Typepage description and programming language, text file
Compressionnone for the file, optional filters for images (LZW, Flate, DCT)
Typical useprinting, print-to-file output, LaTeX and scientific graphics

More detail in the Library of Congress description of PostScript.

We can convert PS into

Documents

PDF DOCX DOC ODT TXT HTMLDOCMDOTDOTXFODTOTT RTFUOTPDF/AABWAWTFOZABW

Images

JPG PNGWEBP GIF TIFFHEICAVIFJXLPSDICOAAIAPNGARTAVS BMP CINCURDCXDDSDPXFF FITSFL32 HDRHRZJP2JBIGJNGJPCMNGMTVOTBPALMPAM PBMPCD PCXPFMPGMPGXPHMPICTPPMPSBPTIFQOIRASRGFSGISIXELSUN TGAVICARVIFFVIPS WBMPXBMXPMXWDDCM

Vector images

SVG EPSEMFFXGHPGLODGPOVSIFSVGZWMFXAMLFODGOTG

eBooks

EPUB MOBI AZW3 FB2CBZHTMLZ LIT LRF OEB PDB TCRTXTZCB7CBTDJVU

CAD

Markup languages

MDTEXRSTADOCWIKIORGDOCBOOKCONTEXTDOKUWIKIHADDOCKICMLIPYNBJATSJIRAMANMSMUSEOPMLTEITEXITEXTILETYPXWIKIZIM