Increase in File Size
Occasionally I come across a pdf file where the new file is larger than the original file. Although this recently happened with version 11.9 it has happened with other versions too (10.x branch), different files.
Switch: qpdf.exe --empty --pages Version: qpdf 11.9.0
Any idea what could be causing this?
There are a number of reasons why pdf files generated by qpdf in the way you describe may be larger than the original files. One of the reasons could be that the objects in the original file are stored in compressed object streams. The way you are using qpdf, qpdf would uncompress the objects and copy them to the new empty file without re-compressing them. You can use the
--object-streams=generate option to instruct qpdf to generate compressed object streams in the output file. You can also control the level of compression with the --compression-level option. For more detail see https://qpdf.readthedocs.io/en/stable/cli.html#pdf-transformation
@Hiche3 , I am moving this to the Q&A section of discussions.