PHPackages                             cobweb-is/laravel-snappy - 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. cobweb-is/laravel-snappy

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

cobweb-is/laravel-snappy
========================

Snappy PDF/Image for Laravel 4

v0.2.0(11y ago)1165MITPHPPHP &gt;=5.4.0

Since Jun 10Pushed 10y ago4 watchersCompare

[ Source](https://github.com/cobweb-is/laravel-snappy)[ Packagist](https://packagist.org/packages/cobweb-is/laravel-snappy)[ RSS](/packages/cobweb-is-laravel-snappy/feed)WikiDiscussions 0.1 Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (13)Used By (0)

Snappy PDF/Image Wrapper for Laravel 4
--------------------------------------

[](#snappy-pdfimage-wrapper-for-laravel-4)

### For Laravel 5, check the [0.2/master branch](https://github.com/barryvdh/laravel-snappy)

[](#for-laravel-5-check-the-02master-branch)

This package is a ServiceProvider for Snappy: .

You need to have wkhtmltopdf/wkhtmltoimage installed. You can download wkhtmltopdf from  See  how to do it with composer. Please note that some dependencies (libXrender for example) may not be present on your system and may require manual installation. After installing, verify first if wkhtmltopdf works correctly when invoked from the command line / shell.

The package provides $app\['snappy.pdf'\] and $app\['snappy.image'\]. You have to set the binary location in the config file. First publish the config file:

```
php artisan config:publish cobweb-is/laravel-snappy

```

and then adapt the "binary" line in the published config file (afer publishing should be present in: app/config/packages/cobweb-is/laravel-snappy/config.php).

For example, when loaded with composer, the line should look like:

```
'binary' => base_path('vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64'),

```

In addition to the Snappy classes, it provides a wrapper, similar to

Require this package in your composer.json and update composer.

```
"cobweb-is/laravel-snappy": "0.1.x"

```

After updating composer, add the ServiceProvider to the providers array in app/config/app.php

```
'Barryvdh\Snappy\ServiceProvider',

```

You can optionally use the facade for shorter code. Add this to your facades:

```
'PDF' => 'Barryvdh\Snappy\Facades\SnappyPdf',
'Image' => 'Barryvdh\Snappy\Facades\SnappyImage',

```

You can create a new Snappy PDF/Image instance and load a HTML string, file or view name. You can save it to a file, or stream (show in browser) or download.

Using the App container:

```
$snappy = App::make('snappy.pdf');
//To file
$snappy->generateFromHtml('BillYou owe me money, dude.', '/tmp/bill-123.pdf');
$snappy->generate('http://www.github.com', '/tmp/github.pdf'));
//Or output:
return new Response(
    $snappy->getOutputFromHtml($html),
    200,
    array(
        'Content-Type'          => 'application/pdf',
        'Content-Disposition'   => 'attachment; filename="file.pdf"'
    )
);

```

Using the wrapper:

```
$pdf = App::make('snappy.pdf.wrapper');
$pdf->loadHTML('Test');
return $pdf->stream();

```

Or use the facade:

```
$pdf = PDF::loadView('pdf.invoice', $data);
return $pdf->download('invoice.pdf');

```

You can chain the methods:

```
return PDF::loadFile('http://www.github.com')->stream('github.pdf');

```

You can change the orientation and paper size

```
PDF::loadHTML($html)->setPaper('a4')->setOrientation('landscape')->setOption('margin-bottom', 0)->save('myfile.pdf')

```

If you need the output as a string, you can get the rendered PDF with the output() function, so you can save/output it yourself.

You can publish the config-file to change some settings (default paper etc).

```
php artisan config:publish cobweb-is/laravel-snappy

```

See the [wkhtmltopdf manual](http://wkhtmltopdf.org/usage/wkhtmltopdf.txt) for more information/settings.

### License

[](#license)

This Snappy Wrapper for Laravel is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.3% 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 ~44 days

Recently: every ~35 days

Total

12

Last Release

3867d ago

PHP version history (2 changes)v0.1.0PHP &gt;=5.3.0

v0.2.0PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/10d88a43ba9a2430a3ef8637124e3f54e3d9cd3d2f39ee0fb92e4ff95aecc6e8?d=identicon)[amitavmohanty](/maintainers/amitavmohanty)

---

Top Contributors

[![barryvdh](https://avatars.githubusercontent.com/u/973269?v=4)](https://github.com/barryvdh "barryvdh (21 commits)")[![amitavmohanty](https://avatars.githubusercontent.com/u/9553027?v=4)](https://github.com/amitavmohanty "amitavmohanty (10 commits)")[![kblais](https://avatars.githubusercontent.com/u/1931954?v=4)](https://github.com/kblais "kblais (2 commits)")[![anaxamaxan](https://avatars.githubusercontent.com/u/439457?v=4)](https://github.com/anaxamaxan "anaxamaxan (1 commits)")[![grahammccarthy](https://avatars.githubusercontent.com/u/1336930?v=4)](https://github.com/grahammccarthy "grahammccarthy (1 commits)")[![silverdr](https://avatars.githubusercontent.com/u/4529686?v=4)](https://github.com/silverdr "silverdr (1 commits)")

---

Tags

laravelpdfwkhtmltopdfimagesnappywkhtmltoimage

### Embed Badge

![Health badge](/badges/cobweb-is-laravel-snappy/health.svg)

```
[![Health](https://phpackages.com/badges/cobweb-is-laravel-snappy/health.svg)](https://phpackages.com/packages/cobweb-is-laravel-snappy)
```

###  Alternatives

[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

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

A DOMPDF Wrapper for Laravel

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

A slim PHP wrapper around wkhtmltopdf with an easy to use and clean OOP interface

1.6k20.0M44](/packages/mikehaertl-phpwkhtmltopdf)[elibyy/tcpdf-laravel

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

3542.7M5](/packages/elibyy-tcpdf-laravel)[mvlabs/mvlabs-snappy

MvlabsSnappy is a Zend Framework and Laminas module that allow easy to thumbnail, snapshot or PDF generation from a url or a html page using Snappy PHP wrapper for the wkhtmltopdf/wkhtmltoimage conversion utility.

2453.6k](/packages/mvlabs-mvlabs-snappy)[lucasromanojf/laravel5-pdf

Provides the HTML2PDF functionality using the wkhtmltopdf library (Laravel 5)

1271.8k](/packages/lucasromanojf-laravel5-pdf)

PHPackages © 2026

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