fcorbelli / zpaqfranz

Deduplicating archiver with encryption and paranoid-level tests. Swiss army knife for the serious backup and disaster recovery manager. Ransomware neutralizer. Win/Linux/Unix
MIT License
279 stars 25 forks source link

compressing PDF #129

Closed ArtemGr closed 1 month ago

ArtemGr commented 1 month ago

Just a heads up that it is possible to improve PDF compression with zpaq

For starters we need to unpack the PDF with something like

gs -dCompressPages=false -dCompressFonts=false -dCompressStreams=false -dEncodeColorImages=false -dEncodeGrayImages=false -dEncodeMonoImages=false -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dPDFSETTINGS=/screen -dSubsetFonts=true -dColorImageResolution=96 -dGrayImageResolution=96 -sOutputFile=raw.pdf src.pdf

Then repack it with

zpaqf a raw raw.pdf -m5 -verify
fcorbelli commented 1 month ago

I think it is a type of lossy compression. That is, reducing the quality of the original PDF. I don't think you can get an appreciable reduction in size. Anyway, thanks for the suggestion