Skip to content

FPDF 2 is a PHP class which allows to generate PDF files with pure PHP.

License

Notifications You must be signed in to change notification settings

laurentmuller/fpdf2

Repository files navigation

FPDF2

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

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

composer require laurentmuller/fpdf2

Alternatively, you can add the requirement "laurentmuller/fpdf2":"^2.0" to your composer.json file and run composer update. This could be useful when the installation of FPDF2 is not compatible with some currently installed dependencies. Anyway, the previous option is the preferred way, since composer can pick the best requirement constraint for you.

Basic Usage

use fpdf\Enums\PdfFontName;
use fpdf\Enums\PdfFontStyle;
use fpdf\PdfDocument;

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

Tutorials

Code Quality

SymfonyInsight Codacy PHP-Stan Psalm CodeFactor Codecov

Actions

PHP-CS-Fixer PHPStan PHPUnit Psalm Rector Lint StyleCI

About

FPDF 2 is a PHP class which allows to generate PDF files with pure PHP.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages