html2pdf
html2pdf copied to clipboard
how using html2pdf in codeigniter 3
// 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.json
file on the root of your project - Go through terminal to your project file and run
composer require spipu/html2pdf
. You will see yourcomposer.json
automatically filling with:
{
"require": {
"spipu/html2pdf": "^5.2"
}
}
- On
config.php
enable 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<?php
tag.
Now you can use html2pdf, you can try it by doing a controller function with the basic test code.