vixriihi / html2pdf
php wrapper to wkhtmltopdf
dev-master
2015-01-27 13:22 UTC
Requires
- php: >=5.4.0
This package is not auto-updated.
Last update: 2026-03-29 01:34:26 UTC
README
This is a php wrapper for wkhtmltopdf.
Requirements
- php > 5.4.0
- wkhtmltopdf
Basic usage
use Vixriihi\Html2Pdf; $html = '<h1>Working</h1>'; $html2pdf = new Html2Pdf(); $pdf = $html2pdf->convert($html); header("Content-type: application/octet-stream"); header("Content-disposition: attachment;filename=hmtl.pdf"); echo $pdf;
All options for wkhtmltopdf are accessible with method setParameter
$html2pdf = new Html2Pdf(); $html2pdf->setParam('page-size','A3'); $html2pdf->setParam('dpi',96);