Package

Spatie Laravel Pdf

Create PDFs in Laravel apps

Package

spatie/laravel-pdf

View on GitHub →

Overview

What Spatie Laravel Pdf does

Spatie's Laravel PDF package offers a straightforward way to generate PDFs within Laravel applications, integrating with several rendering drivers tailored to different requirements.

Developers often need to generate and manage PDF documents in their applications, a task that Spatie's Laravel PDF package simplifies by supporting multiple rendering options. This package can handle everything from simple HTML and CSS to more complex document layouts using drivers like Browsershot, Gotenberg, Cloudflare Browser Run, WeasyPrint, DOMPDF, and chrome-php. Each driver offers unique advantages, such as modern CSS support with Chromium-based options or a no-dependency setup with DOMPDF.

A developer uses the package by invoking its fluent API to render Blade views directly into PDF files. For instance, one can take an HTML invoice template and output it as a PDF saved locally or returned as a download response in a controller. This makes it easy to automate PDF document generation based on dynamically changing data within a Laravel application.

The package also supports testing to ensure PDF rendering behaves as expected. Developers can simulate PDF creation and assert content presence, which integrates naturally into a Laravel testing suite. Moreover, the Laravel Boost feature aids AI agents in generating accurate PDF code after installation, enhancing development workflows within the Laravel environment.

This overview was generated by AI from the package README and may not reflect the latest release.

Read the full README →

Spatie Laravel Pdf Related Articles

Driver-Based Architecture in Spatie's Laravel PDF v2 image

Driver-Based Architecture in Spatie's Laravel PDF v2

Read article
Attach PDFs Directly to Mailables in laravel-pdf 2.6.0 image

Attach PDFs Directly to Mailables in laravel-pdf 2.6.0

Read article
Media Library Pro: Vue, React and Blade components to handle uploads (sponsor) image

Media Library Pro: Vue, React and Blade components to handle uploads (sponsor)

Read article
Spatie Shares Their Coding Guidelines as AI Skills image

Spatie Shares Their Coding Guidelines as AI Skills

Read article
pdfmatrix.com: fast and reliable HTML 2 PDF conversion SaaS (sponsor) image

pdfmatrix.com: fast and reliable HTML 2 PDF conversion SaaS (sponsor)

Read article
pdfmatrix.com: fast and reliable HTML 2 PDF conversion SaaS (sponsor) image

pdfmatrix.com: fast and reliable HTML 2 PDF conversion SaaS (sponsor)

Read article

Let your users buy domains without leaving your app

If your Laravel app gives users a site, a storefront, or a workspace, they’ll eventually want their own domain. The name.com API lets them search, register, and connect one without leaving your product. It’s a clean REST API, so Laravel’s HTTP client is all you need.

Let your users buy domains without leaving your app

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift