useSubstitutions
(mPDF ≥ 4.2)
useSubstitutions – Specify whether to substitute missing characters in UTF-8 (multibyte) documents
Description
void useSubstitutions
Specify whether to substitute missing characters in UTF-8(multibyte) documents. Characters which cannot be displayed
in the current set font, will be substituted by characters in the Adobe core fonts (Symbol, Zapfdingbats etc.), or the
backup font(s) specified in the variable in backupSubsFont
configuration variable.
Note: Prior to mPDF 5.0 useSubstitutions controlled the behaviour of character substitution when using Adobe core fonts, and useSubstitutionsMB was used for character susbstitution in multibyte/utf-8 documents. For mPDF ≥ 5.0 character substitution for documents using core fonts is always enabled.
Values
$useSubstitutions = true
|false
Values
true
: enable substitutionfalse
: disable substitution
Default: false
Changelog
Version | Description |
---|---|
4.2 | Variable was added. Controlled behaviour when using Adobe core fonts |
5.0 | Changed to control behaviour of multibyte documents |
Example
<?php
// Require composer autoload
require_once __DIR__ . '/vendor/autoload.php';
$mpdf = new \Mpdf\Mpdf('UTF-8');
$mpdf->useSubstitutions = true;
$mpdf->WriteHTML("Hello World");
$mpdf->Output();
Note: This may add significantly to the processing time for large files.