mPDF Manual – mPDF Variables

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 $this->backupSubsFont the config_fonts.php configuration file.

Values

$useSubstitutionsTRUE FALSE

Values

TRUE : enable substitution

FALSE: disable substitution

DEFAULT: FALSE

Changelog

VersionDescription
4.2 Variable was added. Controlled behaviour when using Adobe core fonts
5.0 Changed to control behaviour of multibyte documents

Examples

Example #1

<?php

// Require composer autoload
require_once __DIR__ . '/vendor/autoload.php';

$mpdf = new mPDF('UTF-8');

$mpdf->useSubstitutions = true;

$mpdf->WriteHTML("Hallo World");

$mpdf->Output();

?>