Recommend this page to a friend! |
Classes of Nahidul Hasan | Laravel and PHP HTML to PDF converter | README.md | Download |
|
![]() Laravel-Html2Pdf> A Simple package for easily generating PDF documents from HTML.This package is specially for laravel but you can use this without laravel. InstallationInstall wkhtmltopdfThis was tested on:
For docker
Upddate Composer
If laravel version < 5.5, add the ServiceProvider to the providers array in config/app.php
You can optionally use the facade for shorter code. Add this to your facades:
Basic UsageTo create PDF add something like this to one of your controllers.
You can also create PDF from directly calling laravel blade file. Suppose you have a mail template named greeting in view/mails folder and want to send parameter then you have to call generatePdf method as described in below
Now If you want to send mail to your client attaching pdf then you can follow this code
Other UsageIt is also possible to use the following methods :
Running without LaravelYou can use this library without using Laravel. Example:
LicenseHtml2PDF for Laravel is open-sourced software licensed under the MIT license |