Applying higher compression to PDF files
Posted: Wed Jan 13, 2021 6:50 pm
Hi everyone,
This is a follow-up to
"Using a more recent PDF version for PDF production"
topic21147.html
I have a 1200 page book with many figures. When I compare -Dpdf.version=1.4 to -Dpdf.version=1.5, I see a definite size reduction:
However, when I compress the PDF with Ghostscript (or any one of the many available PDF compression utilities):
I see that much more reduction is still available:
Even starting from the PDF v1.5 file, I can still reduce the file size from 22MB to 15MB.
In an Adobe FrameMaker flow, Adobe PDF Distiller (the actual PDF generation engine) provides fine control over PDF compression options. Even with PDF version v1.5 (a big step forward!), PDF Chemistry PDFs are larger than the correspond FrameMaker PDFs.
In our production flow (linux), we have a bash shell batch file that runs Ghostscript as a post-processing operation to get the size reduction.
But when our writers create PDFs on their Windows laptops, there's no easy way of doing that.
There's a neat commercial pure-Java PDF compression utility here:
https://www.pdftron.com/documentation/s ... imizerTest
This would work across all platforms. Or maybe there's an open-source Java PDF compression utility floating around?
This is a follow-up to
"Using a more recent PDF version for PDF production"
topic21147.html
I have a 1200 page book with many figures. When I compare -Dpdf.version=1.4 to -Dpdf.version=1.5, I see a definite size reduction:
Code: Select all
33036 -rw-rw-rw- 1 doc src 33688601 Jan 13 07:19 o14/ptug.pdf
21612 -rw-rw-rw- 1 doc src 22033988 Jan 13 07:23 o15/ptug.pdf
Code: Select all
/depot/Ghostscript/ghostscript-9.53.3/bin/gs -sDEVICE=pdfwrite \
-dPDFSETTINGS=/printer \
-dPrinted=false \
-dCompatibilityLevel=1.5 \
-dEmbedAllFonts=true \
-dSubsetFonts=true \
-dFastWebView=true \
-dNOPAUSE -dQUIET -dBATCH \
-sOutputFile='FILE_opt.pdf' \
'FILE.pdf'
Code: Select all
33036 -rw-rw-rw- 1 doc src 33688601 Jan 13 07:19 o14/ptug.pdf
14640 -rw-rw-rw- 1 doc src 14925393 Jan 13 07:30 o14/ptug_opt.pdf
21612 -rw-rw-rw- 1 doc src 22033988 Jan 13 07:23 o15/ptug.pdf
14640 -rw-rw-rw- 1 doc src 14925393 Jan 13 07:30 o15/ptug_opt.pdf
In an Adobe FrameMaker flow, Adobe PDF Distiller (the actual PDF generation engine) provides fine control over PDF compression options. Even with PDF version v1.5 (a big step forward!), PDF Chemistry PDFs are larger than the correspond FrameMaker PDFs.
In our production flow (linux), we have a bash shell batch file that runs Ghostscript as a post-processing operation to get the size reduction.
But when our writers create PDFs on their Windows laptops, there's no easy way of doing that.
There's a neat commercial pure-Java PDF compression utility here:
https://www.pdftron.com/documentation/s ... imizerTest
This would work across all platforms. Or maybe there's an open-source Java PDF compression utility floating around?