When compressing a PDF, what data is permanently discarded, and what is preserved with mathematical perfection? In this technical guide, we delineate lossless structural compaction from lossy raster downsampling.
Lossless PDF Compression Mechanisms
Lossless compression guarantees that decompressed data is bit-for-bit identical to the source. In PDFs, this applies to:
- Text Content Streams: Compressed with FlateDecode (LZ77 + Huffman).
- Font Subsetting: Removing unused glyphs while keeping used vector Bézier curves identical.
- Object Compaction: Stripping redundant whitespace and unreferenced dictionaries.
Lossy PDF Compression Mechanisms
Lossy compression permanently discards high-frequency pixel variations to achieve 5x–10x greater size reduction:
- Bicubic Downsampling: Reducing image pixel grid from 300 DPI to 150 DPI.
- DCT Quantization: Increasing JPEG compression factor on embedded photos.
- Color Channel Reduction: Converting 24-bit RGB photos to 8-bit grayscale.
Frequently Asked Questions
Will lossless compression change my text layout or pagination?
Never. Lossless compression preserves exact glyph metrics, line coordinates, and page dimensions.