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

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

verumconsilium/laravel-browsershot
==================================

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

v1.3.0(5y ago)109475.9k↓16%20[11 issues](https://github.com/verumconsilium/laravel-browsershot/issues)[7 PRs](https://github.com/verumconsilium/laravel-browsershot/pulls)1MITPHP

Since Apr 4Pushed 1y ago3 watchersCompare

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

READMEChangelog (4)Dependencies (3)Versions (14)Used By (1)

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

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

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

[![Build Status](https://camo.githubusercontent.com/247bbc69dc65e8dc16701ff9a3d3cf4993295eefcab4140e6d061c9252d54171/68747470733a2f2f7472617669732d63692e6f72672f766572756d636f6e73696c69756d2f6c61726176656c2d62726f7773657273686f742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/verumconsilium/laravel-browsershot)[![Coverage Status](https://camo.githubusercontent.com/4c096883fc265e268f582c0452a7f3599795f98de6ff02cf6822b466bf46ea2f/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f766572756d636f6e73696c69756d2f6c61726176656c2d62726f7773657273686f742f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/verumconsilium/laravel-browsershot?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/87340e47be93c8c634ba0533ecac06181195e9162c0c10a447fcc9b8bfddf9e7/68747470733a2f2f706f7365722e707567782e6f72672f766572756d636f6e73696c69756d2f6c61726176656c2d62726f7773657273686f742f762f737461626c65)](https://packagist.org/packages/verumconsilium/laravel-browsershot)[![Latest Unstable Version](https://camo.githubusercontent.com/2112ce9e4b383f60fe1a0f2db040440e8b82ffd6afbc656753c2c6834f58f35e/68747470733a2f2f706f7365722e707567782e6f72672f766572756d636f6e73696c69756d2f6c61726176656c2d62726f7773657273686f742f762f756e737461626c65)](https://packagist.org/packages/verumconsilium/laravel-browsershot)[![Total Downloads](https://camo.githubusercontent.com/6e2bf5fe0e35e9b83c1fc336114362c9a15ed4d2797796bd6e0af73f2785bf75/68747470733a2f2f706f7365722e707567782e6f72672f766572756d636f6e73696c69756d2f6c61726176656c2d62726f7773657273686f742f646f776e6c6f616473)](https://packagist.org/packages/verumconsilium/laravel-browsershot)[![License](https://camo.githubusercontent.com/7ac9cd1b5bf4ad9c5ad386618edfb4d597bb0e864f228aefe09a7b9b9e8bc666/68747470733a2f2f706f7365722e707567782e6f72672f766572756d636f6e73696c69756d2f6c61726176656c2d62726f7773657273686f742f6c6963656e7365)](https://packagist.org/packages/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 verumconsilium/laravel-browsershot
```

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

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 VerumConsilium\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 VerumConsilium\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

```
  $pdfStoredPath = PDF::loadUrl('https://google.com')
                      ->store('pdfs/')
```

This will use the default storage driver to store the pdf in the `pdfs/` folder giving it a unique name. If you would like to specify the name you can call de `storeAs` method

```
  $pdfStoredPath = PDF::loadUrl('https://google.com')
                      ->storeAs('pdfs/', 'google.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 VerumConsilium\Browsershot\Facades\Screenshot;

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

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance25

Infrequent updates — may be unmaintained

Popularity51

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 88.6% 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 ~115 days

Recently: every ~180 days

Total

9

Last Release

2041d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2cebfac00bedd6726a6ed78f3ab1114c7808e3870a60b44a8843da2eb9917fa1?d=identicon)[verumconsilium](/maintainers/verumconsilium)

---

Top Contributors

[![sgtpepper9907](https://avatars.githubusercontent.com/u/21094671?v=4)](https://github.com/sgtpepper9907 "sgtpepper9907 (39 commits)")[![okaufmann](https://avatars.githubusercontent.com/u/4414498?v=4)](https://github.com/okaufmann "okaufmann (4 commits)")[![nickels](https://avatars.githubusercontent.com/u/9688615?v=4)](https://github.com/nickels "nickels (1 commits)")

---

Tags

headless-chromelaravellaravel-5-packagelaravel5pdf-generationscreenshot

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k32.1M102](/packages/spatie-browsershot)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

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

PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way

1.2k57.6M131](/packages/openspout-openspout)[setasign/tfpdf

This class is a modified version of FPDF that adds UTF-8 support. The latest version is based on FPDF 1.85.

426.1M30](/packages/setasign-tfpdf)[reportico-web/reportico

Reportico Open Source PHP Report Designer

17120.5k2](/packages/reportico-web-reportico)[asika/pdf2text

Simple PHP PDF to text class.

25828.1k](/packages/asika-pdf2text)

PHPackages © 2026

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