# spatie/laravel-pdf

Create PDF files in Laravel apps

Repository: https://github.com/spatie/laravel-pdf
Canonical: https://ross.abutalabs.com/products/laravel-pdf
Homepage: https://spatie.be/docs/laravel-pdf
Language: PHP
License: MIT
License Family: permissive
Topics: laravel, pdf, php
Last push: 2026-08-17T07:30:24+00:00

## Health v2 (maintenance only)
Score: 92/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 98, release rhythm 98, longevity 70
- inputs: {"age_days": 985, "days_push": 16, "days_rel": 16, "gap_med": 9, "n_releases_24m": 26}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1041, forks 106 (observed 2026-08-28T04:03:20.547136+00:00)

## What it is
A Laravel package for generating PDF files from Blade views using a driver-based architecture. It supports multiple backends including Browsershot (Chromium), Gotenberg, Cloudflare Browser Run, WeasyPrint, DOMPDF, and chrome-php/chrome.

## Use cases
- generate pdf invoices from blade views in laravel
- render html to pdf in a php laravel app
- download pdf response from a laravel controller
- generate pdfs with tailwind css styling
- test pdf responses in laravel feature tests
- generate pdfs in docker without installing chrome locally

## When to choose
- you are building a Laravel 11+ / PHP 8.2+ app and need PDF generation from HTML views
- you want flexibility to swap PDF engines (Chromium, Gotenberg, WeasyPrint, DOMPDF) via config
- you need modern CSS (grid, flexbox, Tailwind) in generated PDFs via Chromium-based drivers
- you want built-in testing helpers like Pdf::fake() and assertion methods

## When to avoid
- you are not using the Laravel framework
- you need to manipulate or parse existing PDFs rather than create them
- your host cannot run Node.js/Chrome, Docker, or Python and you need advanced CSS beyond DOMPDF's CSS 2.1 support

## Facets
- artifact type: library
- maturity: active
- function: pdf, templating, testing
- domain: web-development, pdf, backend
- platform: php, cloud
- tags: laravel-package, pdf-generation, blade-views, driver-based, spatie, laravel, docker

## Member repositories
- spatie/laravel-pdf (main) score 92

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:20.547136+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:02:58.794553+00:00, confidence not recorded.
  - readme: https://github.com/spatie/laravel-pdf (fetched 2026-08-28T04:03:20.547136+00:00, sha 4acac4f17194)
  - homepage: https://spatie.be/docs/laravel-pdf (fetched 2026-08-29T13:04:08.257931+00:00, sha ccf3e0049203)
  - site_page: https://spatie.be/docs (fetched 2026-08-29T13:04:08.267729+00:00, sha 08e024d86d95)
  - site_page: https://spatie.be/about-us (fetched 2026-08-29T13:04:08.270205+00:00, sha d3cb88e4b34c)
  - site_page: https://spatie.be/docs/laravel-pdf/v2 (fetched 2026-08-29T13:04:08.272196+00:00, sha ccf3e0049203)
  - site_page: https://spatie.be/docs/laravel-pdf/v1 (fetched 2026-08-29T13:04:08.274051+00:00, sha b6a65bfa5349)
  - site_page: https://spatie.be/docs/laravel-pdf/v2/support-us (fetched 2026-08-29T13:04:08.275997+00:00, sha 6fa25210e4bf)
  - site_page: https://spatie.be/docs/laravel-pdf/v2/requirements (fetched 2026-08-29T13:04:08.277796+00:00, sha 779e75d49a57)
  - site_page: https://spatie.be/docs/laravel-pdf/v2/installation-setup (fetched 2026-08-29T13:04:08.279580+00:00, sha 1e3cc19d7d28)
  - site_page: https://spatie.be/docs/laravel-pdf/v2/questions-issues (fetched 2026-08-29T13:04:08.282438+00:00, sha 9a25def22c2e)
- Data as of 2026-08-30T08:39:29.467469+00:00.
