diff --git a/config/dompdf.php b/config/dompdf.php index 9a99305..c8645d3 100644 --- a/config/dompdf.php +++ b/config/dompdf.php @@ -13,6 +13,10 @@ */ 'show_warnings' => false, // Throw an Exception on warnings from dompdf 'orientation' => 'portrait', + /* + * Dejavu Sans font is missing glyphs for converted entities, turn it off if you need to show € and £. + */ + 'convert_entities' => true, 'defines' => array( /** * The location of the DOMPDF font directory diff --git a/src/PDF.php b/src/PDF.php index f31b421..04fc8e7 100644 --- a/src/PDF.php +++ b/src/PDF.php @@ -255,8 +255,11 @@ public function setEncryption($password, $ownerpassword = '', $pc = []) return $this->dompdf->getCanvas()->get_cpdf()->setEncryption($password, $ownerpassword, $pc); } - protected function convertEntities($subject) + protected function convertEntities($subject) { + if (false === $this->config->get('dompdf.convert_entities', true)) { + return $subject; + } $entities = array( '€' => '€',