PHPackages                             cangelis/l4pdf - 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. cangelis/l4pdf

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

cangelis/l4pdf
==============

Yet another HTML to PDF Converter for Laravel4

2.0.0(11y ago)548.2k↓50%6[1 issues](https://github.com/cangelis/l4pdf/issues)MITPHPPHP &gt;=5.3.0

Since Jan 1Pushed 11y ago5 watchersCompare

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

READMEChangelogDependencies (3)Versions (13)Used By (0)

HTML to PDF Converter for Laravel 4
===================================

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

This is a yet another html to pdf converter for Laravel 4. 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](http://wkhtmltopdf.org/)).

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

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

[](#installation)

### Step 1

[](#step-1)

Add this to your `composer.json`

```
{
    "require": {
        "cangelis/l4pdf": "2.0.*"
    }
}

```

### Step 2

[](#step-2)

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

```
'CanGelis\L4pdf\ServiceProvider'

```

### Step 3

[](#step-3)

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

```
'PDF' => 'CanGelis\L4pdf\PDFFacade'

```

### Step 4

[](#step-4)

Run this command to publish the configurations of this package

```
php artisan config:publish cangelis/l4pdf

```

### Step 5

[](#step-5)

Configure your `wkhtmltopdf` executable path under `app/config/packages/cangelis/l4pdf/config.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();
});

```

\## Saving the PDF

l4pdf 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/cangelis/l4pdf/blob/master/DOCUMENTATION.md) file

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

[](#contribution)

Feel free to contribute!

###  Health Score

37

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 88.9% 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 ~29 days

Recently: every ~77 days

Total

12

Last Release

4192d ago

Major Versions

1.2.0 → 2.0.02014-11-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/ce2455306642be716064bd852d02059bfcb179045c8cadd7d1808078e44604db?d=identicon)[cangelis](/maintainers/cangelis)

---

Top Contributors

[![cangelis](https://avatars.githubusercontent.com/u/1162691?v=4)](https://github.com/cangelis "cangelis (32 commits)")[![petercoles](https://avatars.githubusercontent.com/u/2947594?v=4)](https://github.com/petercoles "petercoles (4 commits)")

---

Tags

pdfwkhtmltopdflaravel4html-to-pdfpdf converter

### Embed Badge

![Health badge](/badges/cangelis-l4pdf/health.svg)

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

###  Alternatives

[knplabs/knp-snappy

PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage.

4.5k68.3M56](/packages/knplabs-knp-snappy)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

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

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

1.6k20.0M43](/packages/mikehaertl-phpwkhtmltopdf)[h4cc/wkhtmltopdf-amd64

Convert html to pdf using webkit (qtwebkit). Static linked linux binary for amd64 systems.

48724.6M38](/packages/h4cc-wkhtmltopdf-amd64)[wemersonjanuario/laravelpdf

Another HTML to PDF Converter for Laravel

2912.9k1](/packages/wemersonjanuario-laravelpdf)[gotenberg/gotenberg-php

A PHP client for interacting with Gotenberg, a developer-friendly API for converting numerous document formats into PDF files, and more!

3685.2M19](/packages/gotenberg-gotenberg-php)

PHPackages © 2026

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