Do you need support for PDF documents with a version higher than 1.4? Check out the new FPDI PDF-Parser!
Setasign's first PHP/PDF script: FPDI. Inspired by an article of Marco Tabini in the 'php|architect' magazine, Setasign wrote the first version of FPDI in 2004.
It is based on another extension for FPDF that adds FPDF_TPL - a kind of template feature - to FPDF. This feature can be downloaded in the downloads area.
FPDF_TPL does not only prepare FPDF for FPDI, but offers many other advantages:
Examples of use:
As of version 1.2.1 FPDI can be used with TCPDF - a derivate of FPDF.
We integrated the support into the main classes and used a kind of bridge class for remapping TCPDF to FPDF in which we made some essential changes. The remapping is an automated process and is related to the available, loaded class. If you load (require) FPDF first, FPDF_TPL will extends FPDF. If you load TCPDF first, the bridge class will extend TCPDF and FPDF_TPL will extend the bridge class. That way we were able to use one class for both versions.
FPDF_TPL itself is not fully compatible! Simple templates can be created, but things like HTML are not compatible.
There are also limitation for TCPDF: As TCPDF writes some content to the begining of a content stream, border- and background gets behind a template, while the text still stays in front of it.
FPDI extracts and imports single pages of existing documents into FPDF. The resulting PDF created by FPDF/FPDI is a completely new document. Please don't misunderstand: with FPDI you cannot edit a PDF.
FPDI is unable to import dynamic parts of an existing document, like form fields, links, or any other available page annotation. While importing pages with such elements, the information becomes lost as it is not a part of a page's content stream.
The FPDI standard version does not support the import of protected PDF files. But you can of course generate protected PDF files with the FPDI_Protection-Class.
Additionally, Setasign offers a commercial extension - FPDI_Protection_128_Pro - that provides the opportunity to import pages of encrypted PDF documents, and encrypt the resulting documents with up to 128bits.