PHPackages                             motekar/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. motekar/laravel-pdf

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

motekar/laravel-pdf
===================

Create PDFs in Laravel apps

v1.1.0(1y ago)1416[1 issues](https://github.com/motekar/laravel-pdf/issues)MITPHPPHP ^8.2

Since Oct 9Pushed 1y agoCompare

[ Source](https://github.com/motekar/laravel-pdf)[ Packagist](https://packagist.org/packages/motekar/laravel-pdf)[ Docs](https://github.com/motekar/laravel-pdf)[ RSS](/packages/motekar-laravel-pdf/feed)WikiDiscussions main Synced today

READMEChangelog (6)Dependencies (22)Versions (9)Used By (0)

Create PDFs in Laravel apps
===========================

[](#create-pdfs-in-laravel-apps)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9c1aaa756dcecc234a59e6e19094ff7199cd35ad2060616377ec7cc11765de7c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6f74656b61722f6c61726176656c2d7064662e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/motekar/laravel-pdf)[![GitHub Tests Action Status](https://camo.githubusercontent.com/aec4314c4722c91b8fa1a812e5c7575a4ec54a7f6b8dfa7165f68e9a83602e3e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d6f74656b61722f6c61726176656c2d7064662f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/motekar/laravel-pdf/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/38779c9f65c15c11a2a28e5306fda4c1d089753f1b5d8b772cf7e4136279f803/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d6f74656b61722f6c61726176656c2d7064662f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/motekar/laravel-pdf/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/377a9d50f18ac4d617e62ab85efb49c84d9ef795f7dded6726da7c1712eb0d9c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6f74656b61722f6c61726176656c2d7064662e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/motekar/laravel-pdf)

This package provides a simple way to create PDFs in Laravel apps. Under the hood it uses [Chromium](https://www.chromium.org/chromium-projects/) to generate PDFs from Blade views. You can use modern CSS features like grid and flexbox to create beautiful PDFs.

*Unlike [spatie/laravel-pdf](https://github.com/spatie/laravel-pdf) this package does not require **nodejs** and **puppeteer**, it uses [chrome-php/chrome](https://github.com/chrome-php/chrome) instead.*

Here's a quick example:

```
use Motekar\LaravelPdf\Facades\Pdf;

Pdf::view('pdfs.invoice', ['invoice' => $invoice])
    ->format('a4')
    ->save('invoice.pdf')
```

This will render the Blade view `pdfs.invoice` with the given data and save it as a PDF file.

You can also return the PDF as a response from your controller:

```
use Motekar\LaravelPdf\Facades\Pdf;

class DownloadInvoiceController
{
    public function __invoke(Invoice $invoice)
    {
        return Pdf::view('pdfs.invoice', ['invoice' => $invoice])
            ->format('a4')
            ->name('your-invoice.pdf');
    }
}
```

You can use also test your PDFs:

```
use Motekar\LaravelPdf\Facades\Pdf;

it('can render an invoice', function () {
    Pdf::fake();

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

    $this->get(route('download-invoice', $invoice))
        ->assertOk();

    Pdf::assertRespondedWithPdf(function (PdfBuilder $pdf) {
        return $pdf->contains('test');
    });
});
```

Documentation
-------------

[](#documentation)

### Installation

[](#installation)

You can install the package via composer:

```
composer require motekar/laravel-pdf
```

Under the hood this package uses [Google Chrome](https://www.google.com/chrome/) or [Chromium](https://www.chromium.org/chromium-projects/) to generate PDFs. You'll need to install any of these browsers on your system.

### Usage

[](#usage)

This package supports almost every feature of Spatie's Laravel PDF package. For detailed usage documentation, we recommend referring to the comprehensive guide available on [Spatie's documentation site](https://spatie.be/docs/laravel-pdf). The usage patterns and methods are largely compatible, allowing you to leverage the extensive documentation provided by Spatie for this package as well.

Testing
-------

[](#testing)

For running the testsuite, you'll need the `pdftotext` CLI which is part of the poppler-utils package. More info can be found in in the [spatie/pdf-to-text readme](https://github.com/spatie/pdf-to-text?tab=readme-ov-file#requirements). Usually `brew install poppler` will suffice.

Finally run the tests with:

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

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

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Fauzie Rofi](https://github.com/fauzie811)
- [Freek Van der Herten](https://github.com/freekmurze)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance22

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% 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 ~22 days

Total

8

Last Release

477d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/318095?v=4)[Fauzie](/maintainers/fauzie811)[@fauzie811](https://github.com/fauzie811)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (175 commits)")[![ArielMejiaDev](https://avatars.githubusercontent.com/u/31971074?v=4)](https://github.com/ArielMejiaDev "ArielMejiaDev (13 commits)")[![fauzie811](https://avatars.githubusercontent.com/u/318095?v=4)](https://github.com/fauzie811 "fauzie811 (11 commits)")[![crynobone](https://avatars.githubusercontent.com/u/172966?v=4)](https://github.com/crynobone "crynobone (6 commits)")[![jeffreyvanhees](https://avatars.githubusercontent.com/u/8754630?v=4)](https://github.com/jeffreyvanhees "jeffreyvanhees (6 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (4 commits)")[![AlexVanderbist](https://avatars.githubusercontent.com/u/6287961?v=4)](https://github.com/AlexVanderbist "AlexVanderbist (4 commits)")[![vintagesucks](https://avatars.githubusercontent.com/u/13335308?v=4)](https://github.com/vintagesucks "vintagesucks (2 commits)")[![innocenzi](https://avatars.githubusercontent.com/u/16060559?v=4)](https://github.com/innocenzi "innocenzi (2 commits)")[![RVP04](https://avatars.githubusercontent.com/u/8185511?v=4)](https://github.com/RVP04 "RVP04 (2 commits)")[![stevethomas](https://avatars.githubusercontent.com/u/1127412?v=4)](https://github.com/stevethomas "stevethomas (2 commits)")[![albertStaalburger](https://avatars.githubusercontent.com/u/797741?v=4)](https://github.com/albertStaalburger "albertStaalburger (2 commits)")[![austincarpenter](https://avatars.githubusercontent.com/u/3736774?v=4)](https://github.com/austincarpenter "austincarpenter (1 commits)")[![Lintume](https://avatars.githubusercontent.com/u/17297839?v=4)](https://github.com/Lintume "Lintume (1 commits)")[![mansoorkhan96](https://avatars.githubusercontent.com/u/51432274?v=4)](https://github.com/mansoorkhan96 "mansoorkhan96 (1 commits)")[![msucevan](https://avatars.githubusercontent.com/u/57497646?v=4)](https://github.com/msucevan "msucevan (1 commits)")[![NeftaliYagua](https://avatars.githubusercontent.com/u/2866454?v=4)](https://github.com/NeftaliYagua "NeftaliYagua (1 commits)")[![PrestaEdit](https://avatars.githubusercontent.com/u/2631425?v=4)](https://github.com/PrestaEdit "PrestaEdit (1 commits)")[![rakibhoossain](https://avatars.githubusercontent.com/u/11789594?v=4)](https://github.com/rakibhoossain "rakibhoossain (1 commits)")

---

Tags

spatielaravelLaravel pdf

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k102.4M1.4k](/packages/spatie-laravel-permission)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M165](/packages/spatie-laravel-health)[wnx/laravel-backup-restore

A package to restore database backups made with spatie/laravel-backup.

213421.0k2](/packages/wnx-laravel-backup-restore)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M100](/packages/dedoc-scramble)[spatie/laravel-passkeys

Use passkeys in your Laravel app

471890.7k39](/packages/spatie-laravel-passkeys)

PHPackages © 2026

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