dompdf php乱码,关于 DomPDF 导出中文乱码问题

下面是我自己处理 ubuntu centos 输出 PDF 乱码整理的笔记,你可以试试,好的话给点赞

wget https://dn-weiclicai.qbox.me/xpdf-chinese-simplified.tar.gz

wget https://dn-weiclicai.qbox.me/font.zip

tar zxvf xpdf-chinese-simplified.tar.gz

unzip font.zip

#中文支持安装:

mkdir –p /usr/local/share/xpdf

mv Gbsn00lp.ttf gkai00mp.ttf xpdf-chinese-simplified/CMap/

mv xpdf-chinese-simplified /usr/local/share/xpdf/

cd /usr/local/share/xpdf/xpdf-chinese-simplified

#修改add-to-xpdfrc为如下内容

#----- begin Chinese Simplified support package (2011-sep-02)

cidToUnicode Adobe-GB1 /usr/local/share/xpdf/chinese-simplified/Adobe-GB1.cidToUnicode

unicodeMap ISO-2022-CN /usr/local/share/xpdf/chinese-simplified/ISO-2022-CN.unicodeMap

unicodeMap EUC-CN /usr/local/share/xpdf/chinese-simplified/EUC-CN.unicodeMap

unicodeMap GBK /usr/local/share/xpdf/chinese-simplified/GBK.unicodeMap

cMapDir Adobe-GB1 /usr/local/share/xpdf/chinese-simplified/CMap

toUnicodeDir /usr/local/share/xpdf/chinese-simplified/CMap

displayCIDFontTT Adobe-GB1 /usr/local/share/xpdf/chinese-simplified/CMap/gkai00mp.ttf

#fontFileCC Adobe-GB1 /usr/local/....

#----- end Chinese Simplified support package

你可能感兴趣的:(dompdf,php乱码)