Html2fpdf Simple HTML to PDF Chinese garbled I can't handle it, I changed it to Html2pdf.
Vendor (' html2pdf.html2pdf ');
$html 2pdf = new Html2pdf (' P ', ' A4 ', ' fr ', true, ' UTF-8 ', Array (30, 20, 25, 25));
$html 2pdf->parsingcss->fontset (' Dejavusans ');
$html 2pdf->writehtml ("
Come out, Big Brother.
This is a test ");
$html 2pdf->output ("Sample.pdf", ' I ');
echo "PDF file is generated successfully!";
The results come out Chinese characters are all question marks
You big God, how to solve AH really no need to ask God to help you I really have no way
Reply to discussion (solution)
What version of your html2pdf is it?
Vendor (' html2pdf.html2pdf '); What frame is used, and even if the plugin does not fix it for you, what is the use of this framework?
I don't understand the exact version, it should be in these two lines.
Define (' __class_html2pdf__ ', ' 4.03 ');
Define (' html2pdf_used_tcpdf_version ', ' 5.0.002 ');
thinkphp framework for the use of
What version of your html2pdf is it?
Vendor (' html2pdf.html2pdf '); What frame is used, and even if the plugin does not fix it for you, what is the use of this framework?
This is because you do not dejavusans this font, but also a bit of a problem with the wording
You can refer to the sample file he provided examples/utf8.php
and will style= "Font-family:freeserif" >
Change to style= "Font-family:stsongstdlight"
As for how to use other fonts, the online introduction of many
Thank you very much, I only took part in the work two months, the foundation is really poor
I really appreciate your guidance.