How it works
A PDF file has four main parts: a header (magic number and version, e.g. %PDF-1.7), a body of objects, a cross-reference table (xref), and a trailer. The content of each page is described by content streams — stack-based, similar to PostScript — that draw text, vector graphics, and images. The document is built from objects (nine basic types: booleans, real numbers, integers, strings, names, arrays, dictionaries, streams, and the null object), either direct or indirect. The xref table gives the byte offsets of objects, enabling random access and incremental updates; the trailer points to the document catalog (/Root). For AI, text and structure are typically recovered by extraction from content streams or — for scanned files — by OCR.
Problem solved
Documents displayed and printed across different computers, applications, and operating systems rendered inconsistently. PDF solves this by storing a fixed, self-contained layout (with embedded fonts and graphics) that reproduces identically everywhere.
Components
Start of the file: a magic number readable as a string plus the format version, e.g. %PDF-1.7.
The set of objects (nine basic types), direct or indirect; since PDF 1.5 non-stream objects can be stored in object streams.
Located near the end of the file; gives the byte offsets of indirect objects, enabling random access and incremental updates. Since PDF 1.5 also available as a binary cross-reference stream.
A dictionary referencing the document catalog (/Root), object count (/Size) and optional info; the footer holds the startxref offset and the %%EOF marker.
Stack-based streams describing the text, vector graphics, and images drawn on a page; the representation is similar to PostScript.
Implementation
PDF describes glyph positions on the page, not the logical text structure; naive extraction loses reading order in multi-column layouts.
A PDF may contain only a raster image of the page with no text layer; then text cannot be extracted without OCR.
Tables and columns have no explicit semantics in PDF, making faithful recovery of tabular data difficult.
Evolution
John Warnock proposes a simplified PostScript (“Interchange PostScript”) as a document interchange format.
Adobe introduces PDF; first release on 15 June 1993 together with the Acrobat software.
On 1 July 2008 Adobe releases PDF as an open standard; ISO publishes ISO 32000-1:2008 and Adobe issues a royalty-free patent license.
ISO publishes PDF 2.0 — the first edition of the ISO 32000-2 standard.
Second edition of PDF 2.0 (December 2020).
The PDF Association makes the ISO 32000-2 specification available for free download (April 2023).
Hardware requirements
PDF is a file format (data standard), not a compute workload — it is hardware-independent.