I am using mPDF to save form input data to PDF. For English, it is working fine. Anyone can use this code to save HTML Form data to PDF.
Issue: In order to fulfill m
Do not use 'c'
as a $mode
parameter, that means PDF core fonts only and they do not support chinese characters.
Try '+aCJK'
or '-aCJK'
instead.
See example – files using chinese font.
My Code is as follow [mpdf v7.0 from composer]
<?php
require_once './vendor/autoload.php';
//report errors
error_reporting(E_ALL);
ini_set("display_errors", 1);
$config = [
'mode' => '+aCJK',
// "allowCJKoverflow" => true,
"autoScriptToLang" => true,
// "allow_charset_conversion" => false,
"autoLangToFont" => true,
];
$mpdf=new \Mpdf\Mpdf($config);
$mpdf->WriteHTML('Hello World 中文');
$mpdf->Output();
This code works fine, you can try it