Introduction
A .pdf file is a Portable Document Format document: fixed pages of
text, vector graphics and images, with the fonts embedded, that look the same on
any screen or printer. It can also carry links, bookmarks, forms, annotations,
attachments, digital signatures and tags for accessibility. Adobe created the
format for Acrobat in 1993 and
published its specification from the start. PDF 1.7 became the international
standard ISO 32000-1 in 2008, and PDF 2.0, ISO 32000-2, followed in 2017, with a
second edition in 2020. The PDF Association has offered PDF 2.0 free of charge
since April 2023.
A PDF is a set of numbered objects, such as pages, fonts, images and the streams of drawing operators that make up each page, with an index that gives the position of every object. Each PDF version added features, and almost all of them changed nothing a reader of the version before relied on. Here a version that only adds stays in the same format, and a version that changes how existing structures are stored starts a new one. PDF 1.5 is the one that did: it let objects be packed into compressed object streams and replaced the plain-text index with a binary cross-reference stream. That gives two formats, PDF 1.0 to 1.4 and PDF 1.5 to 2.0, each with its own full reference.
A .pdf file dropped on any page opens in the explorer, which shows its
objects, its cross-reference table or streams, the page tree and the decoded
streams, with fonts, images and other embedded files opening in their own viewers.
It does not draw the pages.
Variations
| Format | Variation | About | Open |
|---|---|---|---|
.PDF | Portable Document Format, PDF 1.0 to 1.4 | Objects at their own offsets, indexed by a plain-text xref table; RC4 encryption. | Open |
.PDF | Portable Document Format, PDF 1.5 to 2.0 | Objects can be packed in object streams and indexed by xref streams; AES encryption. | Open |
Every PDF starts with %PDF- (25 50 44 46 2D) and a
version, such as %PDF-1.4 or %PDF-2.0, and ends with
startxref, the offset of its cross-reference section, and
%%EOF. What sits at that offset tells the two formats apart: the
keyword xref and a table of 20-byte lines, or an object whose
dictionary has /Type /XRef.
Portable Document Format, PDF 1.0 to 1.4
The PDF of Acrobat 1.0 to 5.0, from 1993 to 2001. Every object is written in the
file on its own, as text between obj and endobj, and the
cross-reference table at the end is plain text, one 20-byte line an object, giving
each object’s byte offset. These versions brought forms, Unicode text and Flate
compression (1.2), signatures, JavaScript and smooth shading (1.3), and
transparency and XMP metadata (1.4). Encryption is RC4, with keys of 40 bits and,
from 1.4, up to 128 bits.
The header says 1.0 to 1.4, every cross-reference section is an
xref table, and there are no object streams.
Portable Document Format, PDF 1.5 to 2.0
The PDF of Acrobat 6.0 and later, from 2003 to today, and of ISO 32000-1 and ISO 32000-2. Objects can be packed, many at a time, inside compressed object streams, and the cross-reference table can be replaced by a cross-reference stream, a compressed binary index whose entries can point into object streams. Hybrid files carry both, so that PDF 1.4 readers still see most of the document. Later versions added AES encryption (1.6), portable collections (1.7) and, with PDF 2.0, AES-256 as the standard and the deprecation of RC4, XFA forms and most of the information dictionary.
The header says 1.5 or later, or the file has a cross-reference stream, an
XRefStm entry or an object stream, whatever its header says.
Reference pages
Each format has its own reference: an overview and seventeen pages. The two are written separately, each true for the versions it covers, because the versions differ in how objects are stored and in which features exist.
| Subject | PDF 1.0 to 1.4 | PDF 1.5 to 2.0 |
|---|---|---|
| Overview | PDF 1.0 to 1.4 | PDF 1.5 to 2.0 |
| File structure | File structure | File structure |
| Objects and syntax | Objects and syntax | Objects and syntax |
| Streams and filters | Streams and filters | Streams and filters |
| Cross-reference and trailer | Cross-reference and trailer | Cross-reference and trailer |
| Document structure | Document structure | Document structure |
| Logical structure and tagging | Logical structure | Logical structure |
| Content stream operators | Content streams | Content streams |
| Graphics, colour and transparency | Graphics | Graphics |
| Fonts and CMaps | Fonts | Fonts |
| Character encodings | Character encodings | Character encodings |
| Images | Images | Images |
| Actions, forms, signatures, files, media | Interactive features | Interactive features |
| Annotations, type by type | Annotation types | Annotation types |
| Metadata | Metadata | Metadata |
| Encryption | Encryption | Encryption |
| Linearization | Linearization | Linearization |
| Versions | Versions | Versions |
Versions
Each PDF version went with a release of Acrobat until PDF 1.7. Adobe then gave the format to ISO and added to 1.7 through extension levels, until ISO published PDF 2.0.
| Released | With | Main additions | Written as | |
|---|---|---|---|---|
| 1.0 | 1993 | Acrobat 1.0 | Pages, Type 1 and Type 3 fonts, images, links, bookmarks, thumbnails | pdf10 |
| 1.1 | 1994 | Acrobat 2.0 | RC4 encryption and passwords, binary files, device-independent colour, TrueType fonts, threads, actions | pdf10 |
| 1.2 | 1996 | Acrobat 3.0 | Forms, Flate, Unicode text, Type 0 and CID fonts, patterns, Separation colour, marked content, linearization | pdf10 |
| 1.3 | 2000 | Acrobat 4.0 | Digital signatures, JavaScript, embedded files, smooth shading, ICC and DeviceN colour, logical structure | pdf10 |
| 1.4 | 2001 | Acrobat 5.0 | Transparency, JBIG2, 128-bit RC4, XMP metadata, Tagged PDF | pdf10 |
| 1.5 | 2003 | Acrobat 6.0 | Object streams, cross-reference streams, JPEG 2000, crypt filters, optional content (layers) | pdf15 |
| 1.6 | 2004 | Acrobat 7.0 | AES-128 encryption, OpenType fonts, 3D annotations, NChannel colour | pdf15 |
| 1.7 | 2006; ISO 32000-1, July 2008 | Acrobat 8.0 | Portable collections, redaction annotations, more print settings | pdf15 |
| 1.7, extension level 3 | 2008 | Acrobat 9 | AES-256 encryption (revision 5), rich media, geospatial and projection features | pdf15 |
| 1.7, extension level 8 | 2011 | Acrobat X | The revised AES-256 password hashing of revision 6, and XFA 3.3 | pdf15 |
| 2.0 | ISO 32000-2, July 2017; second edition December 2020 | ISO | UTF-8 text strings, page-level output intents, associated files, new signatures and the document security store; RC4, XFA and most of the Info dictionary deprecated | pdf15 |
Each variant’s Versions page lists what every version added: PDF 1.0 to 1.4 and PDF 1.5 to 2.0. Adobe’s extension levels 1, 5 and 6 added newer XFA forms only. Since PDF 2.0, ISO has published extensions as technical specifications, ISO/TS 32001 to 32005, for newer hash algorithms, elliptic-curve signatures, AES-GCM encryption, integrity protection and structure namespaces.
Standards built on PDF
Several ISO standards restrict PDF for one purpose, so that files can be checked against them. Each is a profile of one of the formats above, not a format of its own: a PDF/A file is an ordinary PDF that follows extra rules and says so in its XMP metadata.
- PDF/A (ISO 19005) – archiving: everything needed to show the document is in the file, with no encryption; PDF/A-1 is based on PDF 1.4, PDF/A-2 and PDF/A-3 on PDF 1.7, PDF/A-4 on PDF 2.0
- PDF/X (ISO 15929 and ISO 15930) – print exchange, with fonts embedded and colours defined for printing
- PDF/UA (ISO 14289) – universal accessibility, built on Tagged PDF; PDF/UA-1 on PDF 1.7, PDF/UA-2 on PDF 2.0
- PDF/E (ISO 24517) – engineering documents, including 3D
- PDF/VT (ISO 16612-2) – variable and transactional printing, such as bills and statements
Not described
Known, not yet covered
- Viewer: glyphs of Chinese, Japanese and Korean fonts that are not embedded. The viewer now reads Adobe’s own file for every predefined CMap (cmap-resources, BSD 3-Clause, 202 files), so each code has its CID and its Unicode text, but a font with no glyph program has nothing to draw: its text is drawn in the browser’s font, not in the shapes of the font the file names. The viewer has no font files of its own to put in their place.
- Viewer: embedded ICC profiles are not applied when drawing pages.
Links
Software
- Adobe Acrobat Reader – Adobe’s free PDF viewer, with forms and comments (Windows, macOS, mobile)
- PDF.js – the viewer built into Firefox (web browsers)
- SumatraPDF – small, fast free viewer (Windows)
- Okular – KDE’s document viewer (Linux, Windows)
- LibreOffice Draw – free drawing program that can edit PDF pages (Windows, macOS, Linux)
- Ghostscript – interpreter that renders, converts and compresses PDF (Windows, macOS, Linux)
- qpdf – command-line tool that splits, merges, decrypts and repairs PDF (Windows, macOS, Linux)
Developers
- PDF.js – library that parses and renders PDF (JavaScript)
- pypdf – library that reads, splits, merges and writes PDF (Python)
- Apache PDFBox – library for reading and creating PDF (Java)
- qpdf – library for inspecting and rewriting PDF structure (C++)
- MuPDF – library and viewer for rendering PDF (C)
Reference
- ISO 32000 (PDF) – the PDF Association’s page on the standard, with free access to PDF 2.0
- ISO 32000-1:2008 – PDF 1.7 as an ISO standard, in Adobe’s copy (PDF)
- PDF Reference, sixth edition – Adobe’s last edition of its own reference, PDF 1.7 (PDF)
- Arlington PDF Model – the PDF Association’s machine-readable model of every PDF object, with the version each key was added and deprecated in
- History of PDF – Wikipedia’s account of the versions and the standards built on PDF