How PDF Compression Works: Object Streams, FlateDecode & Downsampling
Why do some 10 MB PDFs shrink to 1 MB instantly, while others barely budge? Discover what actually takes up space inside a PDF file and how different compression layers reduce byte count without sacrificing text readability.
What Makes a PDF Large in the First Place?
A PDF file is a composite binary container. When a document grows to 20 MB or 100 MB, the size is almost always distributed across four distinct components:
- Embedded Raster Images (Typically 80–90% of file size): High-resolution photos, scanned pages, or uncompressed TIFF logos embedded as
/XObjectstreams. - Embedded Font Files (5–15%): Complete TrueType or OpenType font tables embedded so the document renders identically on devices without those fonts installed.
- Structural Overhead & Metadata (2–5%): Revision histories, unreferenced dead objects from previous edits, XML metadata packets (XMP), and thumbnail caches.
- Vector Content Streams (<1%): Text character positioning commands, mathematical Bezier curves, and geometric lines. Vector text is remarkably compact.
The Two Types of PDF Compression
PDF compression is split into two fundamentally different categories:
| Compression Layer | Mechanism | Type | Impact on Quality |
|---|---|---|---|
| Structural Optimization (Object Streams) | Packs loose dictionary objects into compressed binary streams (/ObjStm), removes dead unreferenced objects, and updates Cross-Reference tables. |
100% Lossless | Zero visual impact. Text and images remain byte-for-byte identical. |
| Stream Deflation (FlateDecode) | Applies zlib/DEFLATE compression to raw text instructions and font bytecode streams. | 100% Lossless | Zero visual impact. Reduces raw text streams by up to 70%. |
| Raster Downsampling & Re-quantization | Reduces image resolution (e.g., from 300 DPI to 150 DPI) and applies lossy DCT (JPEG) quantization. | Lossy | Reduces photographic detail; can produce compression artifacts if overdone. |
How PDF 1.5 Object Streams Work
Introduced in PDF 1.5 (Acrobat 6.0), Object Streams revolutionized how PDF files are stored.
In older PDF 1.4 documents, every single object (such as a font descriptor, a page number, or a metadata dictionary) had to exist as an independent, uncompressed plain-text block surrounded by obj and endobj tokens, indexed by an ASCII cross-reference table (xref).
Object Streams allow thousands of these small individual dictionaries to be consolidated into a single contiguous binary stream compressed with FlateDecode. This removes massive amounts of repetitive ASCII syntax overhead and defragments the document catalog.
💡 Why Some PDFs Don't Compress Much
If your PDF was already exported from modern software (like InDesign or modern Acrobat) with object stream compression active and contains only pre-compressed JPEG images, running additional lossless structural compression will only shave off a few kilobytes. Conversely, documents exported from older ERP systems, scanners, or print drivers can see 30% to 60% size reductions instantly.
How FileWorks Compresses PDFs Locally
The FileWorks PDF Compress Tool applies advanced lossless structural optimization directly in your browser:
- It reads the PDF byte stream and analyzes the object graph.
- It eliminates orphaned objects that were detached during previous edits or deletions.
- It re-packs all eligible document objects into modern compressed Object Streams using
useObjectStreams: true. - It writes an optimized Cross-Reference Stream (
/XRef) to minimize file header overhead. - The output is immediately available for download—completely private, with zero server transmission.
Compress Your PDF Online
Optimize object streams and reduce PDF file sizes directly in your browser.