Does PDF :: API2 support reading PDF 1.5+ with compressed XRef?

It seems that PDF :: API2 does not support xref table compression in PDF 1.5 (and later) format. This file type is more common since Acrobat 9 and 10 write them by default. Another compression scheme is streams of compressed objects.

I get the following error: Small-format xref in the PDF file on / opt / local / lib / perl 5 / site_perl / 5.12.3 / PDF / API2 / Basic / PDF / File.pm line 1140.

Does any of the Perl PDF modules support reading a PDF file using compressed XRef?

+6
source share
1 answer

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 
+4
source

Source: https://habr.com/ru/post/893412/


All Articles