I'm working on a tool that will be writing PDFs and am trying to find a way to compress the objects and streams in the PDF. A number of the PDFs that I'm generating are fairly large, but can be substantially reduced by compressing the objects (or most of the PDF structure) into a flate stream. I swear I've seen this done before, but none of the PDFs that I've looked at seem to do it. I also tried using Acrobat X to compress it with "entire file compression", but it seems to only compress the streams.
I've tried using ObjStm, but it doesn't have a lot of support from other file readers. I need something that has a little more support outside of Adobe.
Any suggestions are appreciated!
In PDF you can have 2 types of compression:
These are the only supported compression scenarios in PDF. Selecting the right compression method depends much on the data you want to compress: for page content streams usually Flate compression is used, 1bpp images use CCITT G4 or better JBIG2, color images are better compressed with JPEG2000, etc.
Object compression is available since Acrobat 6.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With