Download the PHP package heimrichhannot/pdf-creator without Composer
On this page you can find all versions of the php package heimrichhannot/pdf-creator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download heimrichhannot/pdf-creator
More information about heimrichhannot/pdf-creator
Files in heimrichhannot/pdf-creator
Package pdf-creator
Short Description PdfCreator is a high level API for PDF file creating with PHP.
License LGPL-3.0-or-later
Informations about the package pdf-creator
PDF Creator
PdfCreator is a high level API for PDF file creating with PHP. Its goal is to make usage of existing libraries easier and object-orientated.
Features
Example
Usage
Install
We recommend installing this library with composer:
composer require heimrichhannot/pdf-creator
You also need to install the pdf library, you want to use this bundle with:
- Dompdf (version 1 to 3 are supported):
"dompdf/dompdf": "^3.0"
- if you want to use master templates in Dompdf, you also need FPDI and TCPDF:
"tecnickcom/tcpdf": "^6.3"
"setasign/fpdi": "^2.3"
- mPDF (version 7 and 8 are supported):
"mpdf/mpdf": "^8.0"
- TCPDF
"tecnickcom/tcpdf": "^6.3"
- if you want to use master templates in TCPDF, you also need FPDI:
"setasign/fpdi": "^2.3"
If you're using Contao, you could try the PDF Creator Bundle, which is based on this library.
Use callback for custom adjustments
Due the high level approach not all specific library functionality could be supported. To add specific configuration, you can use the callback mechanism comes with this api.
Callback | Description |
---|---|
BeforeCreateLibraryInstanceCallback | Is evaluated before the library instance is created and allows to modifiy the constructor parameters. |
BeforeOutputPdfCallback | Is evaluated before the library method to output the pdf is called and provide the library instance and the output method parameters. |
Use return value
The render method return an PdfCreatorResult
instance. It contains the output
mode and filepath or filecontent for corresponding output modes.
Documentation
All versions of pdf-creator with dependencies
psr/log Version ^1.0 || ^2.0 || ^3.0
ausi/slug-generator Version ^1.1
symfony/filesystem Version ^3.4 || ^4.0 || ^5.0 || ^6.0