Ask html to convert to pdf Chinese is all question mark solution html2fpdf convert simple html to pdf Chinese garbled characters I am not sure, changed to html2pdf
Vendor('html2).html 2pdf ');
$ Html2pdf = new HTML2PDF ('P', 'A4 ', 'Fr', true, 'utf-8', array (30, 20, 25, 25 ));
$ Html2pdf-> parsingCss-> fontSet ('javusans ');
$ Html2pdf-> WriteHTML ("
Come out, big brother.
This is a test ");
$ Html2pdf-> Output ("sample.pdf", 'I ');
Echo "PDF file is generated successfully! ";
The Chinese characters are all question marks.
You guys, how can we solve this problem? I can't help you.
Reply to discussion (solution)
What is your HTML2PDF version?
Vendor('html2).html 2pdf '); what framework is used, and plug-ins are not fixed for you. what is the purpose of this framework?
I didn't understand the specific version.
Define ('_ CLASS_HTML2PDF _', '4. 03 ');
Define ('html2pdf _ used_tc1__version ', '5. 0.002 ');
ThinkPHP framework used
What is your HTML2PDF version?
Vendor('html2).html 2pdf '); what framework is used, and plug-ins are not fixed for you. what is the purpose of this framework?
This is because you do not have the DejaVuSans font, and it is also a bit difficult to write.
You can refer to the example file examples/utf8.php provided by him.
And set style = "font-family: freeserif">
Change to style = "font-family: stsongdlight"
There are many online introductions on how to use other fonts.
Thank you very much. I have only been working for two months. The foundation is really bad.
Thank you for your guidance.