What is an object stream?
An Object Stream An object stream, introduced in PDF 1.5, is a compact way to store multiple indirect objects in a single PDF stream object, often using compression filters (ISO 32000-2).
Unlike standard objects, it omits the obj and endobj keywords. Commonly used with cross-reference streams, object streams reduce file size and improve efficiency in PDF documents, supporting features like logical structure or metadata storage.
What an object stream saves
Most objects in a PDF are small: a dictionary describing a page, a font reference, an annotation. Written out individually they create overhead for each object and cannot be compressed as a group. An object stream collects many of those small COS objects into one stream and compresses them together. Because similar structures compress well next to each other, the savings on a document with many pages or annotations are substantial.
The cross-reference stream that comes with it
Objects stored this way cannot be found by the classic cross-reference table, which records byte offsets in the file itself. Files that use object streams therefore also use a cross-reference stream, which is itself compressed and records where each object is stored, including which object stream contains it.
Both were introduced together in PDF 1.5. In practice, this means that such a file is no longer readable with a plain text editor, and that an older viewer written for PDF 1.4 cannot open it at all.