object streams

Object streams are where a document's bookkeeping is packed away, so that it takes a fraction of the room it would take in plain view.

In more detail

A PDF is a pile of numbered parts. A few of them are the big ones everybody thinks of — a photograph, the lettering, the marks drawn on a page — and all the rest are short notes the document keeps about itself: which page follows which, where each drawing is filed, which corner of which page is clickable, what each colour is called.

Those notes are ordinarily written out in plain view, one after another, and left uncompressed where the big parts are compressed. Object streams gather them by the hundred into a single parcel and compress the parcel as one. Nothing about any page changes: the same document comes out, in less room.

What it does on a real document

The gallery weighs the same twenty-four page document both ways. Written plainly it comes to a little over fifty thousand bytes; packed, a little under forty-six thousand — eight parts in a hundred gone, with not one mark on any page different between the two.

The saving grows with the number of pages, because a page costs a handful of those notes and the notes are what packing squeezes. On a document of a few pages it is barely worth measuring; on a catalogue of two hundred, or on a run of ten thousand invoices kept for ten years, it is the difference between one bill for storage and another.

The one thing it costs is age. A parcel like this asks for software that knows the 2003 revision of the format, so it stays switched off until you ask for it, and a file meant for something older comes out exactly as it always did.

Where it comes from, and why

For the first ten years of the format every one of those notes lay in plain sight, so that a program could read a document's map without unfolding anything first. That was worth something on a machine of 1993 and worth nothing on a machine of today, where unfolding a parcel of notes costs less than reading them off a disc.

The parcel arrived in 2003, with the revision that also let a document's map be packed the same way. Both ways of writing a file are still read by everything that opens a PDF, which is why the choice is yours rather than the format's.

See it on a finished document

Making the file smaller The rules behind this word, and the texts they are read from

Back to the whole glossary