From 1056a310c938c7bc39d873c337c3fa6bf3e8a686 Mon Sep 17 00:00:00 2001 From: stollr Date: Mon, 11 Mar 2024 23:53:45 +0100 Subject: [PATCH] Fixed handling of transparency in PDF/A mode in addExtGState method The condition allowed to add ExtGState in all PDF/A modes and disallowed in default mode. This fix inlines the condition with setExtGState to allow transparency parameters for non-PDF/A and PDF/A > 1 documents. The state condition is copied from 'setExtGState'. --- tcpdf.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tcpdf.php b/tcpdf.php index 60f93c41..eae6f92c 100644 --- a/tcpdf.php +++ b/tcpdf.php @@ -13936,8 +13936,8 @@ public function setVisibility($v) { * @since 3.0.000 (2008-03-27) */ protected function addExtGState($parms) { - if ($this->pdfa_mode || $this->pdfa_version >= 2) { - // transparencies are not allowed in PDF/A mode + if (($this->pdfa_mode && $this->pdfa_version < 2) || ($this->state != 2)) { + // transparency is not allowed in PDF/A-1 mode return; } // check if this ExtGState already exist