We've got a .net 2.0 web system that dynamically builds pdf files. Some of these files can get pretty large - 12MB+. While processing time isn't a factor, really, the size of the files to be downloaded is in some cases.
For the moment, let's assume that our B-grade pdf library is already making the smallest files that it knows how. (Although, if anyone has any suggestions on that front, do see this related question.)
However, taking the 12MB file in question and sending it though the Acrobat distiller results in a roughly 700K file, with no appreciable loss in print quality.
I'd love to have some kind of post-processor that does even a third of that. Does anyone have any controls they know about that'll do something like this?
The cheaper the better, for this project, but we're not adverse to throwing a few bucks down.
(Some preemptive comments: naturally, rewriting the existing PDF generation code with a new tool is off the table at the moment. Also, while Distiller seems to have an API, calling that on a webserver doesn't seem like the most efficient course - and Distiller is a little pricey. Finally, we'd just as well not wrap the pdfs in a zip file or some such, since that may baffle the clients somewhat. No, really.)
Thanks!
Use Ghostscript, which is also available for the 32bit and 64bit Windows platforms. It recognises all Adobe Distiller parameters[1] and honors most of them. On top of that, you can inject PostScript programs into the conversion process. I use it for a year now in a pre-print production environment on image-heavy PDFs. If the parameters are set correct, the file-size can go from 40MB down to 800kB with no visible loss of quality. I found it to be quite fast, in fact the documentation states that it may be faster than Adobe Distiller.
And it is free (as in beer as well as in speech).
[1] See distparm.pdf in the help folder of Distiller or look here.
You call it from the command line with all your wanted parameters, input and output-files and you're done.
Quick example:
gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite\
-dCompatibilityLevel=1.3 -dEncodeColorImages=true\
-sOutputFile=output.pdf input.pdf
Some valuable resources:
PDF's usually use JBIG/JBIG2/JPEG2000 compression. Cvision's PDFCompressor is the best for compressing PDF's.
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