how to set mpdf HTML contains invalid UTF-8 character(s) when you create pdf on your appliactions
Try this
$html = mb_convert_encoding($html, 'UTF-8', 'UTF-8');
before calling: "$mpdf->WriteHTML($html);"
It's seems senseless, but it works for me.
The below two lines will do the trick
$mpdf->allow_charset_conversion = true;
$mpdf->charset_in = 'iso-8859-4';
Add the above two lines after creating the object , this will look like
$mpdf=new mPDF();
$mpdf->allow_charset_conversion = true;
$mpdf->charset_in = 'iso-8859-4';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With