PHPackages                             cangelis/pdf - 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/pdf

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

cangelis/pdf
============

Yet another HTML to PDF Converter based on wkhtmltopdf

2.2.0(9y ago)5363.7k↓22.2%17[1 issues](https://github.com/cangelis/php-pdf/issues)1MITPHPPHP &gt;=5.4.0

Since Jan 5Pushed 5y ago4 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (9)Used By (1)

HTML to PDF Converter based on wkhtmltopdf for PHP
==================================================

[](#html-to-pdf-converter-based-on-wkhtmltopdf-for-php)

This is a yet another html to pdf converter for php. This package uses [wkhtmltopdf](https://github.com/antialize/wkhtmltopdf) as a third-party tool so `proc_*()` functions have 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/)).

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

[](#installation)

Add this to your `composer.json`

```
{
    "require": {
        "cangelis/pdf": "2.2.*"
    }
}

```

and run `composer.phar update`

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

[](#some-examples)

```
$pdf = new CanGelis\PDF\PDF('/usr/bin/wkhtmltopdf');

echo $pdf->loadHTML('Hello World')->get();

echo $pdf->loadURL('http://www.laravel.com')->grayscale()->pageSize('A3')->orientation('Landscape')->get();

echo $pdf->loadHTMLFile('/home/can/index.html')->lowquality()->pageSize('A2')->get();

```

\## Saving the output

php-pdf 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 echo to the screen
echo $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'))
        ->get();

```

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

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

[](#contribution)

Feel free to contribute!

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity63

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 ~150 days

Recently: every ~261 days

Total

8

Last Release

3462d ago

Major Versions

1.1.2 → 2.0.02014-11-15

PHP version history (2 changes)1.0.0PHP &gt;=5.3.0

2.2.0PHP &gt;=5.4.0

### 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 (24 commits)")[![ethanf22](https://avatars.githubusercontent.com/u/4087531?v=4)](https://github.com/ethanf22 "ethanf22 (1 commits)")[![HeroBart](https://avatars.githubusercontent.com/u/3180590?v=4)](https://github.com/HeroBart "HeroBart (1 commits)")[![ulentini](https://avatars.githubusercontent.com/u/1756971?v=4)](https://github.com/ulentini "ulentini (1 commits)")

---

Tags

pdfphp-pdfwkhtmltopdfpdfwkhtmltopdfhtml-to-pdfpdf converter

### Embed Badge

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

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

###  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.0M44](/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)[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)[cangelis/l4pdf

Yet another HTML to PDF Converter for Laravel4

548.2k](/packages/cangelis-l4pdf)

PHPackages © 2026

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