Requirements | laravel-pdf-go | Spatie       

 SPATIE  

laravel-pdf-go
==============

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Laravel-pdf-go](https://spatie.be/docs/laravel-pdf-go/v1)  Requirements

 Version   v1      

 Other versions for crawler [v1](https://spatie.be/docs/laravel-pdf-go/v1) 

  Requirements    
- [ Introduction ](https://spatie.be/docs/laravel-pdf-go/v1/introduction)
- [ Support us ](https://spatie.be/docs/laravel-pdf-go/v1/support-us)
- [ Requirements ](https://spatie.be/docs/laravel-pdf-go/v1/requirements)
- [ Installation &amp; setup ](https://spatie.be/docs/laravel-pdf-go/v1/installation-setup)
- [ Questions and issues ](https://spatie.be/docs/laravel-pdf-go/v1/questions-issues)
- [ Changelog ](https://spatie.be/docs/laravel-pdf-go/v1/changelog)
- [ Alternatives ](https://spatie.be/docs/laravel-pdf-go/v1/alternatives)
- [ About us ](https://spatie.be/docs/laravel-pdf-go/v1/about-us)
- [ Testing ](https://spatie.be/docs/laravel-pdf-go/v1/testing)
- [ Releasing ](https://spatie.be/docs/laravel-pdf-go/v1/releasing)

Basic usage
-----------

- [ Creating PDFs ](https://spatie.be/docs/laravel-pdf-go/v1/basic-usage/creating-pdfs)
- [ Responding with PDFs ](https://spatie.be/docs/laravel-pdf-go/v1/basic-usage/responding-with-pdfs)
- [ Formatting PDFs ](https://spatie.be/docs/laravel-pdf-go/v1/basic-usage/formatting-pdfs)
- [ Saving PDFs to disks ](https://spatie.be/docs/laravel-pdf-go/v1/basic-usage/saving-pdfs-to-disks)
- [ Attaching PDFs to mails ](https://spatie.be/docs/laravel-pdf-go/v1/basic-usage/attaching-pdfs-to-mails)
- [ Queued PDF generation ](https://spatie.be/docs/laravel-pdf-go/v1/basic-usage/queued-pdf-generation)
- [ Testing PDFs ](https://spatie.be/docs/laravel-pdf-go/v1/basic-usage/testing-pdfs)
- [ Setting defaults ](https://spatie.be/docs/laravel-pdf-go/v1/basic-usage/setting-defaults)
- [ Protecting PDFs with a password ](https://spatie.be/docs/laravel-pdf-go/v1/basic-usage/protecting-pdfs-with-a-password)

Drivers
-------

- [ Configuration ](https://spatie.be/docs/laravel-pdf-go/v1/drivers/configuration)
- [ Customizing Browsershot ](https://spatie.be/docs/laravel-pdf-go/v1/drivers/customizing-browsershot)
- [ Using the Cloudflare driver ](https://spatie.be/docs/laravel-pdf-go/v1/drivers/using-the-cloudflare-driver)
- [ Using the DOMPDF driver ](https://spatie.be/docs/laravel-pdf-go/v1/drivers/using-the-dompdf-driver)
- [ Generating PDFs on AWS Lambda ](https://spatie.be/docs/laravel-pdf-go/v1/drivers/generating-pdfs-on-aws-lambda)
- [ Using the Chrome driver ](https://spatie.be/docs/laravel-pdf-go/v1/drivers/using-the-chrome-driver)
- [ Using the Gotenberg driver ](https://spatie.be/docs/laravel-pdf-go/v1/drivers/using-the-gotenberg-driver)
- [ Using the WeasyPrint driver ](https://spatie.be/docs/laravel-pdf-go/v1/drivers/using-the-weasyprint-driver)
- [ Custom drivers ](https://spatie.be/docs/laravel-pdf-go/v1/drivers/custom-drivers)

Advanced usage
--------------

- [ Creating PDFs with multiple pages ](https://spatie.be/docs/laravel-pdf-go/v1/advanced-usage/creating-pdfs-with-multiple-pages)
- [ Using Tailwind ](https://spatie.be/docs/laravel-pdf-go/v1/advanced-usage/using-tailwind)
- [ Extending with Macros ](https://spatie.be/docs/laravel-pdf-go/v1/advanced-usage/extending-with-macros)
- [ Waiting for readiness ](https://spatie.be/docs/laravel-pdf-go/v1/advanced-usage/waiting-for-readiness)
- [ Caching PDFs ](https://spatie.be/docs/laravel-pdf-go/v1/advanced-usage/caching-pdfs)

 Requirements
============

###  On this page 

1. [ DOMPDF driver ](#content-dompdf-driver)
2. [ Browsershot driver (default) ](#content-browsershot-driver-default)
3. [ Gotenberg driver ](#content-gotenberg-driver)
4. [ WeasyPrint driver ](#content-weasyprint-driver)
5. [ Cloudflare driver ](#content-cloudflare-driver)
6. [ Chrome driver ](#content-chrome-driver)

This package requires Go 1.27 or newer and Laravel Go `go.laravel.com v0.1.0`. Each driver has its own runtime requirements. Metadata and AES-256 encryption run in Go and do not need qpdf.

DOMPDF driver
-----------------------------------------------------------------------------------------------

Install PHP with the extensions required by `dompdf/dompdf`, then run `composer require dompdf/dompdf` in your application. Set `LARAVEL_PDF_DOMPDF_AUTOLOAD` to its absolute `vendor/autoload.php` path. No Go-native DOMPDF engine is implied.

Browsershot driver (default)
----------------------------------------------------------------------------------------------------------------------------------------

Install Node 22.12 or newer, Puppeteer 23 or newer and Chrome or Chromium. Run `npm install puppeteer` in your application. Browsershot Go embeds its Node runner, so no PHP runtime is needed. Remote Chrome and custom runners can replace local browser execution. The separate Chrome driver does not need Node or Puppeteer.

Gotenberg driver
--------------------------------------------------------------------------------------------------------

A running Gotenberg 8 instance is required. Go sends HTML and options to its Chromium conversion endpoint. No browser needs to be installed on the application server.

WeasyPrint driver
-----------------------------------------------------------------------------------------------------------

Install the WeasyPrint binary and its platform dependencies. There is no PHP wrapper dependency in Go. Tagged PDF support needs a WeasyPrint version with `--pdf-tags`.

Cloudflare driver
-----------------------------------------------------------------------------------------------------------

You need a Cloudflare account with Browser Run enabled and an API token with the corresponding permission. Set `CLOUDFLARE_ACCOUNT_ID` and `CLOUDFLARE_API_TOKEN`.

Chrome driver
-----------------------------------------------------------------------------------------------

Install a Chrome or Chromium executable. This driver does not need PHP or Node.js. `LARAVEL_PDF_CHROME_BINARY` selects a nonstandard executable.

Only render trusted HTML and trusted resource URLs. Browser and process drivers can execute JavaScript or fetch resources with the server's network access. Use process isolation and network restrictions for untrusted documents. Queues and caches may contain PDF content and passwords, so protect their storage and access.

 A good
match?
-------------

### What we do best

- All things Laravel
- Custom frontend components
- Building APIs
- AI-powered features
- Simplifying things
- Clean solutions
- Integrating services

### Not our cup of tea

- WordPress themes
- Cutting corners
- Free mockups to win a job
- "Just execute the briefing"

 In short: we'd like to be a **substantial part** of your project.

 [ Get in touch via email ](mailto:info@spatie.be?subject=A%20good%20match%21&body=Tell%20us%20as%20much%20as%20you%20can%20about%0A-%20your%20online%20project%0A-%20your%20planning%0A-%20your%20budget%0A-%20%E2%80%A6%0A%0AAnything%20that%20helps%20us%20to%20start%20straightforward%21)
