PDF导出中文 洗衣液厂家(品牌;海依恋+纤维大师�<br>�� 登录后复制 Invalid input characters. Did you set $mpdf->in_charset properly? 1. 解决方案 登录后复制 #Try this $html = mb_convert_encoding($html, 'UTF-8', 'UTF-8'); #before calling: "$mpdf->WriteHTML($html);" #It's seems senseless, but it works for me. 1.2.3.4.5.6.7. demo 登录后复制 $html = __DIR__.DIRECTORY_SEPARATOR.'pdf.html'; $html = mb_convert_encoding($html, 'UTF-8', 'UTF-8'); $mPdf = new Mpdf(defaultPdfConfig()); $mPdf->WriteHTML($html); $fileDir = './tinywan.pdf'; $mPdf->Output($fileDir, Destination::FILE); 1.2.3.4.5.6. 原创作者: tinywan 转载于: https://blog.51cto.com/tinywan/11715703