PHPackages                             wemersonjanuario/laravelpdf - 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. wemersonjanuario/laravelpdf

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

wemersonjanuario/laravelpdf
===========================

Another HTML to PDF Converter for Laravel

1.1.1(9y ago)2912.9k↓50%3[7 issues](https://github.com/wemersonjanuario/laravelpdf/issues)1MITPHPPHP &gt;=5.4.0

Since Apr 9Pushed 9y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (3)Versions (8)Used By (1)

HTML to PDF Converter for Laravel 5
===================================

[](#html-to-pdf-converter-for-laravel-5)

This is a yet another html to pdf converter for Laravel 5(see Laravel 4 here [cangelis/l4pdf](https://github.com/cangelis/l4pdf)). This package uses [wkhtmltopdf](https://github.com/antialize/wkhtmltopdf) as a third-party tool so `proc_*()` functions has to be enabled in your php configurations and `wkhtmltopdf` tool should be installed in your machine (You can download it from [here](https://code.google.com/p/wkhtmltopdf/downloads/list)).

**If you are not a Laravel user, check out [here](https://github.com/wemersonjanuario/php-pdf)**

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

[](#installation)

### Step 1

[](#step-1)

Add this to your `composer.json`

```
{
    "require": {
        "wemersonjanuario/laravelpdf": "1.1.*"
    }
}

```

### Step 2

[](#step-2)

Add this line to `providers` array in your `config/app.php`

```
Novanti\LaravelPDF\PDFServiceProvider::class

```

### Step 3

[](#step-3)

Add this line to `aliases` array in your `config/app.php`

```
'PDF' => Novanti\LaravelPDF\PDFFacade::class,

```

### Step 4

[](#step-4)

Run this command to publish the configurations of this package

```
php artisan vendor:publish

```

### Step 5

[](#step-5)

Configure your `wkhtmltopdf` executable path under `config/laravelpdf.php`

```
'executable' => '/usr/bin/wkhtmltopdf'

```

Some examples
-------------

[](#some-examples)

```
PDF::loadView('pdf.invoice')->download('invoice.pdf');

PDF::loadURL('http://www.laravel.com')->grayscale()->pageSize('A3')->orientation('Landscape')->stream('laravel.pdf')

Route::get('/', function() {
    return PDF::loadHTML('Hello World')->lowquality()->pageSize('A2')->download();
});

Since 1.0.3 the library supports generating PDF from multiple Laravel views of HTML pieces. Each part begins from a new page. Examples of using this feature:

PDF::loadViews(['pdf.order', 'pdf.invoice', 'pdf.wiretransfer'])->download('payment-bundle.pdf');

$htmlPages[] = getMainReport();
$htmlPages[] = getAdditionalReport();
PDF::loadHTMLs($htmlPages)->download('consolidated-report.pdf');

```

\## Saving the PDF

laravelpdf uses [League\\Flysystem](https://github.com/thephpleague/flysystem) to save the file to the local or remote filesystems.

### Usage

[](#usage)

```
$pdfObject->save(string $filename, League\Flysystem\AdapterInterface $adapter, $overwrite)

```

`filename`: the name of the file you want to save with

`adapter`: FlySystem Adapter

`overwrite`: If set to `true` and the file exists it will be overwritten, otherwise an Exception will be thrown.

### Examples

[](#examples)

```
// Save the pdf to the local file system
PDF::loadHTML('Hello World')
    ->save("invoice.pdf", new League\Flysystem\Adapter\Local(__DIR__.'/path/to/root'));

// Save to AWS S3
$client = S3Client::factory([
    'key'    => '[your key]',
    'secret' => '[your secret]',
]);
PDF::loadHTML('Hello World')
    ->save("invoice.pdf", new League\Flysystem\Adapter\AwsS3($client, 'bucket-name', 'optional-prefix'));

// Save to FTP
$ftpConf = [
    'host' => 'ftp.example.com',
    'username' => 'username',
    'password' => 'password',

    /** optional config settings */
    'port' => 21,
    'root' => '/path/to/root',
    'passive' => true,
    'ssl' => true,
    'timeout' => 30,
];
PDF::loadHTML('Hello World')
    ->save("invoice.pdf", new League\Flysystem\Adapter\Ftp($ftpConf));

// Save to the multiple locations and stream it
return PDF::loadHTML('Hello World')
        ->save("invoice.pdf", new League\Flysystem\Adapter\Ftp($ftpConf))
        ->save("invoice.pdf", new League\Flysystem\Adapter\AwsS3($client, 'bucket-name', 'optional-prefix'))
        ->save("invoice.pdf", new League\Flysystem\Adapter\Local(__DIR__.'/path/to/root'))
        ->download();

```

Please see all the available adapters on the [League\\Flysystem](https://github.com/thephpleague/flysystem)'s documentation

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

[](#documentation)

You can see all the available methods in the full [documentation](https://github.com/wemersonjanuario/laravelpdf/blob/master/DOCUMENTATION.md) file

Contribution
------------

[](#contribution)

Feel free to contribute!

Thanks
------

[](#thanks)

Thanks Can Geliş who made Laravel 4 support [cangelis/l4pdf](https://github.com/cangelis/l4pdf)

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 86.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 ~144 days

Recently: every ~180 days

Total

6

Last Release

3330d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c2d99e55b50dfe517fd76cfb877c573441ac6895fef90defebad01b6b04041e?d=identicon)[wemersonjanuario](/maintainers/wemersonjanuario)

---

Top Contributors

[![wemersonjanuario](https://avatars.githubusercontent.com/u/38724?v=4)](https://github.com/wemersonjanuario "wemersonjanuario (19 commits)")[![dpovshed](https://avatars.githubusercontent.com/u/786020?v=4)](https://github.com/dpovshed "dpovshed (3 commits)")

---

Tags

laravelpdfwkhtmltopdflaravel5html-to-pdfpdf converternovanti

### Embed Badge

![Health badge](/badges/wemersonjanuario-laravelpdf/health.svg)

```
[![Health](https://phpackages.com/badges/wemersonjanuario-laravelpdf/health.svg)](https://phpackages.com/packages/wemersonjanuario-laravelpdf)
```

###  Alternatives

[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

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

Yet another HTML to PDF Converter for Laravel4

548.2k](/packages/cangelis-l4pdf)[cangelis/pdf

Yet another HTML to PDF Converter based on wkhtmltopdf

5363.7k1](/packages/cangelis-pdf)[nitmedia/wkhtml2pdf

Html 2 Pdf - using wkhtml2pdf, work on 32bit and 64 bit linux + MacOS

117300.3k1](/packages/nitmedia-wkhtml2pdf)[lucasromanojf/laravel5-pdf

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

1271.8k](/packages/lucasromanojf-laravel5-pdf)[tarfin-labs/easy-pdf

Makes pdf processing easy.

1718.3k](/packages/tarfin-labs-easy-pdf)

PHPackages © 2026

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