spatie/laravel-pdf
Generate PDFs from Laravel Blade views with a simple fluent API. Choose drivers like Browsershot/Chromium, Gotenberg, Cloudflare Browser Run, WeasyPrint, DOMPDF, or chrome-php. Use modern CSS, set page formats, and stream or save PDFs.
Pdf::fake()).Adopt When:
Look Elsewhere If:
"This package lets us generate professional PDFs—like invoices, reports, or certificates—directly from our Laravel app, cutting third-party costs and reducing dev time. It supports multiple backends (even serverless options via Cloudflare) and integrates with our existing Blade templates. For example, we can automate monthly statements for customers or compliance documents for audits without hiring specialized PDF engineers. The testing tools also help us catch issues early, improving reliability."
Key Metrics to Track:
*"Laravel-PDF gives us a driver-based architecture to choose the best PDF generation method for each use case:
Why This Over Alternatives:
Pdf::view()) for all drivers.Trade-offs:
Proposal:
Pdf::fake() in tests to avoid file I/O and speed up CI.Next Steps:
How can I help you explore Laravel packages today?