mpdf export chinese character

来源:互联网 发布:知乎 装修公司 挑选 编辑:程序博客网 时间:2024/05/07 12:33

mpdf export chinese char:
vendor/mpdf/mpdf/config.php, change below two line to true, for v6

$this->autoScriptToLang = true;$this->autoLangToFont = true;

autoScriptToLang is variable to indicate whether add below inline style to no-ascii char in html source;

<span lang="und-Hans" class="lang_und-Hans"></span>Yii2 Grid<span lang="und-Hans" class="lang_und- Hans">导出的</span>

autoLangToFont is a variable to indicate whether to choose font with upper’s inline style’s data;

for chinese:
useAdobeCJK is true: font is gb/big5. it will use adobe’s cjk font
useAdobeCJK is false: font will be Sun-ExtA.ttf

usingCoreFont: if there exist font-family style in html content, mpdf will try to resolve it to it’s inner font, if this process is success, the set this variable to true;

v5 maybe need change:

$this->useAdobeCJK = true;

mpdf’s font issue, can only set font to mpdf’s font, if you want to user system font, you should change it’s code

0 0
原创粉丝点击