Requirements | laravel-pdf-rust | Spatie       

 SPATIE  

laravel-pdf-rust
================

spatie.be/open-source

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

 Version   v1      

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

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

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

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

Drivers
-------

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

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

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

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

###  On this page 

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

The package requires Rust 1.99+ and uses edition 2024.

The additional requirements depend on which driver you use:

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

The DOMPDF driver uses [dompdf/dompdf](https://github.com/dompdf/dompdf) for pure PHP PDF generation. No external rendering binaries are required. Install PHP 8.2+ and the package:

```
composer require dompdf/dompdf
```

Supply the absolute path to `vendor/autoload.php` to the PHP bridge.

Browsershot driver
--------------------------------------------------------------------------------------------------------------

The Browsershot driver uses [Browsershot](https://spatie.be/docs/browsershot) under the hood to generate PDFs. You can find the necessary requirements [here](https://spatie.be/docs/browsershot/v4/requirements). This includes Node.js and a Chrome/Chromium binary.

Select a driver explicitly. To use Browsershot, also install PHP 8.2+ and `composer require spatie/browsershot`.

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

The Gotenberg driver uses [Gotenberg](https://gotenberg.dev), an open-source Docker-based API for PDF generation. You will need:

- A running Gotenberg instance (easily started with `docker run --rm -p 3000:3000 gotenberg/gotenberg:8`)

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

The WeasyPrint driver uses [WeasyPrint](https://doc.courtbouillon.org/weasyprint/stable/), a Python-based PDF generation tool with excellent CSS Paged Media support. You will need:

- The WeasyPrint binary installed on your system ([installation guide](https://doc.courtbouillon.org/weasyprint/stable/first_steps.html))

No PHP wrapper is needed. Tagged output requires a version supporting `--pdf-tags`.

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

The Cloudflare driver uses [Cloudflare's Browser Run API](https://developers.cloudflare.com/browser-run/). This driver does not require Node.js or a Chrome binary on your server. You will need:

- A [Cloudflare account](https://dash.cloudflare.com/sign-up) with the Browser Run API enabled
- A Cloudflare API token with the appropriate permissions
- Your Cloudflare account ID

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

The Chrome driver uses the DevTools protocol to talk directly to a local Chrome or Chromium binary from Rust. You will need:

- A current Chrome/Chromium executable supporting `Page.printToPDF`.

No PHP wrapper is needed. Keep the browser sandbox enabled. Only disable it inside an already isolated worker when your platform requires it.

 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)
