Open fuller2010 opened 4 years ago
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.
composer.json
file on the root of your projectcomposer require spipu/html2pdf
. You will see your composer.json
automatically filling with:{
"require": {
"spipu/html2pdf": "^5.2"
}
}
config.php
enable composer autolad setting this to TRUE
./index.php
:
require __DIR__ . '/vendor/autoload.php';
composer install
.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.
// CONTROLLER <?php defined('BASEPATH') OR exit('No direct script access allowed'); class Main extends CI_Controller {
function __construct() {
} function print_pdf($id_pres='') {
$this->load->library('html2Pdf'); . . . } ?>
//application/libreries <?php defined('BASEPATH') OR exit('No direct script access allowed'); // Dompdf namespace use Spipu\Html2Pdf\Html2Pdf;
class htmlPdf{ public function __construct(){ require_once dirname(FILE).'/vendor/autoload.inc.php'; $htmlpdf = new htmlPdf(); $CI = & get_instance(); $CI->pdf = $htmlpdf ; } }