views:

291

answers:

2

So I have a report system built using Java and iText. PDF templates are created using Scribus. The Java code merges the data into the document using iText. The files are then copied over to a NFS share, and a BASH script prints them.

I use acroread to convert them to PS, then lpr the PS.

The FOSS application pdftops is horribly inefficient.

My main problem is that the PDF's generated using iText/Scribus are very large. And I've recently run into the problem where acroread pukes because it hits 4gb of mem usage on large (300+ pages) documents. (Adobe is painfully slow at updating stuff to 64 bit).

Now I can use Adobe reader on Windows, and use the Reduce file size option or whatever its called, and it greatly(> 10x) reduces the size of the PDF(it removes alot of metadata about form fields and such it appears) and produces a PDF that is basically a Print image.

My question is does anyone know of a good solution/program for doing something similiar on Linux. Ideally, it would optimize the PDF, reduce size, and reduce PS complexity so the printer could print faster as it takes about 15-20 seconds a page to print right now.

A: 

I have a similar problem.

PDF doesn't include printer commands, like duplexing, tray calls, etc., which is why PDF files sometimes need to be converted to Postscript for subsequent processing.

The problem with doing that, however, is the generally low quality of the Postscript. Given a 10,000-page PDF, how many times must the fonts be redefined? How many times must the graphics be redefined? Can't they be done once for the entire file? Postscript allows that!

So, my add-on to this question would be does anyone know of a Postscript optimizer? Something that will remove the redundant elements and greatly reduce the file size.

tggagne
This is not an answer - add it as a comment to the original question, or make a new question including a link to this one.
rjmunro
+1  A: 
gs -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=output.pdf input.pdf

Ghostscript seems to work for most for this issue. I'm having a different problem now with ghostscript garbling the embedded fonts, but I'll open a new question for that.

Sheldon Ross