mpdf icon indicating copy to clipboard operation
mpdf copied to clipboard

Feature: FPDI PDF 1.5+ Support

Open jakejackson1 opened this issue 9 years ago • 5 comments

Gents, since it is clear the open source version of FDPI won't support the ability to read PDF 1.5+ in the near future I've been looking into the "hows" of developing an open source version the whole community can use (it involved a lot of laborious reading of the PDF spec).

I believe the current blockers are two-fold:

  1. The support of new filters introduced in PDF 1.5.

    ASCIIHexDecode - Already Support in FPDI ASCII85Decode - Already Support in FPDI LZWDecode - Already Support in FPDI FlateDecode - Need to Implement RunLengthDecode - Need to Implement CCITTFaxDecode - Not sure about this yet JBIG2Decode - Not sure about this yet DCTDecode - Not sure about this yet JPXDecode - Not sure about this yet Crypt - Not sure about this yet

    Assuming the licensing issue is resolved, we'll be able to borrow heavily from the TCPDF project which actually implements the FlateDecode and RunLengthDecode filters already. That makes that job a bit easier.

  2. FPDI currently only supports standard xref tables. PDF 1.6 introduced xref cross reference streams which will need to be handled correctly. Again, the good news is the TCPDF project also implements this correctly in the getXrefData / decodeXrefStream / decodeXref methods in their tcpdf_parser.php file.

There could be additional blockers preventing this feature being implemented but I won't know without some real-world testing.

This isn't currently a high priority, but I feel it's one of those must-have features the PHP PDF open-source community will greatly benefit from.

I'll be playing around with this possibility in my free time. If anyone would like to contribute it would be greatly appreciated.

jakejackson1 avatar Jun 12 '15 13:06 jakejackson1

Is there any chance this is going to be implemented in the foreseeable future?

sztyup avatar May 22 '19 00:05 sztyup

@sztyup no. This functionality isn't high on my priority list, but others are more than welcome to contribute.

jakejackson1 avatar May 22 '19 02:05 jakejackson1

Hello! What's the status of this? I'm also using this library but today I got error:

This PDF document probably uses a compression technique which is not supported by the free parser shipped with FPDI. (See https://www.setasign.com/fpdi-pdf-parser for more details)

I uploaded this PDF file to https://www.setasign.com/products/fpdi-pdf-parser/details and there was info: This document uses new PDF compression technics introduced in PDF version 1.5 How to fix this?

mistris avatar Sep 12 '19 09:09 mistris

@mistris See Jake's comment above. For general troubleshooting, please use Stack Overflow.

finwe avatar Sep 12 '19 14:09 finwe

@jakejackson1 We are also needing to support PDFs 1.5+ and are willing to purchase a license for this. Do you know the steps involved in how to install the license and would mpdf still be compatible?

sonicpunk avatar Jul 05 '22 05:07 sonicpunk