Getting Started
TCPDF-Next is a modern PHP 8.5+ library for generating PDF 2.0 documents. This guide gets you from zero to your first PDF in 5 minutes.
Requirements
| Requirement | Minimum |
|---|---|
| PHP | 8.5+ |
| Extensions | openssl, zlib, mbstring, gd, curl, intl |
| Composer | 2.x |
Install
bash
composer require yeeefang/tcpdf-nextThis installs the Core package with all 148 source files.
Optional Packages
bash
# Chrome CDP HTML renderer (full CSS3)
composer require yeeefang/tcpdf-nextartisan
# Laravel 12 integration
composer require yeeefang/tcpdf-nextlaravel
# Enterprise features (commercial license)
composer require yeeefang/tcpdf-nextproYour First PDF
php
<?php
require 'vendor/autoload.php';
use Yeeefang\TcpdfNext\Core\Document;
$pdf = Document::create()
->setTitle('My First PDF')
->setAuthor('TCPDF-Next')
->addPage()
->setFont('Helvetica', '', 16)
->cell(0, 10, 'Hello, PDF 2.0!')
->ln()
->setFont('Helvetica', '', 12)
->cell(0, 10, 'Generated with TCPDF-Next')
->save('hello.pdf');
echo "PDF saved to hello.pdf\n";Run it:
bash
php hello.phpNext Steps
- Installation — System requirements, extension verification, Docker setup
- Configuration — Default settings, font paths, encryption options
- Basic Usage — Pages, text, fonts, images, and output
- Core Package — Full documentation of all 148 source files
- Laravel Integration — Facade, responses, queue jobs