, (*1)
PDFKit
A simple PHP library for making PDF files. Uses setasign/fpdf and works with PHP 8.4 or newer., (*2)
Installation
Install with Composer:, (*3)
composer require chokri/pdfkit
Basic Example
require 'vendor/autoload.php';
use Chokri\PDF\Pdf;
$pdf = new Pdf();
$pdf->addTitlePage('My PDF Title', 'Subtitle', 'Author Name');
$pdf->addTable(['Col1', 'Col2'], [['A', 'B'], ['C', 'D']]);
$pdf->addImageCentered('logo.png', 80);
$pdf->addPageNumbering();
$pdf->Output('I', 'example.pdf');
Features
- Easy to use
- PSR-4 autoloading
- PHP 8.4+ support
- GPL-3.0 license
- Write HTML with
WriteHTML()
- Add tables and images
- Custom header and footer
- Unit tested with PHPUnit
License
GPL-3.0-or-later. See LICENCE., (*4)
Changelog
See CHANGELOG.md for updates., (*5)
Author
Chokri Khalifa — chokrikhalifa.com, (*6)