Weave 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

jonasarts/tcpdf-bundle

A Symfony bundle that integrates the TCPDF library for generating PDFs. It provides service configuration and convenient access to TCPDF from your Symfony application, making it easy to create documents, reports, invoices, and other PDF output.

View on GitHub
Deep Wiki
Context7

The TCPDF class wrapped for symfony

Frequently asked questions about Tcpdf Bundle
Can I use jonasarts/tcpdf-bundle in a Laravel application?
No. It is a Symfony bundle with no Laravel service provider, facade, or publishable config, so installing it adds a dependency without adding any behaviour to a Laravel app. Composer may resolve it cleanly, but nothing auto-registers and TCPDF's API is not abstracted for you. Reproduce the wiring yourself in about thirty lines instead.
Is jonasarts/tcpdf-bundle a Laravel package or a Symfony bundle?
It is a Symfony bundle. Its entire value is a dependency injection extension plus a service definition that wraps tecnickcom/tcpdf and exposes the library through Symfony's container. There is no Laravel-side integration, no ServiceProvider, and no Laravel test coverage.
How do I install TCPDF in Laravel without this bundle?
Run composer require tecnickcom/tcpdf, then add a thin service provider that binds a factory singleton and merges a config/pdf.php file holding font path, image path, temp directory, and default page size, unit, and orientation. Point K_PATH_FONTS and K_PATH_IMAGES at storage/app/pdf/fonts and storage/app/pdf/images. Wrap the engine behind a PdfRenderer contract so the renderer stays replaceable without rewriting templates.
What Laravel versions does jonasarts/tcpdf-bundle support?
None. The package targets Symfony, not Laravel, so there is no Laravel version matrix to check. The underlying TCPDF 6.x runs on PHP 8.x but emits deprecation noise from dynamic properties and null-to-string coercions, so pin the version and constrain error reporting inside the render path.
How do I configure TCPDF font and image paths in Laravel?
Create config/pdf.php with font path, image path, temp dir, and page defaults, and have your service provider merge it. The bundle's Symfony parameter conventions for fonts and images will not resolve in a Laravel tree, and naive reuse produces silent glyph fallback and missing images that only appear in production. Also verify ext-gd, ext-mbstring, and a writable temp directory.
What license does TCPDF use, and can I ship it in a commercial product?
The bundle is MIT, but the runtime dependency TCPDF is LGPL-3.0, and the wrapper's license does not govern the engine. If you distribute an artifact such as an on-prem install, appliance, SDK, or embedded binary, LGPL obligations attach to TCPDF regardless. Get legal review before adoption, and note that replacing the wrapper later is cheap while replacing the renderer means rewriting every template.
Is jonasarts/tcpdf-bundle actively maintained?
Adoption signals are negative: around eight stars, zero dependents, a single maintainer, and no visible PHP 8-era upkeep. Treat it as dormant and budget accordingly. Since you would not install it in Laravel anyway, the maintenance risk mainly matters if you are copying its service definitions.
How do I test PDF generation in a Laravel app?
There is no Laravel-side test coverage in the package, so you write your own. Bind the renderer behind an interface, assert on generated bytes or page count rather than exact PDF output, and use a fake renderer in feature tests. Keep a small golden-file test to catch template regressions.
What are the alternatives to TCPDF for Laravel PDF generation?
Use tecnickcom/tcpdf directly behind your own abstraction. If TCPDF's lossy HTML mode is a problem, evaluate mPDF, Dompdf, or a headless-Chrome approach such as Browsershot or Snappy, which handle modern CSS far better. Choose against real requirements: AcroForm fields, 1D and 2D barcodes, digital signatures, PDF/UA tagging, precise absolute layout, and CJK fonts.
Can I reuse the bundle's Symfony service definitions when porting to Laravel?
Yes, and that is the one genuinely useful role the bundle plays for a Laravel team. Transcribe its services.yml definitions into a Laravel service provider and lift the bundle parameters into config/pdf.php, re-pointing K_PATH_* at storage/app/pdf. It is mechanical work, roughly half a day.
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.
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle