- How do I install contoweb/laravel-pdflib in a Laravel app?
- Install it with Composer using composer require contoweb/laravel-pdflib. Laravel's package discovery registers the service provider and facade automatically. Publish the configuration with php artisan vendor:publish and supply the PDFlib license key through your environment or secret manager rather than committing it to the config file.
- What are the system requirements for this Laravel PDFlib wrapper?
- You need PHP 8.x with the native PDFlib extension compiled into every runtime, including local dev, CI, staging, production, and queue workers. You also need a valid PDFlib license key; PDFlib Lite is a limited no-cost tier, but full PDFlib is commercial. The Composer package alone is not enough, because it is a thin wrapper over PDFlib GmbH's extension.
- Can I use contoweb/laravel-pdflib to render a Blade view or HTML to PDF?
- No, this package does not render HTML and is not a pure-PHP library. It exposes PDFlib's coordinate-based document API for programmatic page composition, so HTML-to-PDF is a poor fit. For rendering a Blade view to PDF, dompdf, mpdf, or Browsershot are simpler and dependency-free.
- Which Laravel and PHP versions does contoweb/laravel-pdflib support?
- The package targets Laravel 9 through 13 on PHP 8.x. Version 3.4.0 is an additive minor release that widens the illuminate/* constraints for Laravel 13 support. Treat Laravel 13 support as forward-looking until you confirm it is GA and verify the full dependency tree resolves on your PHP version.
- Is PDFlib free, or do I need a commercial license for this package?
- PDFlib requires a commercial license per server or CPU for full functionality, and PDFlib Lite is a limited no-cost tier. License procurement and legal review should be on the critical path before adoption. Confirm the license tier, annual cost at your projected server count, and renewal terms first, because they gate everything else.
- How do I configure the PDFlib license key securely in Laravel?
- Publish the package config and inject the license key from your environment or a secret manager, not the committed config file. The configuration is cache-safe, so it works with php artisan config:cache. This keeps the key out of version control and consistent across containers and queue workers.
- How do I test a Laravel app that uses contoweb/laravel-pdflib in CI?
- Tests require the native PDFlib extension and a valid license key, so plain unit tests should be isolated from the engine. Confine PDFlib usage behind an internal interface and mock or fake that boundary in fast tests. Run a separate licensed integration job that has the extension compiled in to verify real PDF output.
- Does contoweb/laravel-pdflib support PDF/A, PDF/UA tagging, encryption, and PDI import?
- Yes, those are the package's strongest fits because they come from the underlying PDFlib engine. It supports programmatic page composition, PDF/A and PDF/UA tagging, encryption and permissions, and PDI import or merging of existing PDFs. If you only need simple HTML-to-PDF, these capabilities add cost and complexity you may not need.
- Can I use contoweb/laravel-pdflib on Laravel Vapor or serverless platforms?
- Laravel Vapor is a poor fit without a custom Lambda layer that includes the compiled PDFlib extension. Treat that as a blocker to confirm early, before committing to the package. Containerized deployments such as Docker, ECS, or Kubernetes also need a custom base image or build stage for the extension.
- What are the alternatives to contoweb/laravel-pdflib, and how hard is migration?
- For the common HTML-to-PDF use case, dompdf, mpdf, and Browsershot are simpler and need no commercial license. For PDF/A, PDF/UA, encryption, and PDI import, this package or raw PDFlib fits, but replacing dompdf or mpdf is not a dependency swap because templates must be rewritten for a structurally different API. Also note the package has a single maintainer, so confine PDFlib usage behind an internal interface to keep the engine swappable.