Convert php page to pdf on the fly
13,608
I has some success with HTML2PDF, give it a try. Example:
$content = get_include_contents('/resume.php');
require_once(dirname(__FILE__).'/html2pdf/html2pdf.class.php');
$html2pdf = new HTML2PDF('P', 'A4', 'en');
$html2pdf->WriteHTML($content);
$html2pdf->Output('example.pdf');
Author by
Admin
Updated on June 05, 2022Comments
-
Admin almost 2 years
Possible Duplicate:
Convert HTML + CSS to PDF with PHP?I want to convert page like this http://alexking.org/projects/html-resume-template/demo/resume.php to pdf on the fly by a link inside the page, I tried dompdf but failed to have the result.
-
Arnaud Le Blanc over 12 yearsIt's a PDF generator, it doesn't take HTML/CSS as input
-
Arnaud Le Blanc over 12 yearsIt's a PDF generator, it doesn't take HTML/CSS as input
-
Arnaud Le Blanc over 12 yearsIt's a PDF generator, it doesn't take HTML/CSS as input
-
Admin over 12 yearsif resume.php page on my root, how I can use this to convert the the page resume.php from another php file?
-
matino over 12 yearsCall it as you want but it's able to solve the problem...
-
ldiqual over 12 yearsSee my edited answer for an example.
-
Rebecca almost 11 yearsTCPDF is very good but it's writeHTML() functionality is limited. It doesn't do a great job with tables for example and ignores CSS. I found wkhtmltopdf and Snappy (github.com/KnpLabs/snappy) to be a lot better.