Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yii2tech/html2pdf
Yii2 component for HTML to PDF conversion
https://github.com/yii2tech/html2pdf
html pdf template yii yii2 yii2-extension
Last synced: 4 days ago
JSON representation
Yii2 component for HTML to PDF conversion
- Host: GitHub
- URL: https://github.com/yii2tech/html2pdf
- Owner: yii2tech
- License: other
- Archived: true
- Created: 2016-05-04T12:51:04.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-10-17T11:03:13.000Z (over 5 years ago)
- Last Synced: 2024-09-22T22:01:58.617Z (4 months ago)
- Topics: html, pdf, template, yii, yii2, yii2-extension
- Language: PHP
- Size: 57.6 KB
- Stars: 78
- Watchers: 10
- Forks: 65
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
HTML to PDF conversion extension for Yii2
This extension provides basic support for HTML to PDF and PHP to PDF conversion.
For license information check the [LICENSE](LICENSE.md)-file.
[![Latest Stable Version](https://img.shields.io/packagist/v/yii2tech/html2pdf.svg)](https://packagist.org/packages/yii2tech/html2pdf)
[![Total Downloads](https://img.shields.io/packagist/dt/yii2tech/html2pdf.svg)](https://packagist.org/packages/yii2tech/html2pdf)
[![Build Status](https://travis-ci.org/yii2tech/html2pdf.svg?branch=master)](https://travis-ci.org/yii2tech/html2pdf)Installation
------------The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Either run
```
php composer.phar require --prefer-dist yii2tech/html2pdf
```or add
```json
"yii2tech/html2pdf": "*"
```to the require section of your composer.json.
> Note: you'll have to install software for the actual HTML to PDF conversion separately, depending on the
particular converter, you would like to use.Usage
-----This extension provides support for HTML to PDF and PHP to PDF conversion. It allows composition of the PDF files
from HTML and via rendering PHP templates.Extension functionality is aggregated into `\yii2tech\html2pdf\Manager` application component.
Application configuration example:```php
[
'html2pdf' => [
'class' => 'yii2tech\html2pdf\Manager',
'viewPath' => '@app/views/pdf',
'converter' => 'wkhtmltopdf',
],
],
...
];
```For the simple conversion you can use `\yii2tech\html2pdf\Manager::convert()` and `\yii2tech\html2pdf\Manager::convertFile()` methods:
```php
Simple Content