I am using mpdf. When I try to write chinese words to the WriteHtml(), the resulting pdf containing square boxes instead of those fonts.
require 'mpdf/mpdf.php';
$mpdf->allow_charset_conversion = false;
$pdf = $this->pdf->load();
$pdf->useAdobeCJK = true;
$pdf->SetAutoFont(AUTOFONT_ALL);
$mpdf = new \Mpdf\Mpdf(['mode' => 'utf-8']);
$mpdf->SetHeader('|<h2>Booking Invoice</h2>|');
$mpdf->setFooter('{PAGENO}');
$mpdf->autoScriptToLang = true;
$mpdf->autoLangToFont = true;
$mpdf->SetDisplayMode('fullpage');
ob_start();
include "test.php";
$html = ob_get_contents();
ob_end_clean();
$mpdf->WriteHTML($html);
i tried mpdf 6.0 and above version, but still same result
Please advice
Thank you.
Try to:
I fix it, please check this if u have same error
Use mode on object creation
and write your utf-8 content to it