Frequently Asked Questions
Why does TCPDF-Next require PHP 8.5+?
PHP 8.5 introduces language features that are fundamental to the library's architecture — including pipe operator support, improved type inference, and enhanced readonly semantics. Targeting a modern runtime allows TCPDF-Next to be smaller, faster, and safer by design rather than by workaround.
For a deeper rationale, see Why PHP 8.5?.
Is TCPDF-Next a fork of TCPDF?
No. TCPDF-Next is a complete ground-up rewrite. It shares no code with the original TCPDF library. The "TCPDF" portion of the name acknowledges the problem domain (PDF generation in PHP) and the legacy project's influence on the community, but the architecture, API surface, and implementation are entirely new.
Can I use it without Laravel?
Yes. The tcpdf-next/core package is fully framework-agnostic. It depends only on PHP 8.5+ and has zero framework dependencies. You can use it in any PHP application — Symfony, Slim, vanilla PHP scripts, CLI tools, or queue workers.
The optional tcpdf-next/laravel package adds Laravel-specific conveniences (service provider, Facade, config publishing) but is not required.
What is the difference between Core and Pro?
| Core | Pro | |
|---|---|---|
| License | MIT | Commercial |
| PDF generation | Full-featured | Full-featured |
| Advanced typography | Basic | OpenType shaping, BiDi, ligatures |
| Digital signatures | Not included | PAdES / CAdES / X.509 |
| PDF/A, PDF/X | Not included | Full compliance modes |
| Barcode engine | 1D barcodes | 1D + 2D (QR, DataMatrix, PDF417) |
| Support | Community (GitHub Issues) | Priority email + SLA |
Core is production-ready on its own. Pro extends it with enterprise and compliance features.
How do I generate HTML-to-PDF with full CSS3 support?
Use the Artisan package (tcpdf-next/artisan). It provides a rendering pipeline that accepts HTML + CSS3 input and produces pixel-accurate PDF output, powered by TCPDF-Next Core under the hood.
use Yeeefang\TcpdfNext\Artisan\HtmlRenderer;
$renderer = HtmlRenderer::create();
$renderer->loadHtml('<h1>Hello</h1><p style="color: navy;">Styled paragraph.</p>');
$renderer->save('/output/report.pdf');Artisan supports Flexbox, Grid, web fonts, media queries, and most of the CSS3 specification.
Does TCPDF-Next support CJK (Chinese, Japanese, Korean)?
Yes. TCPDF-Next has first-class support for CJK scripts and complex text layouts:
- CjkFontValidator — validates and subsets CJK font files, ensuring correct glyph coverage.
- BiDiResolver — handles bidirectional text (e.g., mixed English and Arabic/Hebrew).
- ArabicShaper — applies contextual shaping rules for Arabic, Farsi, and Urdu.
Embed any CJK-capable TrueType/OpenType font via the font configuration, and text rendering works automatically.
$doc->configureFonts(function (FontConfig $config): void {
$config->addFont('/fonts/NotoSansCJK-Regular.ttc', alias: 'NotoSansCJK');
});
$doc->setFont('NotoSansCJK', size: 12);
$doc->cell(text: '你好世界'); // Chinese
$doc->cell(text: 'こんにちは世界'); // Japanese
$doc->cell(text: '안녕하세요 세계'); // KoreanIs TCPDF-Next production-ready?
Yes. The library is backed by a rigorous testing and analysis pipeline:
- 908+ tests covering unit, integration, and visual regression scenarios.
- 28,881+ assertions across the test suite.
- PHPStan level 8 — the strictest static analysis level — passes with zero errors.
- 100%
declare(strict_types=1)across every source file.
The test suite runs on every pull request and is required to pass before merging.
How do I report a security vulnerability?
Do not open a public GitHub issue. Instead, use GitHub Security Advisories to report vulnerabilities privately. The maintainers will triage the report, coordinate a fix, and publish a security release.
For more information, see the SECURITY.md file in the repository.