Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Tcpdf Bundle

Tcpdf Bundle Laravel Package

acucchieri/tcpdf-bundle

Symfony bundle integrating TCPDF for quick PDF generation and delivery. Build PDFs via a TCPDF-based PdfBuilder and output inline, as download, attachment/base64, string, or save to disk. Includes MultiCell row helper for table-like layouts.

View on GitHub
Deep Wiki
Context7

Integration bundle for TCPDF library in Symfony

Frequently asked questions about Tcpdf Bundle
Can I use ACTcpdfBundle in Laravel, or is it only for Symfony?
This bundle is designed for Symfony, not Laravel. Laravel developers should explore alternatives like **barryvdh/laravel-dompdf** or **spatie/pdf-to-base64**, which are Laravel-native and integrate with Laravel’s service container and Blade/Twig.
What Laravel versions does ACTcpdfBundle support?
ACTcpdfBundle is not Laravel-compatible. It’s built for Symfony 3.x (with potential manual adjustments for Symfony 4/5/6). For Laravel, check TCPDF’s standalone PHP library or Laravel-specific PDF packages instead.
How do I install ACTcpdfBundle in a Symfony project?
Run `composer require acucchieri/tcpdf-bundle`, then enable the bundle in `config/bundles.php` (Symfony 4+) or `app/AppKernel.php` (Symfony 3.x). No additional configuration is required for basic usage.
Does ACTcpdfBundle support Twig templates for dynamic PDF content?
No, the bundle doesn’t natively integrate with Twig. You’ll need to manually render Twig templates to HTML strings and pass them to TCPDF’s `writeHTML()` method. For seamless Twig support, consider alternatives like **knplabs/knp-snappy-bundle** (HTML-to-PDF via wkhtmltopdf).
Is ACTcpdfBundle secure? Has it patched TCPDF vulnerabilities like CVE-2021-32629?
The bundle hasn’t been updated since 2021, so it may not include patches for TCPDF vulnerabilities. If security is critical, manually update TCPDF via Composer (`composer require tecnickcom/tcpdf`) or use a maintained alternative like **spatie/pdf-to-base64**, which wraps a patched version.
How do I generate a PDF and send it as an email attachment in Symfony?
Use the `attachment()` helper: `$pdfBuilder->attachment('invoice.pdf')` returns a base64-encoded string. Pass this to Symfony’s `Swiftmailer` or `Mailer` component as an email attachment. For inline PDFs, use `$pdfBuilder->inline('document.pdf')` in a controller response.
What’s the performance like for high-volume PDF generation?
TCPDF is slower than alternatives like DomPDF or Snappy (wkhtmltopdf). For high-traffic apps, benchmark with tools like **Blackfire** or **Xdebug**. If performance is critical, consider **knplabs/knp-snappy-bundle** for HTML-to-PDF conversion, which leverages faster rendering engines.
Can I customize fonts or add barcodes in ACTcpdfBundle?
Yes, but it requires direct TCPDF API knowledge. Use TCPDF’s `AddFont()` or `write2DBarcode()` methods via the `PdfBuilder` instance. The bundle extends TCPDF directly, so all TCPDF features are available. Refer to the [TCPDF documentation](https://tcpdf.org) for advanced use cases.
How do I test PDF generation in CI/CD pipelines?
Test PDF output by comparing generated files to golden masters (pre-generated PDFs) using tools like **PHPUnit** and **File::assertEquals()**. For dynamic content, mock data sources (e.g., Doctrine entities) and verify the PDF structure with libraries like **setasign/fpdi** for assertions.
What are the alternatives to ACTcpdfBundle for Symfony/Laravel?
For Symfony: **knplabs/knp-snappy-bundle** (HTML-to-PDF via wkhtmltopdf), **spatie/pdf-to-base64** (TCPDF wrapper with Laravel/Symfony support). For Laravel: **barryvdh/laravel-dompdf**, **spatie/pdf-to-base64**, or **mikehaertl/phpwkhtmltopdf** (Snappy wrapper). Choose based on needs: TCPDF for complex layouts, Snappy for HTML fidelity.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor