The fluent API makes PDF generation as simple as returning a view.
Generate and download directly from a controller.
return Pdf::view('invoices.show') ->data(['invoice' => $invoice]) ->download('invoice.pdf');
Render with any driver and persist to S3, local, or any disk.
Pdf::view('reports.quarterly') ->driver('chromium') ->format('A4') ->save('reports/q4.pdf', 's3');
Dispatch rendering to background workers for heavy loads.
RenderPdfJob::dispatch( view: 'invoices.show', data: $invoice->toArray(), outputPath: 'inv-001.pdf', disk: 's3', );
From simple invoices to a full PDF-as-a-Service platform. All features included, all free.
6 rendering engines: Chromium, Cloudflare, Gotenberg, WeasyPrint, dompdf, wkhtmltopdf. Switch per-render.
Full CSS framework support with auto-compiled and cached CSS. Use your existing design system.
@pageBreak, @avoidBreak, @showIf, @keepTogether, @pageNumber. PDF-aware template helpers.
@barcode and @qrcode Blade directives. 10+ barcode formats. SVG output.
Merge, split, chunk, watermark, password-protect, form fill. Full post-processing pipeline.
Dispatch to Laravel queues. Batch render hundreds of PDFs. Compose multi-section documents.
Named templates with defaults, data providers, and full version history. Restore any past version.
JSON block schema to HTML compiler. Export to Blade templates. Live preview API endpoint.
Hosted rendering endpoints with API key auth, rate limiting, async jobs, usage metering, and analytics.
Multi-tenant workspaces with owner, admin, member, and viewer roles. Scope projects per workspace.
Pdf::fake() with 12 assertion methods. 367 tests. PHPStan level 6. pdf-studio:doctor diagnostics.
livewireDownload() bypasses response interception. Works with Vue, React, Node.js, vanilla JS.
From zero-dependency PHP to managed serverless Chromium. Switch drivers per-render with a single method call.
// Switch drivers per-render — no config changes needed Pdf::view('report')->driver('chromium')->download('report.pdf'); Pdf::view('report')->driver('dompdf')->download('report.pdf'); Pdf::view('report')->driver('gotenberg')->download('report.pdf');
Merge, split, watermark, protect, fill forms, embed files, inspect, and validate. All from the same fluent API.
// Merge cover + report + appendix $merged = Pdf::merge([ storage_path('cover.pdf'), Pdf::view('report')->render(), storage_path('appendix.pdf'), ]); // Watermark and protect $merged ->watermark('CONFIDENTIAL', opacity: 0.3) ->protect(ownerPassword: 'admin') ->download('final-report.pdf');
Ship a hosted PDF rendering API with workspaces, API keys, usage metering, and analytics. All included.
SHA-256 hashed keys with prefix display, expiration, and revocation. Bearer token auth on all endpoints.
Idempotent render tracking with BillableEvent dispatch. Plug into Stripe or any billing provider.
Query render stats: totals, success/failure rates, average render time, total bytes. Date range filtering.
$ curl -X POST https://app.com/api/pdf-studio/render \ -H "Authorization: Bearer sk_abc123..." \ -H "Content-Type: application/json" \ -d '{"view": "pdf.invoice", "data": {"id": 42}}' # → application/pdf download (312ms, 14.2KB)
Swap the real renderer for a test double. Assert views, drivers, downloads, merges, watermarks — 12 assertion methods.
$fake = Pdf::fake(); // ... trigger PDF generation ... $fake->assertRenderedView('invoices.show'); $fake->assertDownloaded('invoice.pdf'); $fake->assertDriverWas('chromium');
Run php artisan pdf-studio:doctor to verify PHP version, extensions, drivers, binaries, and perform a test render.
$ php artisan pdf-studio:doctor [PASS] PHP Version >= 8.1 [PASS] Memory Limit (512M) [PASS] Node.js (v22.16.0) [PASS] dompdf/dompdf installed [PASS] Test render (fake driver) All checks passed!
Run php artisan pdf-studio:install and pick exactly the features you need. No bloat, no guesswork.
Install via Composer. The service provider and Pdf facade are auto-discovered. Zero configuration required.
$ composer require sarder/pdfstudio $ php artisan pdf-studio:install