Local Blade views
Pass a view name and data to fromView(); Laravel renders the view only when the PDF request is delivered.
Render local Blade views, raw HTML, or published cloud templates with Laravel-native configuration, responses, and downloads.
composer require bladepdf/laravel
use BladePDF\Laravel\Facades\BladePDF;
return BladePDF::fromView('pdf.invoice', [
'invoice' => $invoice,
])
->format('A4')
->showBackground()
->render()
->download("invoice-{$invoice->number}.pdf");
The adapter adds Blade views, framework configuration, response helpers, and webhook integration to the shared BladePDF rendering core.
Pass a view name and data to fromView(); Laravel renders the view only when the PDF request is delivered.
Resolve referenced files from safe Laravel defaults, including public and storage/app.
Use withHeader() and withFooter() with separate local views and their own data.
Return inline responses or Unicode-safe downloads directly from controllers.
Submit stored background renders from jobs and validate signed callbacks through the Laravel wrapper.
Render published BladePDF templates with context when a document is managed outside the application release.
The package renders the Blade view locally, resolves referenced assets through Laravel-configured roots, and attaches the required files to the render request.
<!doctype html>
<html>
<head>
<link rel="stylesheet"
href="{{ asset('build/invoice.css') }}">
</head>
<body>
<img src="{{ asset('images/logo.svg') }}" alt="">
<h1>Invoice {{ $invoice->number }}</h1>
</body>
</html>
public_path() is the document root; public_path() and storage_path('app') are allowed search roots.
CSS @import and url() dependencies are followed recursively for local fonts and images.
Main, header, and footer Blade views are rendered when render() or async() captures the request.
base_path() is not allowed by default, and configured roots continue to enforce canonical path boundaries.
Add intentional application roots through the published asset_roots configuration. JavaScript imports, fetch(), runtime URLs, SVG contents, and dependencies inside SVG are not inspected.
Choose the result that matches a controller, service, command, or queued job.
response()
Return the rendered PDF as a Laravel response with the selected filename and headers.
download()
Return an attachment response with Unicode-safe filename handling.
save()
Save the PDF through the shared result object and receive a typed exception on write failure.
storePdf()->async()
Submit a stored asynchronous render for completion through a signed webhook.
The facade and factory produce the same fluent PendingRender object across Laravel entry points.
Render a Blade view and return response() or download() from a normal controller action.
Inject BladePdfFactory when document creation belongs in a dedicated application service.
Build stored asynchronous renders in Laravel jobs and handle completion through webhooks.
Generate reports and exports from scheduled Artisan commands.
Framework-specific behavior is supplied by the adapter while common rendering remains consistent across BladePDF SDKs.
Configure API access, timeouts, retries, TLS behavior, and additional asset roots through Laravel config.
The service provider registers the client, resolver, and factory and supports Laravel package auto-discovery.
Validate timestamp and signature headers from an Illuminate request while the core verifier handles HMAC validation.
Catch BladePDF\Exceptions\BladePdfException and inspect typed transport details when a render fails.
The guides cover installation, Blade views, local assets, options, delivery, async renders, webhooks, and integrations.
Install the Laravel package, configure the API key, and return a PDF from your existing application flow.
composer require bladepdf/laravel