Understanding PDF Compression & Optimization
Technical breakdown of Flate stream compression, JPEG DCT downsampling, JBIG2 monochrome encoding, and font subsetting.
What Makes PDF Files Heavy?
PDF files are container formats. The primary culprits behind large PDF sizes are: 1) Uncompressed or high-DPI raster images, 2) Full embedded font sets rather than subsets, 3) Redundant metadata streams, and 4) Unreferenced ghost objects created during multiple edits.
When analyzing an oversized PDF, a compressor classifies objects into compressible text/vector streams, embeddable raster assets, font programs, and cross-reference indices.
Image Downsampling & Re-encoding
A 600 DPI photo scanned for printing contains 16 times more pixels than needed for screen reading. Downsampling to 150 DPI with balanced JPEG quality preserves crisp typography while reducing file size by 70% to 90%.
For black-and-white scanned documents, JBIG2 encoding outperforms legacy CCITT Group 4 compression by up to 500%, identifying repeating character glyphs across scanned pages and storing single bitmap instances in an internal dictionary.
Lossless vs Lossy Optimization Comparison
| Technique | Type | Typical Size Reduction | Visual Impact | Target Objects |
|---|---|---|---|---|
| Flate (Deflate) | Lossless | 40% - 70% | Zero change (100% bit-identical) | Text streams, vector drawing operators, XML metadata |
| Bicubic Downsampling | Lossy | 60% - 90% | Imperceptible on screen at 150 DPI | High-resolution photos and scanned raster bitmaps |
| Font Subsetting | Lossless | 75% - 98% | Zero change (preserves identical typography) | Embedded TrueType and OpenType font dictionaries |
| Object Stream Compaction | Lossless | 10% - 25% | Zero change | Cross-reference (xref) tables and metadata dictionaries |