Installation System requirements and installation of FPDI

System Requirements

FPDI 2 will run on any PHP version above 5.6.

An up to date PHP version (> 7) is recommend for best performance and memory results.

Following PHP extension must be enabled in the PHP configuration:

Because PDF parsing and writing is a performance intensive task the components should be used on a machine with a fast CPU. Also the max_execution_time value should be taken into account.

Same for memory usage. Because PDF documents are sometimes built with several thousands of individual objects, the components will need memory for managing these things. Maybe it is needed to touch the memory_limit value as well.

For sure FPDI requires an installation of FPDF, too. The documentation applies to the latest versions of all involved classes.

Installation

To install FPDI manually you just have to download the package from the project website and extract it to a folder of your choise.

Don't forget to install FPDF before!

Via Composer

FPDI can be installed officially via Composer. The package can be found here. Just add following  to your composer.json file:

{
    "require": {
        "setasign/fpdi": "^2.0"
    }
}

For completion we also prepared a package for FPDF. Because FPDI can work with FPDF or TCPDF we do not added any  dependency configuration to the main package. Its up to you to load the desired package before you use FPDI. For the usage with FPDF your composer.json file should include following:

{
    "require": {
        "setasign/fpdf": "^1.8",
        "setasign/fpdi": "^2.0"
    }
}

We also offer metadata packages, which evaluates dependencies for both FPDF or TCPDF. To use FPDI with FPDF just add following to your composer.json:

{
    "require": {
        "setasign/fpdi-fpdf": "^2.0"
    }
}

To use FPDI with TCPDF just add following to your composer.json: 

{
    "require": {
        "setasign/fpdi-tcpdf": "^2.0"
    }
}

Usage with TCPDF

While the usage with TCPDF was done by a dynamic class in the past, it is required to use the class \setasign\Fpdi\TcpdfFpdi when using FPDI with TCPDF as of version 2. 

Version Information

We use semantic versioning for FPDI as of version 2. 

Version numbers are represented by three integer values:

[MAJOR].[MINOR].[PATCH]
MAJOR
The major version when we make incompatible API changes.
MINOR
The minor version when we add functionality in a backwards-compatible manner.
PATCH
The patch version when we make backwards-compatible bug fixes.

The version can be accessed by a class constants:

PHP
$fpdiVersion = \setasign\Fpdi\Fpdi::VERSION;
// or
$fpdiVersion = \setasign\Fpdi\TcpdfFpdi::VERSION;