PHP HTMLtoPDF is not working and returning only empty PDFs -
PHP HTMLtoPDF is not working and returning only empty PDFs -
i have downloaded php htmltopdf converter here. when tried print single line output, not print in output pdf. empty.
below code tried.
$content1 = "<page><a>sample pdf file</a></page>"; // convert in pdf require_once('/home/www/apis/html2pdf_v4.03/html2pdf.class.php'); seek { $html2pdf = new html2pdf('p', 'a4', 'fr'); $html2pdf->setmodedebug(); $html2pdf->setdefaultfont('arial'); $html2pdf->writehtml($content1); $html2pdf->output('exemple00.pdf'); } catch(html2pdf_exception $e) { echo $e; exit; }
whenever problem simplify. exterminate possibilities hinder workings of program.
with in mind have looked @ website and, you, found sample piece.
$html2pdf = new html2pdf('p','a4','fr'); $html2pdf->writehtml("text"); $html2pdf->output('exemple.pdf');
try , see if works. why? simplest of setups. if not work know it's not (or refrence class wrong).
what know pdf html creators have problem converting wrong html pdf. in case "a" interpreted wrong seeing has no href (which required).
so create simple utilize single line of string text without html "test" , check us. if doesn't work i's suggest using of converters (which recommend anyway).
btw, utilize https://github.com/dompdf/dompdf advanced in html error detection , mutual options.
php pdf wkhtmltopdf html-to-pdf
Comments
Post a Comment