PHPackages                             borales/yii-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. borales/yii-pdf

ActiveYii-extension[PDF &amp; Document Generation](/categories/documents)

borales/yii-pdf
===============

Yii-wrapper for PHP-PDF libraries (mPDF, HTML2PDF)

0.4.0(12y ago)59109.1k35[4 issues](https://github.com/Borales/yii-pdf/issues)[1 PRs](https://github.com/Borales/yii-pdf/pulls)New BSD LicensePHP

Since Aug 21Pushed 7y ago7 watchersCompare

[ Source](https://github.com/Borales/yii-pdf)[ Packagist](https://packagist.org/packages/borales/yii-pdf)[ RSS](/packages/borales-yii-pdf/feed)WikiDiscussions master Synced 2mo ago

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

Yii-PDF Extension
=================

[](#yii-pdf-extension)

[![Latest Stable Version](https://camo.githubusercontent.com/1cca1e45c3b487d607927f676d850eb7c5bda5dd9144c1e43e1a8c4e308878ad/68747470733a2f2f706f7365722e707567782e6f72672f626f72616c65732f7969692d7064662f762f737461626c652e737667)](https://packagist.org/packages/borales/yii-pdf)[![Total Downloads](https://camo.githubusercontent.com/56542ae7986c176f7858029b0208f835a7f7cc30737be7ff3bbe7f26f27c505e/68747470733a2f2f706f7365722e707567782e6f72672f626f72616c65732f7969692d7064662f646f776e6c6f6164732e737667)](https://packagist.org/packages/borales/yii-pdf)[![Latest Unstable Version](https://camo.githubusercontent.com/edb0468a14d9eebd37516292f26a18d2e6fa5cfdae292eb3b13d6a6abfe86151/68747470733a2f2f706f7365722e707567782e6f72672f626f72616c65732f7969692d7064662f762f756e737461626c652e737667)](https://packagist.org/packages/borales/yii-pdf)[![License](https://camo.githubusercontent.com/d947cfdd19bf190433a8013d6b3ebed45a04fe337aef01cf7ae4651cbcfcdac3/68747470733a2f2f706f7365722e707567782e6f72672f626f72616c65732f7969692d7064662f6c6963656e73652e737667)](https://packagist.org/packages/borales/yii-pdf)

Small Yii extension, that wraps a few PHP libraries (mPDF and HTML2PDF so far) to convert HTML to PDF

### Resources

[](#resources)

- [Yii Framework](http://yiiframework.com/)
- [mPDF](http://www.mpdf1.com/) - is a PHP class to generate PDF files from HTML with Unicode/UTF-8 and CJK support
- [HTML2PDF](http://html2pdf.fr/en/default) - is a PHP class using FPDF for the PHP4 release, and TCPDF for the PHP5 release. It can convert valid HTML and xHTML to PDF

### Requirements

[](#requirements)

- Yii 1.1.9 or above
- [mPDF](http://www.mpdf1.com/mpdf/download) version 5.3 (has been released 2011-07-21) or above
- [HTML2PDF](http://sourceforge.net/projects/phphtml2pdf/) version 4.03 (has been released 2011-05-27) or above

### Official documentation and examples

[](#official-documentation-and-examples)

- mPDF - [manual](http://mpdf1.com/manual/) and [examples](http://www.mpdf1.com/mpdf/examples)
- HTML2PDF - [Wiki](http://wiki.spipu.net/doku.php?id=html2pdf:en:Accueil) and [examples](http://html2pdf.fr/en/example)

### Installation

[](#installation)

- Download and extract extension to the directory `protected/extensions/yii-pdf`
- Download and extract library ([mPDF](http://www.mpdf1.com/mpdf/download) and/or [HTML2PDF](http://sourceforge.net/projects/phphtml2pdf/)) to own directory in catalog `protected/vendors` or set new value for `'librarySourcePath'` parameter in `'params'` array
- Array `'defaultParams'` - this is an array of constructor's default params of selected library. If you want to change default params - you can set them in config file (like shown below). If you do so - **you must keep the order of array items!**
- In your `protected/config/main.php`, add the following:

### Installation (through composer)

[](#installation-through-composer)

- Add to your `composer.json` file the following line `"borales/yii-pdf": "dev-master"`

```
