Finally, I found an open-source program developed based on the FPDF and HTML2FPDF source code. It basically solves the problem of garbled characters in Chinese (as well as Japanese, Korean, and Southeast Asia and global languages). It is available in Windows/Linux development environment and does not need to be installed with other components, it is a good news for website developers without VPS and independent servers.
Not much said, the source code name is MPDF, the official address is: http://www.mpdf1.com/has been updated to version 5.6.
Download it from the official website, decompress it to the website directory, and use it.
|The code is as follows:||Copy code|
PASS: it should be noted that the php file is a UTF-8. You don't have to worry about the code posted by the sky. When you write a box with garbled text, you can go to config. php $ this-> useAdobeCJK = false; changed to true or must be noted: $ mpdf-> useAdobeCJK = true; official documentation, you can find it on your own.
This is not a perfect method. MPDF can only parse relatively simple css (it cannot parse ul li and other labels in js and css ). Now that the wkhtmltoimage extension is used, you do not care about the use of wkhtmltopdf.
Similarly, wkhtmltoimage 0.11 may cause an error. You need to download Version 0.10.0 _ rc2.
Tar jxf wkhtmltopdf-0.10.0_rc2-static-i386.tar.bz2
Mv wkhtmltoimage-0.10.0_rc2-static-amd64.tar.bz2 wkhtmltoimage-0.10.0_rc2-static-amd64.tar
Music wkhtmltoimage-amd64/usr/bin/wkhtmltopdf test wkhtmltopdf http: // www. your domain name. com/your domain name php shell_exec () execute shell_exec ('/usr/local/bin/wkhtmltopdf http: // www. your domain name. com // usr/local/wwwroot/your domain name. com/your domain name '); do you want to save your favorite articles? Associate now or create an account without searching?
No longer prompt!