After testing qpdf 12.4.0’s four structural switches one by one, the conclusion is clear: object streams provide the most reliable standalone optimization, but apart from extremely repetitive samples, ordinary PDFs rarely shrink significantly through structural rewriting.
The text-only sample X1 fell from 137,782 bytes to 132,065 bytes. Enabling object streams alone, which groups and compresses non-stream objects such as pages and fonts, saved 4.15%; adding nine-level Flate recompression brought the savings to about 4.97%. The scanned-document sample T2 shrank by only 0.02%, while the mixed text-and-image report X2 saved just 0.33%.
What this is
This test compares four qpdf switches: object streams, nine-level Flate recompression, removal of unreferenced resources, and decode levels. Each switch was run independently on five files, with combined configurations then benchmarked against PyMuPDF.
Object streams work best for text-heavy PDFs containing many “small objects,” such as fonts and page dictionaries. Merging duplicate resources can deliver larger gains. In the constructed sample D1, five identical copies of an image and a font were stored separately; PyMuPDF’s garbage=4 option, which merges duplicate stream objects, reduced the file from 756,741 bytes to 152,455 bytes, a decrease of 79.85%. But this was a deliberately engineered extreme case and should not be treated as a typical daily-use result.
Removing unreferenced resources is also less universally effective than the marketing may suggest. When enabled on its own, it left nearly all five files unchanged; it removed an unused font and image from another constructed sample only when combined with page operations such as --pages.
Industry view
We believe these results draw a clear boundary around “file optimization”: first determine a file’s content composition, then select a compression strategy. For enterprise archiving, contract delivery, and knowledge-base uploads, font subsetting, resource deduplication, and object-stream cleanup are generally more controllable than simply enabling “maximum compression.”
The risks are equally clear. The test covered only five samples, some operations were run only once, and PyMuPDF’s advantage came from an artificially constructed, highly repetitive file that cannot be generalized into a universal result. Flate recompression can also make some files larger; default rewriting increased T1 and D1 by 0.07% and 1.03%, respectively. In addition, the article’s claims about the effect of decode-level remain the author’s inference and have not yet been verified.
Impact on regular people
For enterprise IT: When batch-processing contracts, scanned documents, or reports, classify and test files by text, images, and duplicate resources rather than treating one compression setting as a universal standard. Retain the originals before deployment, and record file size, page count, and readability.
For workplace professionals: Before sending a PDF, try combining object streams with moderate recompression; for scanned documents, do not expect meaningful reductions. If merging duplicate images is essential, a dedicated tool may be required.
For the consumer market: Claims such as “lossless compression” and “one-click slimming” need to be evaluated against file structure. When a text-only file is already near its limit, additional compression offers limited returns; only highly repetitive files are likely to see double-digit improvements.