Download the PHP package bladepdf/spatie-laravel-pdf-driver without Composer
On this page you can find all versions of the php package bladepdf/spatie-laravel-pdf-driver. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bladepdf/spatie-laravel-pdf-driver
More information about bladepdf/spatie-laravel-pdf-driver
Files in bladepdf/spatie-laravel-pdf-driver
Package spatie-laravel-pdf-driver
Short Description Use BladePDF as a managed Chromium driver for Spatie Laravel PDF.
License MIT
Homepage https://bladepdf.com
Informations about the package spatie-laravel-pdf-driver
BladePDF driver for Spatie Laravel PDF
Use BladePDF's managed Chromium rendering without changing the familiar Spatie\LaravelPdf\Facades\Pdf API.
This package registers BladePDF as a custom driver for Spatie Laravel PDF. Existing Blade views are rendered by Spatie and sent through the BladePDF Laravel asset pipeline to managed Chromium.
Requirements
- PHP 8.2 or newer
- Laravel 11, 12, or 13
- Spatie Laravel PDF 2.10 or newer
- A BladePDF API key
Installation
Add your BladePDF API key:
Laravel package auto-discovery registers both the BladePDF client and the Spatie driver.
Use BladePDF for one PDF
Make BladePDF the default driver
Existing Spatie Laravel PDF calls then use BladePDF without calling driver():
Supported Spatie features
| Spatie Laravel PDF feature | BladePDF behavior |
|---|---|
view() and html() |
Rendered HTML is sent through the BladePDF asset pipeline |
headerView() / headerHtml() |
Forwarded as Chromium header HTML |
footerView() / footerHtml() |
Forwarded as Chromium footer HTML |
format() |
Forwarded to BladePDF |
paperSize() |
Forwarded; custom dimensions take precedence over format() |
margins() |
Forwarded with the selected unit |
landscape() / portrait() |
Forwarded |
scale() |
Forwarded |
pageRanges() |
Forwarded |
tagged() |
Forwarded |
waitUntilReady() |
The readiness expression is forwarded |
meta() |
Applied by Spatie after BladePDF returns the PDF |
encrypt() |
Applied by Spatie after BladePDF returns the PDF |
cache() |
Uses Spatie's cache layer |
disk() and saveQueued() |
Uses Spatie's storage and queue flow |
BladePDF always enables printed backgrounds through this driver, matching Spatie's Chromium drivers.
Readiness timeout
BladePDF supports the JavaScript expression passed to waitUntilReady(), but its API does not accept Spatie's optional per-expression timeout. This works:
Passing the second timeout argument throws UnsupportedReadinessTimeoutException instead of silently ignoring it. Configure BladePDF's HTTP timeout and your plan's render timeout when a longer render window is required.
Native BladePDF features
The Spatie driver is a compatibility layer. Use the native BladePDF:: facade when you need cloud templates, request-scoped asset overrides, BladePDF references, stored PDFs, webhooks, or BladePDF's native asynchronous render API.
See the full integration guide.
Testing
Spatie's Pdf::fake() continues to work because it fakes the builder before a driver is invoked. For driver-level tests, bind a fake implementation of BladePDF\Contracts\RenderClient; the immutable BladePDF\RenderRequest then exposes the exact core request produced by the integration.
Run this package's test suite with:
Upgrading from 1.x
Driver 2.x requires bladepdf/laravel:^2.0; driver 1.x remains paired with the Laravel package's 1.x line. Normal Spatie calls, the bladepdf driver name, option mapping, and readiness behavior do not change.
The driver still depends only on BladePdfFactory. It does not construct the core client or asset resolver, so published Laravel asset roots apply equally to native facade and Spatie renders.
License
The MIT License. See LICENSE.