- How do I install fpdf/fpdf in a Laravel application?
- Run composer require fpdf/fpdf and let Laravel package auto-discovery register the service provider, or register it manually if auto-discovery is disabled. You can optionally publish the config file with php artisan vendor:publish. There is no database, queue, or credentials involved, so installation is typically under half a day including verification.
- Does fpdf/fpdf work with Laravel 11 and PHP 8.3?
- The wrapper is thin, so real support depends on the pinned fpdf/fpdf version running cleanly on your exact PHP minor. FPDF is legacy code and can emit dynamic-property deprecations on PHP 8.2 and 8.3, so verify the install with deprecations treated as errors in CI. Deprecation text leaking into a PDF response is a real corruption vector, not a cosmetic issue.
- What does fpdf/fpdf add on top of the original FPDF class?
- It is a Composer wrapper around the legacy FPDF library that adds Laravel ergonomics: a service provider, a container binding, an Fpdf facade, and a publishable config file. It is a convenience layer, not an abstraction, so it exposes FPDF's imperative Cell, MultiCell, and AddPage API directly. That keeps portability high because the API is public and documented at fpdf.org, but swapping to mPDF or DomPDF is a rewrite rather than a config change.
- How do I use the Fpdf facade or container binding inside a controller?
- Resolve the binding from the container or import the Fpdf facade, then call FPDF methods such as AddPage, SetFont, Cell, and Output exactly as you would in plain FPDF. Because consumers bind directly to the FPDF API surface, consider hiding calls behind your own PdfRenderer interface so a future exit is a one-class swap.
- How do I output UTF-8 or non-Latin characters with fpdf/fpdf?
- FPDF is Latin-1 by default, so UTF-8 text needs iconv-based conversion or an embedded TTF font before it renders correctly. CJK and RTL content require manual font work and are not handled automatically. If your documents need real Unicode typography, evaluate a different renderer instead of fighting the encoding layer.
- What license does fpdf/fpdf use, and is it safe for commercial use?
- Package metadata reports NOASSERTION and the wrapper repository does not present a clear LICENSE file, which is a gating issue for most teams. Upstream FPDF carries a custom permissive license that requires retaining the copyright notice and provides no warranty. Any commercial, redistributed, or on-premises-shipped product should get legal sign-off before adoption, and this should be the first item you close.
- Can fpdf/fpdf convert HTML and CSS templates into PDF?
- No. FPDF is an imperative, coordinate-based library with no CSS engine, no guaranteed automatic text wrapping, and manual page-break handling. If a designer owns the template or you need HTML-to-PDF, use DomPDF, mPDF, or Snappy instead. Migrating between those layout models and FPDF is a rewrite, not a migration.
- Will fpdf/fpdf conflict with FPDI or another vendored FPDF copy?
- FPDF declares the global FPDF class, so coexisting with setasign/fpdi or any vendored FPDF copy will fatal on redeclaration. Audit your codebase for existing FPDF usage before adding the package. If you already run FPDI, plan how both will avoid or share the same global class.
- How do I test PDF output generated with fpdf/fpdf?
- Generation is deterministic and dependency-free, so you can assert on raw bytes, page count, or extracted text in feature tests. There are no network calls, queues, or credentials involved, which keeps tests fast and hermetic. Treat PHP deprecation notices as test failures so they never leak into generated output.
- Is fpdf/fpdf actively maintained, and what happens if it is abandoned?
- It is effectively a single-maintainer, low-traffic repository with roughly 51 stars and no dependents, which signals a commodity convenience package. The wrapper is small enough to vendor outright if upstream goes dark, so exit cost is trivial and the risk is inconvenience rather than lock-in. Keep the pinned version and your drawing code under version control so you can take over maintenance if needed.