chokri/pdfkit

PDF tool kit

2.1.0 2025-07-04 22:56 UTC

This package is auto-updated.

Last update: 2025-07-04 23:07:53 UTC


README

Latest Stable Version License

PDFKit

A simple PHP library for making PDF files. Uses setasign/fpdf and works with PHP 8.4 or newer.

Installation

Install with Composer:

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.

Changelog

See CHANGELOG.md for updates.

Author

Chokri Khalifa — chokrikhalifa.com