Package
Spatie Laravel Pdf
Create PDFs in Laravel apps
Overview
What Spatie Laravel Pdf does
Spatie's Laravel PDF package offers a versatile solution for generating PDFs within Laravel applications using various rendering drivers.
The package is designed for developers who need to create PDFs from Blade views with simplicity and flexibility. It supports a range of drivers including Browsershot, Gotenberg, Cloudflare Browser Run, WeasyPrint, DOMPDF, and chrome-php. These options allow developers to tailor the PDF creation process to their specific needs, whether it's using modern CSS features with Chromium-based drivers or opting for a zero-dependency setup with DOMPDF.
A key feature is the ability to render a Blade view with given data and save it as a PDF. This operation can be performed with a straightforward API that integrates seamlessly into existing Laravel applications. Moreover, PDFs can be returned directly as responses from controllers, making it easy to serve downloadable content such as invoices or reports.
The package also supports testing capabilities, allowing developers to verify that their PDFs are rendered correctly within the application. By using the testing tools provided, developers can simulate PDF creation and assert that the output meets expectations. This ensures reliability in critical applications where automated document generation is a core feature.
Additionally, the integration with Laravel Boost helps enhance AI agent capabilities within projects, facilitating the creation of correct PDF code automatically. This feature, coupled with extensive documentation and testing support, makes Spatie's Laravel PDF package a strong choice for teams using Laravel to build applications that require dynamic PDF generation.
This overview was generated by AI from the package README and may not reflect the latest release.
Read the full README →