A PDF file is a small database of objects with an index at the end, a page tree that points into it, and content streams that draw each page. Once that model is clear, most of the format's behaviour follows from it: why edits append rather than rewrite, why a font can be present but not embedded, why "compressing" a PDF sometimes does nothing, and why an owner password protects less than it seems.
The pages below are written to be read in order the first time. Each one cites the clauses of ISO 32000-1 it relies on and ends with commands you can run on your own files.
- How PDF files work
The file anatomy, with a complete minimal document explained byte by byte and the steps a reader takes to load it.
- Objects and syntax
Tokens, the eight object types, direct and indirect objects, streams, and the operators that draw a page.
- Xref and incremental updates
The classic table, the PDF 1.5 cross-reference stream and object streams, and how appended revisions chain together.
- Page boxes
The five rectangles that define a page, their defaults, inheritance and rotation, and the commands that read and set them.
- Fonts and embedding
Simple and composite fonts, encodings and ToUnicode, embedding and subsetting, licensing flags, and how to check a file.
- PDF compression
Stream filters, image encodings and object streams, why a "compressed" PDF is still large, and what shrinking tools really do.
- PDF metadata
The Info dictionary and the XMP stream, the D: date format, precedence rules, what leaks, and how to read, write and remove metadata.
- PDF encryption
User and owner passwords, the security handler revisions from RC4-40 to AES-256, why permission flags are advisory, and how to encrypt and decrypt from the command line.
- PDF/A, PDF/X and PDF/UA
The ISO subset standards, part by part: what each forbids, which to choose for archiving, print or accessibility, and how to validate.