100% Free & Open Source

Design, preview & generate PDFs in Laravel.

Use HTML, TailwindCSS, or Bootstrap to create pixel-perfect PDFs. Six rendering drivers. Full PDF manipulation. SaaS-ready API. Zero license fees.

MIT LICENSE 367+ TESTS PHPSTAN LVL 6 6 DRIVERS
// Six Rendering Engines

One API. Six drivers. Your choice.

Chromium, dompdf, wkhtmltopdf, Gotenberg, WeasyPrint, Cloudflare. Switch per-render with a single method call. No config changes.

CHROMIUM DOMPDF GOTENBERG WEASYPRINT
// Full PDF Control

Merge, split, watermark & protect.

Not just rendering. Merge documents, add watermarks, password-protect, fill forms, embed files, generate thumbnails. All from the same fluent API.

MERGE SPLIT WATERMARK ENCRYPT
// SaaS-Ready API

Build a PDF platform, not just PDFs.

Ship hosted rendering endpoints with API key auth, workspaces, RBAC, usage metering, and analytics. Everything included, nothing extra to buy.

API KEYS WORKSPACES METERING ANALYTICS
bash
$ composer require sarder/pdfstudio

Package installed successfully.

$ php artisan pdf-studio:install

  Which features would you like to install?
  [0] Chromium PDF driver
  [1] Dompdf PDF driver
  [2] PDF manipulation
  [3] Barcodes & QR codes
PHP
// Switch drivers per-render
Pdf::view('invoice')
    ->driver('chromium')
    ->download();

Pdf::view('invoice')
    ->driver('dompdf')
    ->save('inv.pdf');

Pdf::view('invoice')
    ->driver('gotenberg')
    ->stream();
PHP
// Merge, watermark & protect
Pdf::merge([
    storage_path('cover.pdf'),
    Pdf::view('report')->render(),
])
  ->watermark('CONFIDENTIAL')
  ->protect('secret')
  ->download('final.pdf');
Render API
$ curl -X POST /api/pdf-studio/render \
  -H "Authorization: Bearer sk_..." \
  -d '{"view":"invoice","data":{"id":42}}'

# 200 OK  application/pdf
# 312ms  14.2KB

$ curl /api/pdf-studio/analytics
{"total_renders": 4821, "success_rate": "99.7%"}
// Why PDF Studio?
6 rendering drivers, not just one
TailwindCSS & Bootstrap built-in
Merge, split, watermark & protect
Barcodes & QR codes in Blade
SaaS-ready API with auth & metering
100% free, MIT licensed
Compare with other packages
// How It Works

Three lines of code to your first PDF

The fluent API makes PDF generation as simple as returning a view.

Download

Generate and download directly from a controller.

return Pdf::view('invoices.show')
    ->data(['invoice' => $invoice])
    ->download('invoice.pdf');

Save to Cloud

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');

Async Queue

Dispatch rendering to background workers for heavy loads.

RenderPdfJob::dispatch(
    view: 'invoices.show',
    data: $invoice->toArray(),
    outputPath: 'inv-001.pdf',
    disk: 's3',
);
// Features

Everything you need for PDF generation

From simple invoices to a full PDF-as-a-Service platform. All features included, all free.

Multi-Driver Rendering

6 rendering engines: Chromium, Cloudflare, Gotenberg, WeasyPrint, dompdf, wkhtmltopdf. Switch per-render.

TailwindCSS & Bootstrap

Full CSS framework support with auto-compiled and cached CSS. Use your existing design system.

</>

Blade Directives

@pageBreak, @avoidBreak, @showIf, @keepTogether, @pageNumber. PDF-aware template helpers.

Barcode & QR Code

@barcode and @qrcode Blade directives. 10+ barcode formats. SVG output.

PDF Manipulation

Merge, split, chunk, watermark, password-protect, form fill. Full post-processing pipeline.

Queue & Batch Rendering

Dispatch to Laravel queues. Batch render hundreds of PDFs. Compose multi-section documents.

📂

Template Registry

Named templates with defaults, data providers, and full version history. Restore any past version.

Visual Builder

JSON block schema to HTML compiler. Export to Blade templates. Live preview API endpoint.

SaaS-Ready API

Hosted rendering endpoints with API key auth, rate limiting, async jobs, usage metering, and analytics.

Workspaces & RBAC

Multi-tenant workspaces with owner, admin, member, and viewer roles. Scope projects per workspace.

Testing & DX

Pdf::fake() with 12 assertion methods. 367 tests. PHPStan level 6. pdf-studio:doctor diagnostics.

Livewire & Filament

livewireDownload() bypasses response interception. Works with Vue, React, Node.js, vanilla JS.

// Drivers

Pick the engine that fits your stack

From zero-dependency PHP to managed serverless Chromium. Switch drivers per-render with a single method call.

dompdf
dompdf/dompdf
PHP Only Basic CSS Zero Deps
wkhtmltopdf
system binary
No Node Good CSS Legacy
Gotenberg
self-hosted service
Full CSS PDF/A Docker
WeasyPrint
system binary
PDF/A & UA Attachments Python
Cloudflare
browser rendering API
Serverless Full CSS API Key
PHP
// 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');
// PDF Manipulation

Not just rendering. Full PDF control.

Merge, split, watermark, protect, fill forms, embed files, inspect, and validate. All from the same fluent API.

  • Merge multiple PDFs with page range selection
  • Split and chunk large documents
  • Text and image watermarks with positioning
  • Password protection with permission controls
  • AcroForm field filling and flattening
  • Reorder, rotate, and remove pages
  • Embed attachments into PDFs
  • Inspect, validate, and count pages
  • Generate thumbnails from existing PDFs
PHP
// 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');
// SaaS Ready

Build a PDF platform, not just PDFs

Ship a hosted PDF rendering API with workspaces, API keys, usage metering, and analytics. All included.

API Keys & Auth

SHA-256 hashed keys with prefix display, expiration, and revocation. Bearer token auth on all endpoints.

Usage Metering

Idempotent render tracking with BillableEvent dispatch. Plug into Stripe or any billing provider.

Analytics

Query render stats: totals, success/failure rates, average render time, total bytes. Date range filtering.

Render API
$ 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)
// Developer Experience

Built for teams that test their code

1

Test with PdfFake

Swap the real renderer for a test double. Assert views, drivers, downloads, merges, watermarks — 12 assertion methods.

PHP
$fake = Pdf::fake();

// ... trigger PDF generation ...

$fake->assertRenderedView('invoices.show');
$fake->assertDownloaded('invoice.pdf');
$fake->assertDriverWas('chromium');
2

Diagnose with Doctor

Run php artisan pdf-studio:doctor to verify PHP version, extensions, drivers, binaries, and perform a test render.

bash
$ 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!
3

Interactive Installer

Run php artisan pdf-studio:install and pick exactly the features you need. No bloat, no guesswork.

367+
Tests Passing
6
PDF Drivers
121
PHP Files
Level 6
PHPStan

Get started in 30 seconds

Install via Composer. The service provider and Pdf facade are auto-discovered. Zero configuration required.

bash
$ composer require sarder/pdfstudio
$ php artisan pdf-studio:install