FPDF 2 is a PHP class which allows to generate PDF files with pure PHP. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs.

1.8.4.16 2024-04-27 07:42 UTC

README

This repository is clone of fpdf.org with typed variables, enumerations and PHP 8.2 dependencies.

PdfDocument is a PHP class, which allows to generate PDF files with pure PHP. F from FPDF2 stands for Free: you may use it for any kind of usage and modify it to suit your needs.

Installation with Composer

If you're using Composer to manage dependencies, you can use

composer require laurentmuller/fpdf2:^1.8

Or you can include the following in your composer.json file:

{
    "require": {
        "laurentmuller/fpdf2": "^1.8"
    }
}

Usage:

$pdf = new PdfDocument();
$pdf->addPage();
$pdf->setFont(PdfFontName::ARIAL, PdfFontStyle::BOLD, 16);
$pdf->cell(40, 10, 'Hello World!');
$pdf->output();

Tutorials:

Actions

PHP-CS-Fixer PHPStan PHPUnit Psalm Rector Lint StyleCI codecov