html2pdf
html2pdf copied to clipboard
how using html2pdf in codeigniter 3
trafficstars
// CONTROLLER
load->library('html2Pdf'); . . . } ?>//application/libreries
pdf = $htmlpdf ; } }
You can try doctron,which supply living demo. Doctron is a Docker-powered,serverless,sample,fast,high quality document convert tool.Supply html convert to pdf(html2pdf), html convert to image(html2image like jpeg,png),which using chrome(Chromium) kernel, add watermarks to pdf, convert pdf to images etc.
- If you don't have it, install Composer.
- Create a
composer.jsonfile on the root of your project - Go through terminal to your project file and run
composer require spipu/html2pdf. You will see yourcomposer.jsonautomatically filling with:
{
"require": {
"spipu/html2pdf": "^5.2"
}
}
- On
config.phpenable composer autolad setting this toTRUE. - Add the following line to your
/index.php:require __DIR__ . '/vendor/autoload.php'; - From your project root, through terminal, run
composer install. - Go to the controller where you want to use html2pdf and add
use Spipu\Html2Pdf\Html2Pdf;right after the<?phptag.
Now you can use html2pdf, you can try it by doing a controller function with the basic test code.