CAM :: PDF can read compressed XRef. The documentation states:
The file format via PDF 1.5 is well supported, with the exception of the โlinearizedโ or โoptimizedโ output format, which this module can read but not write.
I did not work with CAM :: PDF. But I looked at it, and the api feels weird after exiting from PDF :: API2. Is it a lower level or something else. However, there are advantages and disadvantages to both libraries.
We use PDF :: API2 at work and ask our designers to save in PDF v1.4 when they give us the material. You can also use ghostscript to convert them to PDF 1.4, which is supported by PDF :: API2.
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -o out.pdf in.pdf
source share