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
Fpdf Bundle

Fpdf Bundle Laravel Package

mayeco/fpdf-bundle

mayeco/fpdf-bundle is a Symfony bundle that integrates the FPDF PHP library, exposing it as a service and handling configuration so applications can generate PDF documents from controllers or templates with minimal setup.

View on GitHub
Deep Wiki
Context7

FPDF v1.7 Bundle for Symfony

Frequently asked questions about Fpdf Bundle
Is mayeco/fpdf-bundle a Laravel package?
No. It is a Symfony bundle whose main job is registering the FPDF library with Symfony's service container. Laravel does not use Symfony bundles; it uses service providers, so the bundle's integration layer is unreachable in a Laravel app. The underlying FPDF library is framework-agnostic, but the packaged value here is Symfony-specific glue.
Can I install mayeco/fpdf-bundle in Laravel 10 or 11?
Probably not without conflicts. The package targets Symfony 2.x-era constraints, while Laravel 10 and 11 depend on Symfony 6/7 components, so composer require will likely fail dependency resolution. Run composer require mayeco/fpdf-bundle --dry-run as a quick empirical check before planning any workaround. Forking or loosening constraints creates a permanent maintenance liability for little gain.
Does mayeco/fpdf-bundle work with PHP 8.1, 8.2, or 8.3?
Not reliably. The bundled FPDF 1.7 dates to around 2011 and predates PHP 8, so it can hit removed functions and dynamic-property deprecations on modern PHP. There is no active upstream maintainer for that version to patch PHP 8 incompatibilities. Use setasign/fpdf 1.8.x instead if you need FPDF semantics on PHP 8.1 to 8.3.
What is the best FPDF alternative for Laravel?
For the same coordinate-drawing FPDF API, use setasign/fpdf, the maintained 1.8.x fork that is PHP 8 compatible and drop-in compatible with FPDF's class. If you need HTML/CSS templating fidelity, choose a Laravel-native HTML-to-PDF package such as barryvdh/laravel-dompdf rather than FPDF. Do not adopt the Symfony bundle just to obtain FPDF in Laravel.
How do I use FPDF directly in a Laravel application?
Install setasign/fpdf via Composer and instantiate the FPDF class directly in a service or controller; FPDF is a plain PHP class with no framework coupling. Put page defaults such as unit, page size, orientation, and margins in config/pdf.php, then bind a PdfRenderer interface to one implementation in a service provider. That gives you Laravel-native injection without any Symfony bundle.
Does mayeco/fpdf-bundle support UTF-8 or non-Latin text?
No. FPDF 1.7 is Latin-1 only, so non-ASCII names, addresses, and currency symbols must be converted manually or they will be corrupted. That silent corruption risk alone disqualifies it for many customer-facing documents. If your document mix includes non-Latin text, choose a different PDF engine.
How do I test PDF generation in Laravel?
Wrap PDF generation behind an interface such as PdfRenderer and bind a fake or stub implementation in tests, then assert that your application requested the right document data. For integration tests, generate a real PDF and assert on stable properties like page count, output size, or extracted text rather than byte-for-byte output. Keep engine-specific tests isolated so swapping engines does not require rewriting feature tests.
Is mayeco/fpdf-bundle safe for production?
Treat it as high risk. It is a thin, unmaintained Symfony wrapper around an old FPDF 1.7 release, with very low adoption and no downstream bug surface. Breakage is likely to surface in your own production rather than in the package's issue tracker. For a multi-year product, that is a poor trade.
What are the licensing considerations for mayeco/fpdf-bundle?
The repository's MIT license covers the Symfony glue only, not necessarily the bundled FPDF library, which has its own terms. Before shipping customer-facing PDFs, have legal confirm that both the wrapper and FPDF terms are acceptable for your use. This is a separate review from ordinary Composer license checks.
How do I migrate from mayeco/fpdf-bundle to a Laravel setup?
Run the Composer dry-run first; it usually closes the question because of Symfony constraint conflicts. If you still proceed, ignore the Bundle class entirely, instantiate the underlying FPDF class directly, and reimplement the bundle defaults in config/pdf.php plus a small service provider. Bind generation behind a PdfRenderer interface so you can replace the engine later at low cost.
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.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core