Laravel-native source
Use fromView() with normal Blade data, fromHtml() with prepared markup, or fromTemplate() for dashboard-managed documents.
Call a Laravel-native facade, keep your existing views, and let a managed Chromium API handle assets, render capacity, storage, logs, and async delivery.
return BladePDF::fromView('pdf.invoice', [
'invoice' => $invoice,
])
->reference($invoice->uuid)
->format('A4')
->showBackground()
->render()
->download("invoice-{$invoice->number}.pdf");
A production Laravel PDF flow starts before Chromium receives HTML. Blade must render with application data, private images and fonts must reach the renderer, errors need a request id, and long-running documents need a delivery path that does not keep a web request open.
BladePDF’s Laravel package covers that full boundary. It renders local views, resolves their assets, builds the API request, returns typed results, and connects the render to logs, storage, and signed events.
Use fromView() with normal Blade data, fromHtml() with prepared markup, or fromTemplate() for dashboard-managed documents.
Return an inline response, force a download, save locally, access raw bytes, or submit a stored async render.
Correlate request ids with render history, timing metrics, failures, stored files, and webhook delivery attempts.
The synchronous flow is suitable for downloads and inline previews. Use the async flow when the result should be stored and delivered after acceptance.
composer require bladepdf/laravel
BLADEPDF_API_KEY=blpdf_...
return BladePDF::fromView('pdf.invoice', [
'invoice' => $invoice,
])
->templateName('Invoice')
->reference($invoice->uuid)
->format('A4')
->showBackground()
->render()
->download("invoice-{$invoice->number}.pdf");
$submission = BladePDF::fromView('pdf.invoice', $data)
->reference($invoice->uuid)
->storePdf()
->webhook(
route('webhooks.bladepdf'),
config('bladepdf.webhook_secret'),
)
->async();
storePdf() because no PDF bytes are returned in the acceptance response. The request can still wait for an available concurrency slot before it receives 202 Accepted.
Both self-hosted and hosted approaches can be correct. The key question is whether browser operations and delivery workflows belong inside your application platform.
Use Browsershot, a Spatie self-hosted driver, Gotenberg, DOMPDF, or another renderer when infrastructure control and data locality are the priority.
Use BladePDF when the Laravel team wants a narrow API boundary and a managed document workflow around Chromium.
The package keeps application rendering local while making the result portable to managed Chromium.
Models and application objects stay in your code. The package renders the selected view into HTML before sending the render request.
Local src, href, srcset, CSS url(), @import, and font references are discovered, attached, and rewritten to asset:/// URLs.
Wait for PDF bytes synchronously, or store the output and handle completion through a signed asynchronous event.
Both modes use the same render options and managed capacity. They differ in when your application receives control and where the finished file lives.
| Capability | Synchronous render | Asynchronous render |
|---|---|---|
| Best for | Downloads, inline previews, immediate controller responses | Large documents, background workflows, post-render delivery |
| Finish method | render() |
storePdf()->async() |
| Initial result | RenderResult with PDF bytes |
RenderSubmission with request id and reference |
| PDF storage | Optional | Required |
| Completion | The HTTP call returns after generation | A pdf.rendered or pdf.failed event is recorded after acceptance |
| Delivery | response(), download(), save(), bytes, or base64 |
Stored file, signed URL, dashboard endpoint, or per-request webhook |
| Capacity | Uses a concurrency slot and can queue | Uses the same capacity and can wait before acceptance |
Native async is not a way around plan capacity. It lets the application stop waiting after the render has been validated and accepted for background processing.
BladePDF:: facade, renders local Blade views, resolves assets, maps options, and returns Laravel-friendly result objects. A documented REST endpoint is available for other languages.asset:/// URLs before Chromium runs. External URLs are preserved when plan and network settings allow them.async() when the application should continue after a render is accepted rather than waiting for the PDF. Async requires storePdf() and should be paired with a dashboard webhook or per-request signed webhook.bladepdf/laravel package is recommended for Laravel apps because it handles Blade rendering, local asset discovery, request construction, and typed responses.Start synchronously, then add storage or async delivery only when the workflow needs it.