From 801296e146bb0979f4324e7225dc450a31c0bf59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20Cesar=20Laura=20Avenda=C3=B1o?= Date: Thu, 27 Aug 2020 20:42:51 +0000 Subject: [PATCH] PMCORE-2100 --- workflow/engine/classes/model/OutputDocument.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/workflow/engine/classes/model/OutputDocument.php b/workflow/engine/classes/model/OutputDocument.php index 37c3b8068..553cca14c 100644 --- a/workflow/engine/classes/model/OutputDocument.php +++ b/workflow/engine/classes/model/OutputDocument.php @@ -797,6 +797,9 @@ class OutputDocument extends BaseOutputDocument */ public function generateTcpdf($outDocUid, $fields, $path, $filename, $content, $landscape = false, $properties = []) { + // Check and prepare the fonts path used by TCPDF library + self::checkTcpdfFontsPath(); + // Including the basic configuration for the TCPDF library require_once PATH_TRUNK . "vendor" . PATH_SEP . "tecnickcom" . PATH_SEP . "tcpdf" . PATH_SEP . "config" . PATH_SEP . "tcpdf_config.php"; @@ -925,16 +928,6 @@ class OutputDocument extends BaseOutputDocument // Enable the font sub-setting option $pdf->setFontSubsetting(true); - // Set unicode font if is required, we need to detect if is chinese, japanese, thai, etc. - if (preg_match('/[\x{30FF}\x{3040}-\x{309F}\x{4E00}-\x{9FFF}\x{0E00}-\x{0E7F}]/u', $content, $matches)) { - // The additional fonts should be in "shared/fonts" folder - $fileArialUniTTF = PATH_DATA . "fonts" . PATH_SEP . "arialuni.ttf"; - if (file_exists($fileArialUniTTF)) { - $font = TCPDF_FONTS::addTTFfont($fileArialUniTTF, 'TrueTypeUnicode'); - $pdf->SetFont($font); - } - } - // Convert the encoding of the content if is UTF-8 if (mb_detect_encoding($content) == 'UTF-8') { $content = mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8');