From 41cd9e4123231fe5489d340b4d06e6c5e2b26f02 Mon Sep 17 00:00:00 2001 From: Luigi Marmo Date: Wed, 7 Oct 2020 13:31:36 +0200 Subject: [PATCH] Invalid characters passed for attempted conversion, these have been ignored .docx generated from TemplateProcessor throws "Invalid characters passed for attempted conversion, these have been ignored" when is converted in PDF. the error is propagated from $cellBgColor = $cellStyle->getBgColor() when hexdec(substr($cellBgColor... is evaluated in vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Element/Table.php --- src/PhpWord/Style/Shading.php | 2 +- src/PhpWord/Style/Shape.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PhpWord/Style/Shading.php b/src/PhpWord/Style/Shading.php index 154df26c7a..35c926e300 100644 --- a/src/PhpWord/Style/Shading.php +++ b/src/PhpWord/Style/Shading.php @@ -128,7 +128,7 @@ public function setColor($value = null) */ public function getFill() { - return $this->fill; + return $this->fill == "auto" ? null : $this->fill; } /** diff --git a/src/PhpWord/Style/Shape.php b/src/PhpWord/Style/Shape.php index 0c3f817982..e45b86073a 100644 --- a/src/PhpWord/Style/Shape.php +++ b/src/PhpWord/Style/Shape.php @@ -168,7 +168,7 @@ public function setFrame($value = null) */ public function getFill() { - return $this->fill; + return $this->fill == "auto" ? null : $this->fill; } /**