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

Pdf Bundle Laravel Package

orkestra/pdf-bundle

Orkestra PDF Bundle brings configurable PDF generation to PHP applications, offering a centralized service for converting templates or HTML into downloadable documents. Ideal for invoices, reports, and exports, it keeps PDF setup reusable and easy to integrate within existing workflows.

View on GitHub
Deep Wiki
Context7

Provides a uniform API for generating PDFs using wkhtmltopdf, tcpdf and zend pdf

Frequently asked questions about Pdf Bundle
Can I use orkestra/pdf-bundle in a Laravel application?
Not without writing your own integration layer. The package is a Symfony bundle built around bundle registration, a DI extension and a configuration tree, so there is no service provider, facade, publishable config or package auto-discovery for Laravel. Composer will download the code, but you would need to register the PdfManager and its adapters yourself, map config/pdf.php into the array shape the bundle expects, and expose the renderer behind a contract you control. For most Laravel projects that glue costs more than implementing PDF generation directly against a maintained backend.
How do I install and configure orkestra/pdf-bundle?
Install it with Composer and then enable the bundle in your Symfony kernel or bundles.php, followed by configuring your chosen adapter, page format, orientation and margins in the bundle's configuration tree. You then inject the PDF service into a controller, command or background job and call the render method against Twig or raw HTML. In a Laravel app none of that wiring exists, so the equivalent steps have to be hand-built in a service provider.
Which Symfony and PHP versions does orkestra/pdf-bundle support?
Check the composer.json constraints on the specific tag before planning anything, because bundle extension and DI semantics changed materially across Symfony 3, 4, 5 and 6. The package has a very small install base, so do not assume the current tag installs cleanly on PHP 8.2 or 8.3. Its TCPDF and Zend\Pdf dependencies are the likely blockers, since both carry deprecations and legacy type handling that can conflict with modern PHP. A quick throwaway install on your target PHP version is the fastest way to find out.
Which PDF engines does orkestra/pdf-bundle support?
The bundle advertises pluggable adapters for wkhtmltopdf, TCPDF and Zend\Pdf, all behind a single rendering interface. Two of those three are effectively legacy: wkhtmltopdf is unmaintained upstream and Zend\Pdf is a dead namespace that has since migrated to Laminas, which risks abandoned-package resolution or autoload collisions. That leaves TCPDF as the only backend that is still maintained, and it comes with a large memory footprint and its own limited HTML/CSS subset.
How do I render a Twig template to PDF with a custom page size and margins?
The bundle is designed for exactly this: you render a Twig template or raw HTML string through the PDF service, with page format, orientation and margins set centrally in configuration. In Symfony you inject the service and call it from a controller, console command or queued job, then stream, download or save the output. If you are in Laravel you would need to replicate that configuration mapping yourself before any of this works.
Why does my generated PDF ignore CSS, flexbox or web fonts?
The rendering fidelity is entirely determined by the backend adapter, not by the wrapper. wkhtmltopdf uses an old Qt WebKit engine with no reliable flexbox, grid or modern web font support, so layouts that look fine in a browser break in the PDF. TCPDF does not render HTML the way a browser does at all and only supports a limited CSS subset. The unified API does not normalize these differences, so switching engines changes pagination and styling in ways you have to test for.
Is wkhtmltopdf safe and maintainable for production PDF generation?
It is effectively unmaintained upstream and carries real operational risk. The adapter shells out to a binary, which introduces argument injection, timeout handling and orphaned child process concerns that you inherit and must contain yourself. It also breaks routinely on modern base images over font packages, sandboxing and OpenSSL versions. If wkhtmltopdf is a hard constraint, use a maintained wrapper instead of this bundle.
Can I swap PDF engines later, and what should I use in Laravel instead?
The abstraction gives the illusion of portability rather than the reality of it, because swapping backends changes CSS support, pagination and font handling in ways the interface does not guarantee. If you only need one engine, the adapter layer is dead weight. For Laravel, the practical options are spatie/laravel-pdf for headless Chromium fidelity, barryvdh/laravel-dompdf for simple documents, or knplabs/knp-snappy if wkhtmltopdf is mandatory. Define your own render(html, options) contract so call sites never depend on the underlying package.
Is orkestra/pdf-bundle actively maintained and who supports it?
It has roughly two stars and zero dependents, so there is no install base, no StackOverflow corpus and no third-party fixes to lean on. Treat fork-and-patch as the only viable support model, and confirm whether the repository is still receiving security and compatibility commits or is frozen. Answer those questions before you build anything on top of it, and make sure someone internally owns the fork.
How do I test PDF generation without invoking a real PDF engine?
Wrap rendering in a contract you own, such as render(html, options) returning bytes, and mock that contract in unit tests so the engine never runs. Keep a small number of integration tests that do execute the real backend and assert on page count, text extraction and file size rather than byte-for-byte output. Because this bundle is tied to Symfony's container, faking it inside Laravel means building that seam yourself first.
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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console