PHPackages                             cavaon-wayne/laravel-browsershot - 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. cavaon-wayne/laravel-browsershot

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

cavaon-wayne/laravel-browsershot
================================

Browsershot's Laravel wrapper to generate PDF files and Screenshots using Headless Chrome

v2.0.0(5y ago)01.1k—0%MITPHPCI failing

Since Nov 7Pushed 5y ago1 watchersCompare

[ Source](https://github.com/cavaon-wayne/laravel-browsershot)[ Packagist](https://packagist.org/packages/cavaon-wayne/laravel-browsershot)[ RSS](/packages/cavaon-wayne-laravel-browsershot/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

[Browsershot](https://github.com/spatie/browsershot) wrapper for Laravel 6
==========================================================================

[](#browsershot-wrapper-for-laravel-6)

This package takes advantage of Google Chrome's Headless mode to take screenshots and generate PDFs from websites, views and raw html

Forked from [verumconsilium/laravel-browsershot](https://github.com/verumconsilium/laravel-browsershot)

Requirements
============

[](#requirements)

- [Node](https://nodejs.org/) 7.6.0 or higher
- [Google Chrome](https://www.google.com/chrome/)
- [Puppeteer Node library](https://github.com/GoogleChrome/puppeteer).

You can install Puppeteer in your project via NPM:

```
npm install puppeteer
```

Or you could opt to just install it globally

```
npm install puppeteer --global
```

On a [Forge](https://forge.laravel.com) provisioned Ubuntu 16.04 server you can install the latest stable version of Chrome like this:

```
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
sudo npm install --global --unsafe-perm puppeteer
sudo chmod -R o+rx /usr/lib/node_modules/puppeteer/.local-chromium
```

Installation
============

[](#installation)

Install the package through composer

```
composer require cavaon-wayne/laravel-browsershot
```

After the package is installed the service provider will be automatically discovered and two new Facades `PDF` and `Screenshot` will be available

If the auto-discover not working, please add following service provider into `config/app.php`

```
Cavaon\Browsershot\BrowsershotServiceProvider::class,
```

Usage
=====

[](#usage)

The recommended way to use this package is through its Facades

PDF
---

[](#pdf)

### Generating a PDF from a view and returning it inline

[](#generating-a-pdf-from-a-view-and-returning-it-inline)

```

  use Cavaon\Browsershot\Facades\PDF;

  ...

  return PDF::loadView('view.name', $data)
            ->inline();

```

You can chain all the methods available in the [browsershot master library](https://github.com/spatie/browsershot)

### Returning the PDF as a download

[](#returning-the-pdf-as-a-download)

```
  use Cavaon\Browsershot\Facades\PDF;

  ...

  return PDF::loadView('view.name', $data)
            ->margins(20, 0, 0, 20)
            ->download();
```

You can pass the custom file name and additional headers the response will have to the `inline` and `download` methods like

```
  PDF::loadHtml('Awesome PDF')
      ->download('myawesomepdf.pdf', [
        'Authorization' => 'token'
      ]);
```

### Persisting PDF to disk

[](#persisting-pdf-to-disk)

If you would like to save the generated pdf file to your storage disk you can call the `store` or `storeAs` method

```
  $result = PDF::loadUrl('https://google.com')
                      ->store('abcd.pdf')
```

Screenshots
-----------

[](#screenshots)

Screenshots are created the same way as PDFs just change the facade to `Screenshot`

### Generating screenshots as JPG/JPEG

[](#generating-screenshots-as-jpgjpeg)

By default screenshots will be taken as PNG format if you would like to use JPG instead call the `useJPG()` method

```
use Cavaon\Browsershot\Facades\Screenshot;

Screenshot::loadView('view.name', $data)
           ->useJPG()
           ->margins(20, 0, 0, 20)
           ->download();
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 80% 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 ~89 days

Total

5

Last Release

2022d ago

Major Versions

v1.0.3 → v2.0.02020-10-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/970173305592257c4780282a39fb8997a835d7a781eaab0ef1570ceebe41dce8?d=identicon)[wayne.w](/maintainers/wayne.w)

---

Top Contributors

[![tomatotravel](https://avatars.githubusercontent.com/u/42629833?v=4)](https://github.com/tomatotravel "tomatotravel (4 commits)")[![cavaon-wayne](https://avatars.githubusercontent.com/u/54392913?v=4)](https://github.com/cavaon-wayne "cavaon-wayne (1 commits)")

### Embed Badge

![Health badge](/badges/cavaon-wayne-laravel-browsershot/health.svg)

```
[![Health](https://phpackages.com/badges/cavaon-wayne-laravel-browsershot/health.svg)](https://phpackages.com/packages/cavaon-wayne-laravel-browsershot)
```

###  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)[rap2hpoutre/fast-excel

Fast Excel import/export for Laravel

2.3k24.9M47](/packages/rap2hpoutre-fast-excel)[elibyy/tcpdf-laravel

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

3542.7M5](/packages/elibyy-tcpdf-laravel)[stevebauman/autodoc-facades

Auto-generate PHP doc annotations for Laravel facades

98186.6k9](/packages/stevebauman-autodoc-facades)

PHPackages © 2026

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