3

I have apps that use routines for producing PDF's that use a thing called PDF-in-the-box. The PDF's are not compressed, and there appears to be no way of achieving that with this component. Rave components implement a compression event handler and I have used this successfully in other apps that were designed from the ground up with Rave. I'd rather not recode the PDF-in-the-box stuff. Is there any way with Delphi that I can compress a PDF after I have produced it.

(This not image compression - this is lossless compression of the PDF contents. It results in a 3-fold decrease in PDF size typically).

I can simulate the effect I want by opening the PDFs produced with PDF-in-the-box in Adobe Reader and saving them again. The re-saved PDFs are much smaller. I just want to do the same thing in code.

TLama
  • 75,147
  • 17
  • 214
  • 392
rossmcm
  • 5,493
  • 10
  • 55
  • 118
  • Thanks @David. That would mean recoding, but I'm wondering if rather than recoding the app to use another PDF library, a better approach would be to use SynPDF to post-process the uncompressed PDF after it had been generated - i.e. a routine written using SynPDF that did nothing more than read in the PDF and then spit it out again with compression enabled. That's likely to be a simpler approach, yes? – rossmcm Sep 19 '12 at 19:57
  • That's what I had in mind. Better would be to only code once, but re-coding may be an expedient compromise. – David Heffernan Sep 19 '12 at 20:02
  • @David, from my brief look at SynPDF, it can't read them anyway, only produces them. – rossmcm Sep 20 '12 at 03:40

1 Answers1

0

If using external tools from commandline isn't a problem, you can try:

QPDF seems to work faster for me.

Community
  • 1
  • 1
g2mk
  • 509
  • 3
  • 13