Download the PHP package sarder/pdfstudio without Composer
On this page you can find all versions of the php package sarder/pdfstudio. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package pdfstudio
PDF Studio for Laravel
Design, preview, and generate PDFs using HTML and TailwindCSS in Laravel.
Free and open source. All features — including template versioning, workspaces, the visual builder, and the hosted rendering API — are available under the MIT license with no key, subscription, or license fee required.
📖 Full User Guide — detailed examples, page layouts, framework integrations (Livewire, Vue, React, Node.js, vanilla JS), and troubleshooting.
Table of Contents
- Requirements
- Installation
- Quick Start
- Drivers
- Template Registry
- Blade Directives
- Queue / Async Rendering
- Preview Routes
- Tailwind CSS
- Template Versioning
- Workspaces & Access Control
- Visual Builder
- SaaS: Hosted Rendering API
- SaaS: Usage Metering
- SaaS: Analytics
- PDF Merging
- PDF Post-Processing
- Watermarking
- Password Protection
- AcroForm Fill
- Livewire / Filament
- Render Caching
- Auto-Height Paper
- Header/Footer Per-Page Control
- Dependency Installer
- Diagnostics
- Configuration Reference
- Testing
Requirements
- PHP >= 8.2
- Laravel 11.x, 12.x, or 13.x
Optional Dependencies
| Driver | Package | Required For |
|---|---|---|
| Chromium | spatie/browsershot ^5.2 |
Full CSS/TailwindCSS fidelity (recommended) |
| Cloudflare | Cloudflare Browser Rendering | Managed remote Chromium rendering |
| Gotenberg | Self-hosted Gotenberg service | Remote/self-hosted Chromium rendering |
| WeasyPrint | System weasyprint binary |
Print-native rendering, attachments, PDF variants |
| dompdf | dompdf/dompdf ^2.0|^3.0 |
Zero external dependencies, limited CSS |
| wkhtmltopdf | System binary | Good CSS fidelity, no Node.js needed |
PDF Manipulation (optional):
| Package | Required For |
|---|---|
setasign/fpdi ^2.3 |
PDF merging, watermarking |
mikehaertl/php-pdftk ^4.0 |
AcroForm fill, password protection |
Note: The Chromium driver requires Node.js and a Chromium/Chrome binary on the server.
Installation
Publish the config file:
Install optional dependencies for the features you need:
Or install them individually:
Note: PDF thumbnail generation also requires the
imagickPHP extension, which must be installed separately (not via Composer).
If you're using Pro or SaaS features, publish and run migrations:
Quick Start
The Pdf facade is auto-discovered. No manual registration needed.
Drivers
Detailed driver selection and troubleshooting guide:
- Driver Guide
- Existing PDF Workflows
| Driver | Runtime | Node | CSS Fidelity | Best For |
|---|---|---|---|---|
chromium (default) |
Local Chrome + Browsershot | Yes | Full | High-fidelity local rendering |
cloudflare |
Cloudflare Browser Rendering | No local Node | Full | Managed remote rendering |
gotenberg |
Remote Gotenberg service | No local Node | Full | Self-hosted remote rendering |
weasyprint |
System weasyprint binary |
No | Print-native | Tagged PDFs, attachments, PDF variants |
wkhtmltopdf |
System binary | No | Good | Legacy compatibility |
dompdf |
dompdf/dompdf |
No | Limited | Zero external services |
fake |
Built-in | No | N/A | Testing only |
Install your preferred driver:
Set the default in config:
Switch per-render:
Remote driver examples:
Cloudflare config:
Gotenberg config:
WeasyPrint config:
Modern Render Options
Template Registry
Register named templates with default options and data providers:
Use a registered template:
List all registered templates:
Blade Directives
Queue / Async Rendering
Dispatch a render job to a queue:
Batch rendering:
Compose multiple sections independently and merge them into one PDF:
Preview Routes
Enable browser-based template preview (disabled in production by default):
Visit:
GET /pdf-studio/preview/{template}?format=html— HTML previewGET /pdf-studio/preview/{template}?format=pdf— PDF preview
Tailwind CSS
Point PDF Studio at your Tailwind binary and config:
Compiled CSS is cached automatically. Clear the cache:
Fonts & Assets
Register local fonts once and PDF Studio will embed them as generated @font-face CSS during rendering:
Asset policy can inline local assets and optionally block remote ones up front:
This helps avoid renderer-specific failures around local file paths, missing images, font files, or remote asset fetches. The resolver covers:
<img src="..."><link rel="stylesheet" href="...">- CSS
url(...)references inside linked stylesheets - CSS
url(...)references inside inline<style>blocks
Template Versioning
Requires: migrations (
php artisan vendor:publish --tag=pdf-studio-migrations && php artisan migrate).
Save a snapshot of a template definition at any point:
Workspaces & Access Control
Requires: migrations (
php artisan vendor:publish --tag=pdf-studio-migrations && php artisan migrate).
Scope projects to a workspace:
Visual Builder
Requires:
pdf-studio.preview.enabled = true
The visual builder lets you define document layouts as a JSON schema of typed blocks, preview them as HTML, and export them to Blade templates.
Block Schema
Compile to HTML
Export to Blade
Live Preview API
SaaS: Hosted Rendering API
Requires:
PDF_STUDIO_SAAS=truein.envand migrations.
Enable in .env:
Issue an API Key
Revoke a key:
Render Endpoints
All endpoints require:
Sync — immediate PDF response:
With a Blade view and options:
Async — queue a render job:
Poll job status:
Status values: pending | completed | failed
SaaS: Usage Metering
Record usage events with idempotency (safe to call multiple times for the same job):
Each recordRender call dispatches a BillableEvent. Hook into it to integrate your billing provider:
Query raw usage:
SaaS: Analytics
Query render stats for a workspace over a date range:
PDF Merging
Merge multiple PDFs into a single document. Requires setasign/fpdi.
PDF Post-Processing
Detailed guide:
- Existing PDF Workflows
Operate on existing PDF bytes after rendering or on PDFs produced outside PDF Studio:
isPdf() and isPdfFile() provide a cheap preflight check before queueing or manipulating uploaded content. inspectPdf() and inspectPdfFile() provide a combined summary with validity, page-count information when available, and byte_size for transport/storage planning. readPdfMetadata() / readPdfMetadataFile() extract basic document-info metadata. assertPdf() and assertPdfFile() provide a fail-fast validation path when invalid input should stop the workflow immediately. pageCount() and pageCountFile() return integers. chunkRanges() / chunkRangesFile() return plain page-range strings. chunkPlan() / chunkPlanFile() return structured planning metadata per chunk. split(), chunk(), chunkFile(), reorderPages(), rotatePages(), and removePages() handle staged page editing. flattenPdf() / flattenPdfFile() and embedFiles() / embedFilesIntoFile() return a single PdfResult.
Watermarking
Add text or image watermarks to rendered PDFs. Requires setasign/fpdi.
Password Protection
Protect PDFs with user/owner passwords. Requires mikehaertl/php-pdftk.
AcroForm Fill
Fill PDF form fields programmatically. Requires mikehaertl/php-pdftk.
Livewire / Filament
Download PDFs from Livewire components without Livewire intercepting the response:
Get base64 content for embedding:
Render Caching
Cache rendered PDFs to avoid re-rendering identical content:
Configure defaults in config:
Clear render cache:
Auto-Height Paper
Automatically size the paper height to fit content (no page breaks):
Supported by all drivers (Chromium, dompdf, wkhtmltopdf).
Header/Footer Per-Page Control
Control header and footer visibility on specific pages (Chromium and wkhtmltopdf):
Dependency Installer
Install optional dependencies interactively or all at once:
The command automatically skips packages that are already installed and shows real-time Composer output. After installation it reminds you about the imagick PHP extension if it's missing.
| Feature | Package |
|---|---|
| Chromium PDF driver | spatie/browsershot |
| Dompdf PDF driver | dompdf/dompdf |
| PDF manipulation (merge, watermark, split) | setasign/fpdi |
| Form filling & password protection | mikehaertl/php-pdftk |
Barcodes (@barcode directive) |
picqer/php-barcode-generator |
QR codes (@qrcode directive) |
chillerlan/php-qrcode |
Diagnostics
Run a health check on your PDF Studio installation:
Checks:
- PHP version and memory limit
- DOM/XML extension
- temporary directory writability
- current default driver
- Node.js
- Cloudflare credential presence
- Gotenberg endpoint configuration and reachability when selected
- WeasyPrint availability
- dompdf, wkhtmltopdf, pdftk, FPDI, and Tailwind binary
- configured custom font paths
- asset policy summary
- a fake render pass
Configuration Reference
Testing
PdfFake (Testing Assertions)
Use Pdf::fake() in tests for fluent assertions without real PDF rendering:
Or use the fake driver directly:
Documentation
The README covers the full API surface. For deeper guidance see the User Guide, which includes:
- Page layout examples (paper sizes, margins, headers/footers, multi-column)
- Framework integration guides — Livewire, Vue 3, React, Node.js, vanilla JavaScript
- Troubleshooting — Tailwind class issues, image paths, custom fonts, page breaks, driver differences
License
MIT — see LICENSE.
All versions of pdfstudio with dependencies
illuminate/contracts Version ^11.0|^12.0
illuminate/database Version ^11.0|^12.0
illuminate/support Version ^11.0|^12.0