tags:

views:

876

answers:

3

There doesn't appear to be any Perl libraries that can open, manipulate, and re-save PDF documents that use the newer PDF version (1.5 and above I believe) that use a cross-reference stream rather than table. Does anyone know of any unix/linux-based utilities to convert a PDF to an older version? Or perhaps there's a Perl module in CPAN I missed that can handle this?

+1  A: 

I would try running it through ghostscript with appropriate parameters.

Something like gs -dBATCH -dNOPAUSE -sDEVICE=pdfwriter -dCompatibilityLevel=1.2

Roman Plášil
Note this will also lose things such as transparency information.
danio
Also, it will flatten out any text in the file into vector paths, so the resulting PDF is worthless if you want to be able to futher edit the text in a vector graphics or DTP program that can import PDFs.
Aristotle Pagaltzis
+4  A: 

I'm working on it! I'm the CAM::PDF author and I've coded about a third of the support for the new crossref syntax. Donations would help (code, tests or dollars) because my bottleneck is free time...

Chris Dolan
FYI, I finished and published this open-source solution. See http://search.cpan.org/dist/CAM-PDF/
Chris Dolan
+7  A: 

Done! An hour ago, I uploaded CAM::PDF v1.50 to CPAN. It now supports PDF v1.5 compressed object streams and cross-reference streams. I've tested it with a few PDF files that I found online, but I'd sure appreciate feedback (good or bad).

Chris Dolan