itbz/fpdi
Discontinued unofficial PSR-4 fork of Setasign FPDI (Free PDF Document Importer). Instantiates via \fpdi\FPDI and supports TCPDF with patched versions. Prefer the official FPDI via composer/GitHub, ideally FPDI 2.0+.
barryvdh/laravel-dompdf or custom integrations).Setasign/FPDI (v2.0+) is strongly recommended.Setasign/FPDI (v2.0+) directly?
barryvdh/laravel-dompdf (DomPDF-based) or spatie/pdf (Snappy-based) suffice?Setasign/FPDI?Setasign/FPDI (v2.0+): Modern, actively maintained, but may require TCPDF upgrades.dompdf/dompdf: Better for HTML-to-PDF but lacks PDF import features.spatie/pdf: Simpler API but limited to PDF generation (no import).barryvdh/laravel-dompdf (which bundles TCPDF v6.x).composer require itbz/fpdi:~1.0.require_once base_path('vendor/tecnickcom/tcpdf/tcpdf.php');.$fpdi = new \fpdi\FPDI();.Setasign/FPDI (v2.0+):
composer require setasign/fpdi
\setasign\Fpdi\Fpdi).spatie/pdf).$this->app->singleton(\fpdi\FPDI::class, function ($app) {
require_once base_path('vendor/tecnickcom/tcpdf/tcpdf.php');
return new \fpdi\FPDI();
});
composer require tecnickcom/tcpdf:1.5.2-patch1 explicitly to avoid auto-upgrades.Setasign/FPDI with backward-compatibility tests.itbz/fpdi once migrated, replacing with Setasign/FPDI calls.Setasign/FPDI for critical fixes and backport if necessary.Setasign/FPDI’s issue tracker or TCPDF forums.dispatch(new ImportPdfJob($pdfPath, $outputPath));
| Failure Scenario | Impact | Mitigation |
|---|---|---|
| TCPDF version mismatch | Crashes or silent failures | Pin TCPDF to 1.5.2-patch1 in composer.json |
| PDF corruption during import | Invalid output files | Validate PDFs pre-import; implement rollback |
| Memory exhaustion (large PDFs) | Worker crashes | Increase PHP memory limit; optimize PDFs pre-processing |
Migration to Setasign/FPDI fails |
Downtime during cutover | Test migration in staging; use feature flags |
| PHP 8.x compatibility issues | Runtime errors | Use PHP 7.4 in legacy mode; plan upgrade path |
How can I help you explore Laravel packages today?