mPDF Manual – mPDF Variables


(mPDF >= 1.0)


string charset_in

Defines the character encoding of any input HTML. Use it together with $allow_charset_conversion to manually set an input encoding.



Values (case-insensitive)

Any string value allowed which is valid for the PHP function iconv(). This appears to vary depending on the local configuration. See the manual entry for iconv for usual values. You may need to use cp1252 or windows-1252 instead of win-1252, or iso-88591 instead of iso-8859-1.

BLANK or omitted: Expect all text input as UTF-8 encoding.


Example #1


$html = '... the body of the document encoded in ISO-8859-4 ...';

$mpdf = new mPDF();

$mpdf->allow_charset_conversion = true;

$mpdf->charset_in = 'iso-8859-4';




See Also