PHPackages                             patressz/laravel-pdf - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. patressz/laravel-pdf

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

patressz/laravel-pdf
====================

A Laravel package for generating PDF using playwright.

v0.6.0(9mo ago)1233MITPHPPHP ^8.3.0|^8.4.0CI failing

Since Jul 23Pushed 4mo agoCompare

[ Source](https://github.com/patressz/laravel-pdf)[ Packagist](https://packagist.org/packages/patressz/laravel-pdf)[ RSS](/packages/patressz-laravel-pdf/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (10)Versions (7)Used By (0)

Laravel PDF Generator
=====================

[](#laravel-pdf-generator)

[![Tests](https://github.com/patressz/laravel-pdf/actions/workflows/tests.yml/badge.svg)](https://github.com/patressz/laravel-pdf/actions/workflows/tests.yml)

A modern PHP package for generating PDFs from HTML using Playwright in Laravel applications.

Features
--------

[](#features)

- 🚀 Generate PDFs from Blade views or raw HTML
- 📄 Multiple PDF formats (A0-A6, Letter, Legal, Tabloid, Ledger) - defaults to A4
- 📐 Custom dimensions with flexible units (mm, cm, in, px)
- 🎨 Full CSS support with Playwright rendering
- 🖼️ Print background graphics and images
- 📑 Header and footer templates with dynamic content
- 🔄 Landscape and portrait orientations
- 📏 Configurable margins with multiple units
- 🔍 Scale factor control (0.1-2.0)
- 📖 Tagged (accessible) PDF generation
- 📄 Page range selection
- 💾 Save to file or return as base64/binary
- 📥 Direct download response
- 🔧 Configurable Node.js binary path
- ✂️ Convenient Blade directives for page breaks and numbering
- 🧩 Extensible with custom macros and conditional methods

Requirements
------------

[](#requirements)

- PHP 8.3+ or 8.4+
- Laravel 12.0+
- Node.js 18+
- Yarn or NPM

Installation
------------

[](#installation)

1. Install the package via Composer:

```
composer require patressz/laravel-pdf
```

2. Install Node.js dependencies:

```
yarn install
# or
npm install
```

3. Install Playwright browser:

```
yarn playwright install chromium --with-deps
# or
npx playwright install chromium --with-deps
```

Usage
-----

[](#usage)

### Basic PDF Generation

[](#basic-pdf-generation)

```
use Patressz\LaravelPdf\Facades\Pdf;

// Generate PDF from Blade view
$pdf = Pdf::view('invoice', ['user' => $user])
    ->format('A4')
    ->save('invoice.pdf');

// Generate PDF from raw HTML
$pdf = Pdf::html('Hello WorldThis is a PDF.')
    ->format('A4')
    ->save('document.pdf');
```

### Generating PDF from URL

[](#generating-pdf-from-url)

You can generate a PDF directly from a public URL (e.g., an external website):

```
use Patressz\LaravelPdf\Facades\Pdf;

// Generate PDF from a URL
$pdf = Pdf::fromUrl('https://example.com/invoice/123')
    ->format('A4')
    ->save('invoice.pdf');

// Download PDF generated from a URL
return Pdf::fromUrl('https://example.com/invoice/123')
    ->format('A4')
    ->download('invoice.pdf');
```

> The URL must start with `http://` or `https://`. If the URL is invalid, an `InvalidArgumentException` will be thrown.

### Download PDF response

[](#download-pdf-response)

```
// Direct download
return Pdf::view('invoice', ['user' => $user])
    ->format('A4')
    ->download('invoice.pdf');
```

### Inline PDF response

[](#inline-pdf-response)

```
// Display in browser
return Pdf::view('invoice', ['user' => $user])
    ->format('A4')
    ->inline('invoice.pdf');
```

### Base64 output

[](#base64-output)

```
// Get PDF as base64 string
$base64 = Pdf::view('invoice', ['user' => $user])
    ->format('A4')
    ->base64();
```

### Binary output

[](#binary-output)

```
// Get PDF as binary string
$binaryPdf = Pdf::view('invoice', ['user' => $user])
    ->format('A4')
    ->raw();
```

Advanced configuration
----------------------

[](#advanced-configuration)

### Page dimensions and orientation

[](#page-dimensions-and-orientation)

```
use Patressz\LaravelPdf\Enums\Format;
use Patressz\LaravelPdf\Enums\Unit;
use Patressz\LaravelPdf\Facades\Pdf;

// Set custom width and height
$pdf = Pdf::view('document')
    ->width(210, Unit::Millimeter)  // or ->width(210, 'mm')
    ->height(297, Unit::Millimeter) // or ->height(297, 'mm')
    ->save('document.pdf');

// Set landscape orientation
$pdf = Pdf::view('document')
    ->format(Format::A4)
    ->landscape()
    ->save('document.pdf');
```

### Margins

[](#margins)

```
// Set margins (top, right, bottom, left)
$pdf = Pdf::view('document')
    ->margins(20, 15, 20, 15, Unit::Millimeter)  // All sides
    ->save('document.pdf');

// Available units: mm, cm, in, px
$pdf = Pdf::view('document')
    ->margins(0.8, 0.6, 0.8, 0.6, Unit::Inch)
    ->save('document.pdf');
```

### Headers and Footers

[](#headers-and-footers)

```
// Add header template
$pdf = Pdf::view('document')
    ->headerTemplate('Page  of ')
    ->save('document.pdf');

// Add footer template
$pdf = Pdf::view('document')
    ->footerTemplate('Generated on ')
    ->save('document.pdf');

// Using Blade views for headers/footers
$pdf = Pdf::view('document')
    ->headerTemplate(view('pdf.header'))
    ->footerTemplate(view('pdf.footer'))
    ->save('document.pdf');
```

### Blade directives

[](#blade-directives)

Laravel PDF provides convenient Blade directives for PDF generation:

```
// In your header/footer templates
{{-- Header template with page numbering --}}

    Page @pageNumber of @totalPages

// In your main document content
{{-- Page break in main content --}}

    First page content

@pageBreak

    Second page content

```

**header/footer template limitations:**

- Script tags inside templates are not evaluated (no JavaScript)
- Page styles are not visible inside templates (use inline styles)
- Only `@pageNumber` and `@totalPages` directives work in templates
- Main content can use JavaScript and `@pageBreak` directive

**Example usage in header/footer templates:**

```
// resources/views/pdf/header.blade.php

    {{ $company ?? 'Company Name' }}
    Page @pageNumber of @totalPages

// resources/views/pdf/footer.blade.php

    Generated on {{ now()->format('Y-m-d H:i:s') }} | Page @pageNumber

// Using the Pdf facade
Pdf::view('invoice', $data)
    ->headerTemplate(view('pdf.header', ['company' => 'ACME Corp']))
    ->footerTemplate(view('pdf.footer'))
    ->save('invoice.pdf');
```

**Example usage in main document content:**

```
{{-- resources/views/document.blade.php --}}
>

    Multi-page Document

        // JavaScript works in main content
        document.addEventListener('DOMContentLoaded', function() {
            // Replace placeholder text with current date
            const placeholder = document.getElementById('current-date');
            if (placeholder) {
                placeholder.textContent = new Date().toLocaleDateString();
            }
        });

        First Section
        Generated on: [DATE_PLACEHOLDER]
        Content for the first page...

    {{-- Force page break using directive --}}
    @pageBreak

        Second Section
        Content for the second page...

    @pageBreak

        Third Section
        Content for the third page...

```

### Print options

[](#print-options)

```
$pdf = Pdf::view('document')
    ->printBackground()        // Include background graphics
    ->scale(1.2)              // Scale factor (0.1 - 2.0)
    ->tagged()                // Generate tagged (accessible) PDF
    ->outline()               // Embed document outline
    ->preferCSSPageSize()     // Prefer CSS @page size over format
    ->pageRanges('1-5,8,11-13') // Print specific page ranges
    ->save('document.pdf');
```

Available formats
-----------------

[](#available-formats)

The default format is `A4`. You can specify format using either string or enum:

**Available formats:**

- `A0`, `A1`, `A2`, `A3`, `A4`, `A5`, `A6`
- `Letter`, `Legal`, `Tabloid`, `Ledger`

**Available units for dimensions and margins:**

- `mm` (millimeters) - default
- `cm` (centimeters)
- `in` (inches)
- `px` (pixels)

```
use Patressz\LaravelPdf\Enums\Format;
use Patressz\LaravelPdf\Enums\Unit;
use Patressz\LaravelPdf\Facades\Pdf;

// Using enum (recommended)
$pdf = Pdf::view('document')
    ->format(Format::A4)
    ->save('document.pdf');

// Using string
$pdf = Pdf::view('document')
    ->format('A4')
    ->save('document.pdf');

// Default format (A4) - no need to specify
$pdf = Pdf::view('document')
    ->save('document.pdf');
```

Configuration
-------------

[](#configuration)

### Download filename

[](#download-filename)

```
// Set custom filename for downloads
$pdf = Pdf::view('document')
    ->name('my-custom-document.pdf')  // .pdf extension is optional
    ->download();

// Or specify filename in download method
$pdf = Pdf::view('document')
    ->download('invoice-2023.pdf');
```

### Custom Node.js binary path

[](#custom-nodejs-binary-path)

```
$pdf = Pdf::setNodeBinaryPath('/custom/path/to/node')
    ->view('document')
    ->save('document.pdf');
```

### Custom response headers

[](#custom-response-headers)

```
$pdf = Pdf::view('document')
    ->addHeaders([
        'Cache-Control' => 'no-cache',
        'X-Custom-Header' => 'value'
    ])
    ->save('document.pdf');
```

Examples
--------

[](#examples)

### Invoice generation

[](#invoice-generation)

```
// resources/views/invoice.blade.php
DOCTYPE html>

    Invoice #{{ $invoice->number }}

        body { font-family: Arial, sans-serif; margin: 20px; }
        .header { text-align: center; margin-bottom: 30px; }
        .invoice-details { margin: 20px 0; }
        .items { margin: 20px 0; }
        .item { padding: 5px 0; border-bottom: 1px solid #eee; }

        Invoice #{{ $invoice->number }}

        Date: {{ $invoice->date }}
        Customer: {{ $invoice->customer->name }}

        Invoice Items
        @foreach($invoice->items as $item)

                {{ $item->description }} - ${{ $item->amount }}

        @endforeach

    {{-- Use @pageBreak directive for page breaks --}}
    @if($invoice->hasAdditionalPages)
        @pageBreak

            {{-- Additional invoice content --}}

    @endif

{{-- resources/views/pdf/invoice-header.blade.php --}}

    {{ $company ?? 'Your Company' }}
    Invoice #{{ $invoice->number }} | Page @pageNumber of @totalPages

{{-- resources/views/pdf/invoice-footer.blade.php --}}

    Generated on {{ now()->format('Y-m-d H:i:s') }} | Page @pageNumber of @totalPages

```

```
// Controller
public function downloadInvoice(Invoice $invoice)
{
    return Pdf::view('invoice', compact('invoice'))
        ->format('A4')
        ->margins(20, 15, 20, 15) // 20mm top/bottom, 15mm left/right
        ->printBackground()       // Include background colors/images
        ->headerTemplate(view('pdf.invoice-header', compact('invoice')))
        ->footerTemplate(view('pdf.invoice-footer', compact('invoice')))
        ->download("invoice-{$invoice->number}.pdf");
}

public function generateReport()
{
    return Pdf::view('reports.monthly')
        ->format('A4')
        ->landscape()
        ->margins(15, 10, 15, 10)
        ->scale(0.8)  // Reduce scale to fit more content
        ->save(storage_path('reports/monthly-report.pdf'));
}
```

Method chaining
---------------

[](#method-chaining)

All configuration methods return the `PdfBuilder` instance, allowing for fluent method chaining through the `Pdf` facade:

```
use Patressz\LaravelPdf\Facades\Pdf;

return Pdf::view('complex-document', $data)
    ->format(Format::A4)
    ->landscape()
    ->margins(25, 20, 25, 20, Unit::Millimeter)
    ->printBackground()
    ->scale(1.1)
    ->headerTemplate('Company Header')
    ->footerTemplate('Page ')
    ->name('complex-document.pdf')
    ->download();
```

Conditional methods
-------------------

[](#conditional-methods)

The underlying `PdfBuilder` class includes Laravel's `Conditionable` trait, which you can access through the `Pdf` facade to conditionally apply methods:

```
$pdf = Pdf::view('document', $data)
    ->when($user->isPremium(), function ($pdf) {
        return $pdf->headerTemplate(view('pdf.premium-header'));
    })
    ->when($includeFooter, fn($pdf) => $pdf->footerTemplate(view('pdf.footer')))
    ->unless($isPreview, fn($pdf) => $pdf->printBackground())
    ->format(Format::A4)
    ->save('document.pdf');
```

**Available conditional methods:**

- `when($condition, $callback, $default = null)` - Execute callback when condition is true
- `unless($condition, $callback, $default = null)` - Execute callback when condition is false

Custom macros
-------------

[](#custom-macros)

The `PdfBuilder` class includes Laravel's `Macroable` trait, allowing you to extend its functionality with custom methods. Both the real `PdfBuilder` and the `FakePdfBuilder` (used in testing) support macros:

```
use Patressz\LaravelPdf\Facades\Pdf;

// Define a custom macro in a service provider using the facade
Pdf::macro('invoice', function (Invoice $invoice) {
    return $this->view('pdf.invoice', compact('invoice'))
        ->format('A4')
        ->margins(20, 15, 20, 15)
        ->headerTemplate(view('pdf.invoice-header', compact('invoice')))
        ->footerTemplate(view('pdf.invoice-footer'));
});

// Use the macro
$pdf = Pdf::invoice($invoice)->download("invoice-{$invoice->number}.pdf");
```

**Note:** Macros can be defined using either `Pdf::macro()` facade method or directly on the `PdfBuilder` class. Both approaches make the macros available through the `Pdf` facade and work seamlessly with both production code and testing (when using `Pdf::fake()`).

Troubleshooting
---------------

[](#troubleshooting)

### Node.js not found

[](#nodejs-not-found)

If you encounter "Node.js binary not found" errors:

```
// Set custom Node.js path
$pdf = Pdf::setNodeBinaryPath('/usr/local/bin/node')  // or your custom path
    ->view('document')
    ->save('document.pdf');
```

### Memory issues

[](#memory-issues)

For large documents, consider:

- Using `pageRanges()` to process documents in chunks
- Reducing image sizes in your HTML
- Optimizing CSS and avoiding complex layouts

### CSS issues

[](#css-issues)

- Ensure all CSS is inline or included in `` tags
- Use absolute paths for images and assets
- Test with `printBackground()` if backgrounds aren't showing

### JavaScript and Header/Footer limitations

[](#javascript-and-headerfooter-limitations)

**JavaScript support:**

- ✅ JavaScript works in main document content
- ❌ JavaScript is **not executed** in `headerTemplate()` and `footerTemplate()`
- ❌ Page styles are **not visible** in header/footer templates (use inline styles only)

```
// ✅ Works - JavaScript in main content
Pdf::html('

        document.addEventListener("DOMContentLoaded", function() {
            document.getElementById("status").textContent = "Generated successfully";
        });

    Document
    Status: Loading...
')
->save('document.pdf');

// ❌ Won't work - JavaScript in header template
Pdf::view('document')
    ->headerTemplate('document.write("This won\'t work");Header')
    ->save('document.pdf');
```

API Reference
-------------

[](#api-reference)

### Content methods

[](#content-methods)

MethodParametersDescription`view()``string $view, array $data = []`Render Blade view as PDF content`html()``string $html`Set raw HTML content (takes precedence over view)`fromUrl()``string $url`Generate PDF from a public URL (must start with http:// or https://)### Template methods

[](#template-methods)

MethodParametersDescription`headerTemplate()``string|View $template`Set header template with special classes`footerTemplate()``string|View $template`Set footer template with special classes### Format &amp; dimensions

[](#format--dimensions)

MethodParametersDescription`format()``string|Format $format`Set paper format (A0-A6, Letter, Legal, etc.)`width()``float $width, Unit|string $unit = 'mm'`Set custom width`height()``float $height, Unit|string $unit = 'mm'`Set custom height`landscape()`-Set landscape orientation`margins()``float $top, float $right, float $bottom, float $left, Unit|string $unit = 'mm'`Set page margins### Print options

[](#print-options-1)

MethodParametersDescription`printBackground()`-Include background graphics and colors`displayHeaderFooter()`-Enable header/footer display (auto-enabled by templates)`scale()``float $scale`Set scale factor (0.1 - 2.0)`tagged()`-Generate tagged (accessible) PDF`outline()`-Embed document outline`preferCSSPageSize()`-Prefer CSS @page size over format options`pageRanges()``string $ranges`Print specific pages (e.g., '1-5,8,11-13')### Output methods

[](#output-methods)

MethodParametersDescription`save()``string $outputPath`Save PDF to file and return path`download()``string $filename = 'document.pdf'`Set download headers for attachment`inline()``string $filename = 'document.pdf'`Set inline headers for browser display`base64()`-Return PDF as base64 string`raw()`-Return PDF as binary string`toResponse()``$request`Return as HTTP response (Responsable interface)### Configuration methods

[](#configuration-methods)

MethodParametersDescription`name()``string $filename`Set download filename`setNodeBinaryPath()``string $path`Set custom Node.js binary path`addHeaders()``array $headers`Add custom response headers### Extension methods

[](#extension-methods)

MethodParametersDescription`when()``mixed $condition, callable $callback, callable|null $default`Execute callback when condition is true`unless()``mixed $condition, callable $callback, callable|null $default`Execute callback when condition is false`macro()``string $name, callable $macro`**Static method** - Register a custom macro`mixin()``object $mixin, bool $replace = true`**Static method** - Mix another object into the class`hasMacro()``string $name`**Static method** - Check if macro exists`flushMacros()`-**Static method** - Remove all macros### Blade directives

[](#blade-directives-1)

DirectiveOutputDescription`@pageNumber```Current page number (header/footer only)`@totalPages```Total pages count (header/footer only)`@pageBreak```Force page break (main content only)**Note:** `@pageNumber` and `@totalPages` only work in `headerTemplate()` and `footerTemplate()` views. `@pageBreak` only works in main document content. Header/footer templates have limitations: no JavaScript execution and no access to page styles.

### Testing PDF generation in your application

[](#testing-pdf-generation-in-your-application)

Laravel PDF provides a fake implementation for testing without actually generating PDFs:

```
use Patressz\LaravelPdf\Facades\Pdf;
use Illuminate\View\View;

it('can download invoice', function () {
    // Fake the PDF generation
    Pdf::fake();

    $invoice = Invoice::factory()->create();

    $response = $this->get("/invoices/{$invoice->id}/download");

    $response->assertSuccessful();

    // Assert PDF was generated with correct view and data
    Pdf::assertView('invoice', function (View $view, array $data) use ($invoice): bool {
        return $data['invoice']->id === $invoice->id;
    });

    // Assert PDF configuration
    Pdf::assertFormat('A4');
    Pdf::assertMargins(20, 15, 20, 15, 'mm');
    Pdf::assertPrintBackground();
    Pdf::assertDownloaded();
});
```

### Available test assertions

[](#available-test-assertions)

The fake PDF implementation provides comprehensive assertions:

```
// Content assertions
Pdf::assertUrl('https://www.example.com');
Pdf::assertView('invoice'); // Assert specific view was used
Pdf::assertView('invoice', function (View $view, array $data): bool {
    // Callback receives View object and data array
    return $data['invoice']->total > 100;
});
Pdf::assertHtml('Test'); // Assert raw HTML content
Pdf::assertHeaderTemplate($expectedHtml); // Assert header template
Pdf::assertFooterTemplate($expectedHtml); // Assert footer template

// Format and dimensions
Pdf::assertFormat('A4'); // or Format::A4
Pdf::assertWidth(210, 'mm');
Pdf::assertHeight(297, 'mm');
Pdf::assertLandscape(); // Assert landscape is enabled

// Options
Pdf::assertMargins(20, 15, 20, 15, 'mm');
Pdf::assertPrintBackground();
Pdf::assertDisplayHeaderFooter();
Pdf::assertScale(1.2);
Pdf::assertTagged();
Pdf::assertOutline();
Pdf::assertPreferCSSPageSize();
Pdf::assertPageRanges('1-5,8');

// Output assertions
Pdf::assertName('invoice.pdf'); // Assert download filename
Pdf::assertSaved('/path/to/file.pdf'); // Assert file was saved
Pdf::assertDownloaded('invoice.pdf'); // Assert download headers set
Pdf::assertInline('invoice.pdf'); // Assert inline headers set
```

### Testing with callbacks

[](#testing-with-callbacks)

Use callbacks for more complex assertions:

```
use Illuminate\View\View;

beforeEach(function () {
    Pdf::fake();
});

it('validates invoice data in PDF', function () {
    $invoice = Invoice::factory()->create(['total' => 150]);

    Pdf::view('invoice', compact('invoice'));

    // Test view and its data
    Pdf::assertView('invoice', function (View $view, array $data) use ($invoice): bool {
        return $data['invoice']->total > 100
            && $data['invoice']->id === $invoice->id
            && $view->name() === 'invoice';
    });
});

it('asserts simple view without callback', function () {
    Pdf::view('invoice');

    Pdf::assertView('invoice');
});
```

### Testing services that use PDF

[](#testing-services-that-use-pdf)

When testing components that use PDF generation:

```
use Illuminate\View\View;

it('generates monthly report', function () {
    Pdf::fake();

    $service = new ReportService();
    $service->generateMonthlyReport(2025, 1);

    Pdf::assertView('reports.monthly', function (View $view, array $data): bool {
        return $data['month'] === 1 && $data['year'] === 2025;
    });
    Pdf::assertFormat('A4');
    Pdf::assertLandscape(true);
});
```

### Test example with all features

[](#test-example-with-all-features)

Complete test example showing multiple PDF features:

```
it('generates complex PDF with multiple features', function () {
    Pdf::fake();

    $invoice = Invoice::factory()->create();

    Pdf::view('invoice', compact('invoice'))
        ->format(Format::A4)
        ->landscape()
        ->margins(20, 15, 20, 15, Unit::Millimeter)
        ->printBackground()
        ->scale(1.1)
        ->headerTemplate('Header')
        ->footerTemplate('Footer')
        ->name('test-invoice.pdf')
        ->download();

    // Assert all configurations
    Pdf::assertView('invoice');
    Pdf::assertFormat('A4');
    Pdf::assertLandscape();
    Pdf::assertMargins(20, 15, 20, 15, 'mm');
    Pdf::assertPrintBackground();
    Pdf::assertScale(1.1);
    Pdf::assertHeaderTemplate('Header');
    Pdf::assertFooterTemplate('Footer');
    Pdf::assertName('test-invoice.pdf');
    Pdf::assertDownloaded('test-invoice.pdf');
});
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Patrik Strišovský](https://github.com/patressz)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance68

Regular maintenance activity

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

6

Last Release

287d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/27a59a5b5530a6fbaa12c7a3b755fa6e2e4d6897a400487d6a548bfcb7d7dd88?d=identicon)[patressz](/maintainers/patressz)

---

Top Contributors

[![patressz](https://avatars.githubusercontent.com/u/81393875?v=4)](https://github.com/patressz "patressz (119 commits)")

---

Tags

phplaravelpdfplaywright

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/patressz-laravel-pdf/health.svg)

```
[![Health](https://phpackages.com/badges/patressz-laravel-pdf/health.svg)](https://phpackages.com/packages/patressz-laravel-pdf)
```

###  Alternatives

[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.7k144.3M712](/packages/maatwebsite-excel)[barryvdh/laravel-dompdf

A DOMPDF Wrapper for Laravel

7.3k87.6M278](/packages/barryvdh-laravel-dompdf)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[spatie/laravel-pdf

Create PDFs in Laravel apps

9963.4M12](/packages/spatie-laravel-pdf)[elibyy/tcpdf-laravel

tcpdf support for Laravel 6, 7, 8, 9, 10, 11

3542.7M5](/packages/elibyy-tcpdf-laravel)[mostafaznv/pdf-optimizer

PDF optimization tool for PHP and Laravel applications

170125.8k](/packages/mostafaznv-pdf-optimizer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
