PHPackages                             milanzor/cakephp-wkhtmltopdf - 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. milanzor/cakephp-wkhtmltopdf

ActiveCakephp-plugin[PDF &amp; Document Generation](/categories/documents)

milanzor/cakephp-wkhtmltopdf
============================

CakePHP 2.x View and Component for WkHtmlToPdf

1.0.2(8y ago)1852MITPHP

Since Mar 23Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Milanzor/cakephp-wkhtmltopdf)[ Packagist](https://packagist.org/packages/milanzor/cakephp-wkhtmltopdf)[ RSS](/packages/milanzor-cakephp-wkhtmltopdf/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

[![Packagist](https://camo.githubusercontent.com/20e0f97df15a71fb1cbbabda3a7052c7e82935ff2d3e7e2b1734471d94cf1829/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d696c616e7a6f722f63616b657068702d776b68746d6c746f7064662e737667)](https://packagist.org/packages/milanzor/cakephp-wkhtmltopdf)[![license](https://camo.githubusercontent.com/e74ce316da90a56e5103a5cae19ee0afb322eeb4eb0acfbddc6b62c1dc63b903/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d696c616e7a6f722f63616b657068702d776b68746d6c746f7064662e737667)](https://camo.githubusercontent.com/e74ce316da90a56e5103a5cae19ee0afb322eeb4eb0acfbddc6b62c1dc63b903/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d696c616e7a6f722f63616b657068702d776b68746d6c746f7064662e737667)

WkHtmlToPdf in CakePHP 2
========================

[](#wkhtmltopdf-in-cakephp-2)

Provides a View and a Component for generating PDF's through view's in Cake 2. Uses WkHtmlToPdf.

Currently only supports WkHtmlToPdf AMD64!

### How to use

[](#how-to-use)

- `composer require milanzor/cakephp-wkhtmltopdf`
- Load the plugin in Cake
- Enable parsing of extension `pdf` in your routes: `Router::parseExtensions('pdf');`
- Enable the RequestHandler to handle `.pdf` requests using the following snippet in your `(App)Controller`:

```
  public $components = [
         'RequestHandler' => [
             'viewClassMap' => [
                 'pdf' => 'CakephpWkhtmltopdf.Pdf',
             ],
         ],
     ];
```

Now when you call a page, e.g. , the RequestHandler will offhand the request to this plugin's PdfView. Resulting in your view + layout files to be rendering into a PDF.

### Available options

[](#available-options)

In your Controller methods, you can set the following viewVars:

- To force a file download: `$this->set('_download', 'filename-without-.pdf-extension');`
- To stream the pdf to the browser: `$this->set('_stream', true);`
- Save the file: `$this->set('_save', '/full/path/to/file.pdf');`
- Additional WkHtmlToPdf options can be passed to the WkHtmlToPdf PHP instance using: `$this->set('WkHtmlToPdf_options', []);`For these options, see

### Questions?

[](#questions)

Feel free to make an issue or PR!

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 77.8% 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 ~1 days

Total

3

Last Release

2967d ago

### Community

Maintainers

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

---

Top Contributors

[![milan-corpoflow](https://avatars.githubusercontent.com/u/40798799?v=4)](https://github.com/milan-corpoflow "milan-corpoflow (7 commits)")[![Milanzor](https://avatars.githubusercontent.com/u/5535848?v=4)](https://github.com/Milanzor "Milanzor (2 commits)")

### Embed Badge

![Health badge](/badges/milanzor-cakephp-wkhtmltopdf/health.svg)

```
[![Health](https://phpackages.com/badges/milanzor-cakephp-wkhtmltopdf/health.svg)](https://phpackages.com/packages/milanzor-cakephp-wkhtmltopdf)
```

###  Alternatives

[friendsofcake/cakepdf

CakePHP plugin for creating and/or rendering Pdfs, several Pdf engines supported.

3752.1M3](/packages/friendsofcake-cakepdf)[endroid/pdf

Endroid PDF

3545.4k](/packages/endroid-pdf)[satthi/csv-combine-plugin-for-cakephp

CakePHP CsvCombine

1686.0k](/packages/satthi-csv-combine-plugin-for-cakephp)[dakota/cake-excel

CakePHP excel generator

2324.9k](/packages/dakota-cake-excel)[spiritix/html-to-pdf

Convert HTML markup into beautiful PDF files using the famous wkhtmltopdf library

1932.5k](/packages/spiritix-html-to-pdf)[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)
