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