HTML to PDF (using DOMPDF) – PHP
August 28th, 2008 13 comments
After using the FPDF library, I came to know that making PDF using the same is so time consuming. And some time it is not possible to develop the report as per the users requirement because of its limitation. Then I found the DOMPDF library in which we just need to pass the HTML code as string to the its class and the PDF will be generated. Even thought it has some limitations but for some level this is the best way of generating PDF through PHP.
The link and the example for this is as given below:
http://www.digitaljunkies.ca/dompdf/
<?php
require_once("dompdf_config.inc.php");
$html = '<html><body>'.
'<p>Put your html here, or generate it with your favourite '.
'templating system.</p>'.
'</body></html>';
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("sample.pdf");
?>
so guys take the advantage of such a nice efforts…
..
Categories: Open Source, programming advantage, body, config, config php, dompdf, example, favourite, generating, HTML, html code, html pdf, html to pdf, inc, level, library, limitation, link, load, lt, PHP, php html, PHP to PDF, report, requirement, sample, site, site php, stream, string, string class, System, time, time consuming, way, www ca