PHPOffice / PHPWord

A pure PHP library for reading and writing word processing documents
https://phpoffice.github.io/PHPWord/
Other
7.22k stars 2.69k forks source link

Word Chinese PDF contains garbled code #2033

Open wuxian12 opened 3 years ago

wuxian12 commented 3 years ago

Word content contains Chinese, when converted to PDF, all Chinese show ???

khongshao commented 3 years ago

以MPDF为例,在vendor/phpoffice/phpword/src/PhpWord/Writer/PDF/MPDF.php,73行后面加上$pdf->autoScriptToLang = true; $pdf->autoLangToFont = true;,就可以解决乱码问题