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

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

chrisbraybrooke/laravel-chrome-pdf
==================================

A wrapper for Laravel around the spiritix/php-chrome-html2pdf libary

0.0.5(7y ago)512.8k4[5 issues](https://github.com/ChrisBraybrooke/LaravelChromePdf/issues)MITPHPPHP &gt;=7.0

Since Jan 29Pushed 7y ago1 watchersCompare

[ Source](https://github.com/ChrisBraybrooke/LaravelChromePdf)[ Packagist](https://packagist.org/packages/chrisbraybrooke/laravel-chrome-pdf)[ RSS](/packages/chrisbraybrooke-laravel-chrome-pdf/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (5)Dependencies (3)Versions (7)Used By (0)

Laravel PHP Chrome HTML to PDF
==============================

[](#laravel-php-chrome-html-to-pdf)

Important note regarding git
----------------------------

[](#important-note-regarding-git)

If you keep you vendor folder in source control - then you may want to consider placing the following in you `.gitignore` file. The reason for this is that the chromium rendering engine contains files that are larger than GitHubs 100mb limit.

```
/vendor/spiritix/php-chrome-html2pdf/node_modules/*
```

How it works
------------

[](#how-it-works)

This library is based on [puppeteer](https://github.com/GoogleChrome/puppeteer), a headless Chrome Node API which is maintained by the Chrome DevTools team.

It provides a simple PHP / Laravel wrapper around the Node API, focused on generating beautiful PDF files.

In contrast to other HTML to PDF converters like [wkhtmltopdf](https://wkhtmltopdf.org/), the corresponding PHP wrapper or similar libraries, it is based on a current Chrome version instead of outdated and unmaintained WebKit builds. This library therefore fully supports CSS3, HTML5, SVGs, SPAs, and all the other fancy stuff people use these days.

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

[](#installation)

```
composer require chrisbraybrooke/laravel-chrome-pdf
```

Setup:
------

[](#setup)

**Laravel &gt;=5.5**

Laravel 5.5 and above uses package autodiscovery so you are **all done!** Skip to [Usage](#usage).

**Laravel 5.5&lt;**

If you are using Laravel 5.4 or below, you will have to manually register the package. After updating composer, add the ServiceProvider to the providers array in `config/app.php`.

```
ChrisBraybrooke\LaravelChromePdf\ServiceProvider::class,
```

And optionally add the Facade.

```
'ChromePDF' => ChrisBraybrooke\LaravelChromePdf\ChromePDF::class,
```

Usage:
------

[](#usage)

Below is an example of creating a simple PDF from a blade file.

```
namespace App\Http\Controllers;

use App\Invoice;
use ChromePDF;

class InvoicesController {

    /**
     * Download a PDF version of the invoice.
     *
     * @return void
     */
    public function show(Invoice $invoice)
    {
        // Load resources/views/invoice.blade.php
        ChromePDF::loadView('invoice', ['invoice' => $invoice])
            ->size('a4')
            ->landscape()
            ->download("invoice-{$invoice->ref}.pdf");
    }
}
```

Outputs:
--------

[](#outputs)

**There are several methods of outputting the PDF.**

Of course `download` is available.

```
ChromePDF::loadView('invoice', ['invoice' => $invoice])->download("invoice-{$ref}.pdf");
```

Use `inline` to show the PDF inline in the browser.

```
ChromePDF::loadView('invoice', ['invoice' => $invoice])->inline();
```

Or `save` to save the file to the filesystem. The first argument is the filename / path - and the second is the disk to be used.

```
ChromePDF::loadView('invoice', ['invoice' => $invoice])->save("invoice-{$ref}.pdf", 's3');
```

Options:
--------

[](#options)

It is simple to set options for the PDF.

Just use the `setOption` or `setOptions` methods.

```
ChromePDF::loadHtml('Hello world')->setOption('scale', '0.2')->download('hello.pdf');
```

Or set multiple options at once.

```
ChromePDF::loadHtml('More options here!')
    ->setOptions(['scale' => 0.2, 'landscape'])
    ->download('options.pdf');
```

All available php-chrome-html2pdf [options](https://github.com/spiritix/php-chrome-html2pdf#options) are available.

There are also a few helper methods, which can be chained.

```
ChromePDF::loadHtml('Hello world')
    // a3 & a5 also available - pass true to set as landscape. Or use size('') and specify a different page size.
    ->a4()
    // Set the orientation as landscape - default is portrait.
    ->landscape()
    // Load a blade template for the page headers.
    ->headerView('default-header')
    // Load a blade template for the page footers.
    ->footerView('default-footer')
    ->download();
```

Maintenance:
------------

[](#maintenance)

My company [Purple Mountain](https://www.purplemountmedia.com) - A web development company in the UK, will try our best to keep this package up to date and free from any issues.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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 ~11 days

Total

5

Last Release

2670d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/954f04d21211c33ec6dd750169be63b054d65d2fba406a0ad523b43cda015b25?d=identicon)[ChrisBraybrooke](/maintainers/ChrisBraybrooke)

---

Tags

phplaravelpdfhtmlheadlesschromepuppeteerhtml2pdf

### Embed Badge

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

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

###  Alternatives

[spiritix/php-chrome-html2pdf

A PHP library for converting HTML to PDF using Google Chrome

153487.0k3](/packages/spiritix-php-chrome-html2pdf)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M203](/packages/laravel-ai)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k26.5M51](/packages/barryvdh-laravel-snappy)[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)[daandesmedt/phpheadlesschrome

A PHP wrapper for using Google Chrome Headless mode. Convert URL or HTML to a PDF / screenshot. Easy to use and OOP interfaced.

92255.6k](/packages/daandesmedt-phpheadlesschrome)[erag/laravel-lang-sync-inertia

A powerful Laravel package for syncing and managing language translations across backend and Inertia.js (Vue/React/Svelte) frontends, offering effortless localization, auto-sync features, and smooth multi-language support for modern Laravel applications.

4925.3k](/packages/erag-laravel-lang-sync-inertia)

PHPackages © 2026

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