Download the PHP package tarfin-labs/easy-pdf without Composer
On this page you can find all versions of the php package tarfin-labs/easy-pdf. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tarfin-labs/easy-pdf
More information about tarfin-labs/easy-pdf
Files in tarfin-labs/easy-pdf
Package easy-pdf
Short Description Makes pdf processing easy.
License MIT
Homepage https://github.com/tarfin-labs/easy-pdf
Informations about the package easy-pdf
easy-pdf
Introduction
easy-pdf is a tcpdf wrapper for Laravel 6.x, 7.x, 8.x, 9.x, 10.x, 11.x.
Installation
You can install the package via composer:
Usage
Creating pdf with html.
You can create a pdf with html. Easy-pdf also provides easy configuration with tcpdf pdf settings and informations.
This will return pdf content as a string. If you want save pdf, use save method:
Also you can stream pdf directly to the browser using stream method:
You can add custom TTF font using addFont or use default fonts:
If you want the use default fonts, here is the list:
courier
, courierB
, courierBI
, courierI
, helvetica
, helveticaB
, helveticaBI
, helveticaI
, symbol
, times
, timesB
, timesBI
, timesI
, zapfdingbats
Easy pdf provides barcode and qrcode support.
You can add image to the pdf with dimensions.
You can set active page using setPage()
method.
You can set margins using setMargins()
method.
You can add image to page header using setHeaderData()
method.
You can set header margin using setHeaderMargin()
method.
You can set test and line colors of footer using setFooterData()
method.
You can set footer margin using setFooterMargin()
method.
You can set footer font using setFooterFontSize()
method.
You can set paper handling option to use when printing the file from the print dialog.
You can add
Parsing pdf
You can parse the pdf and get the page you want.
Merging pdf
You can merge multiple pdf into the one with easily using easy-pdf.
Splitting pdf
You can split pdf file into multiple pdf files easily using easy-pdf.
Resetting the instance
If you try to generate pdf inside a Laravel queue, sometimes there might occure an error like undefined property: TCPDF::$h
.
The error occurs 2nd time you use the EasyPdf facade after you already created a PDF. Since EasPdf service is registered as singleton to the service container, it returns the same instance when you use it 2nd time and somehow it's broken.
To avoid the error which mentioned above you can use reset()
method in the beginning. This will return a new TCPDF instance.
Pdf Header and Setter
After using reset()
method for creating new Tcpdf instance for each page, automatically header line added to Pdf. Whether you want or not you can use setHeader' for print header or
setFooter` for print footer content.
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update the tests as appropriate.
Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
Credits
- Faruk Can
- Yunus Emre Deligöz
- Hakan Özdemir
- Turan Karatuğ
- All Contributors
License
easy-pdf is open-sourced software licensed under the MIT license.
All versions of easy-pdf with dependencies
illuminate/support Version 6.11.0|^7.0|^8.0|^9.0|^10.0|^11.0
setasign/fpdi-tcpdf Version ^2.2
tecnickcom/tcpdf Version ^6.3
ext-fileinfo Version *