From 8c95d88d54b1b275cd23fd79293ed67d521849ce Mon Sep 17 00:00:00 2001 From: tmbenhura Date: Thu, 12 Jun 2025 16:49:59 +0200 Subject: [PATCH 01/11] Preserving percentage gradient decimals and correctly clamp coordinates --- tcpdf.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tcpdf.php b/tcpdf.php index 42c425e9..9588a907 100644 --- a/tcpdf.php +++ b/tcpdf.php @@ -23500,7 +23500,8 @@ protected function setSVGStyles($svgstyle, $prevsvgstyle, $x=0, $y=0, $w=1, $h=1 $gradient['coords'][4] /= $w; } elseif ($gradient['mode'] == 'percentage') { foreach($gradient['coords'] as $key => $val) { - $gradient['coords'][$key] = (intval($val) / 100); + $val = floatval($val) / 100; + $gradient['coords'][$key] = $val; if ($val < 0) { $gradient['coords'][$key] = 0; } elseif ($val > 1) { From 0cc9525c97ea2ac7455f534e4aeb1dccb465f225 Mon Sep 17 00:00:00 2001 From: "Dominik Scholz (go4u.de Webdesign)" Date: Wed, 2 Jul 2025 16:21:56 +0200 Subject: [PATCH 02/11] Enabled compression for PDF/A-3 --- tcpdf.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tcpdf.php b/tcpdf.php index 42c425e9..d3f4b3c7 100644 --- a/tcpdf.php +++ b/tcpdf.php @@ -2910,9 +2910,7 @@ public function setCompression($compress=true) { $this->compress = false; if (function_exists('gzcompress')) { if ($compress) { - if ( !$this->pdfa_mode) { - $this->compress = true; - } + $this->compress = true; } } } @@ -5001,11 +4999,10 @@ protected function _putEmbeddedFiles() { $filter = ''; if ($this->compress) { $data = gzcompress($data); - $filter = ' /Filter /FlateDecode'; + $filter .= ' /Filter /FlateDecode'; } - if ($this->pdfa_version == 3) { - $filter = ' /Subtype /text#2Fxml'; + $filter .= ' /Subtype /text#2Fxml'; } $stream = $this->_getrawstream($data, $filedata['n']); From 949eee53f70af725a1942a298c366ffe15cd88b9 Mon Sep 17 00:00:00 2001 From: Danilo Cicognani Date: Fri, 25 Jul 2025 11:36:53 +0200 Subject: [PATCH 03/11] Fix image on footer problems If you put images on footer, when you create multiple pages pdf, in all pages but last, the images are often printed rotated and with wrong dimensions. This is because we have a PageBreakTrigger that involves the inner content, but we should avoid this operations on footer images that are not involved in page break and should by printed in the same way in first, inner and last pages. --- tcpdf.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tcpdf.php b/tcpdf.php index 42c425e9..e5ae1acc 100644 --- a/tcpdf.php +++ b/tcpdf.php @@ -6925,8 +6925,8 @@ protected function fitBlock($w, $h, $x, $y, $fitonpage=false) { // fallback to avoid division by zero $h = $h == 0 ? 1 : $h; $ratio_wh = ($w / $h); - if (($y + $h) > $this->PageBreakTrigger) { - $h = $this->PageBreakTrigger - $y; + if (($y + $h) > $this->PageBreakTrigger + $this->bMargin) { + $h = $this->PageBreakTrigger + $this->bMargin - $y; $w = ($h * $ratio_wh); } if ((!$this->rtl) AND (($x + $w) > ($this->w - $this->rMargin))) { From c5b53f58e1bccabcdf8d2b091d5ac3d94e164ce8 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 6 Oct 2025 11:18:46 +0200 Subject: [PATCH 04/11] Fix bad `text-align` from HTML source In case the `text-align` attribute is badly defined in the HTML, PHP raise an error: `Warning: Uninitialized string offset 0` --- examples/example_001.php | 2 +- tcpdf.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/example_001.php b/examples/example_001.php index 82555e6b..b97be8e9 100644 --- a/examples/example_001.php +++ b/examples/example_001.php @@ -92,7 +92,7 @@

Welcome to  TCPDF !

This is the first example of TCPDF library.

This text is printed using the writeHTMLCell() method but you can also use: Multicell(), writeHTML(), Write(), Cell() and Text().

-

Please check the source code documentation and other examples for further information.

+

Please check the source code documentation and other examples for further information.

TO IMPROVE AND EXPAND TCPDF I NEED YOUR SUPPORT, PLEASE MAKE A DONATION!

EOD; diff --git a/tcpdf.php b/tcpdf.php index 42c425e9..64867f2f 100644 --- a/tcpdf.php +++ b/tcpdf.php @@ -16918,7 +16918,7 @@ protected function getHtmlDomArray($html) { $dom[$key]['height'] = $dom[$key]['style']['height']; } // check for text alignment - if (isset($dom[$key]['style']['text-align'])) { + if (isset($dom[$key]['style']['text-align'][0])) { $dom[$key]['align'] = strtoupper($dom[$key]['style']['text-align'][0]); } // check for CSS border properties From e0e9f649ad12262ed20d1829cf4ae94c7b5b1b43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20E=C3=9Fl?= Date: Mon, 10 Nov 2025 13:26:54 +0100 Subject: [PATCH 05/11] Fix PHP 8.5 deprecation for xml_parser_free Add php version check to xml_parser_free() for PHP 8.5 compatibility. --- tcpdf.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tcpdf.php b/tcpdf.php index 42c425e9..f1ef20c7 100644 --- a/tcpdf.php +++ b/tcpdf.php @@ -23268,8 +23268,11 @@ public function ImageSVG($file, $x=null, $y=null, $w=0, $h=0, $link='', $align=' $error_message = sprintf('SVG Error: %s at line %d', xml_error_string(xml_get_error_code($parser)), xml_get_current_line_number($parser)); $this->Error($error_message); } - // free this XML parser - xml_parser_free($parser); + + // free this XML parser (does nothing in PHP >= 8.0) + if (function_exists('xml_parser_free') && PHP_VERSION_ID < 80000) { + xml_parser_free($parser); + } // >= PHP 7.0.0 "explicitly unset the reference to parser to avoid memory leaks" unset($parser); From 3e980e1f837ca7b29a7b7c8a5b0b5c0f2e725b19 Mon Sep 17 00:00:00 2001 From: chris Date: Thu, 20 Nov 2025 20:50:44 +0100 Subject: [PATCH 06/11] cI: Add 8.5 to CI matrix --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b406fd66..ebed410e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,7 +22,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: ["7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"] + php-version: ["7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4"] os: [ubuntu-latest] experimental: [false] php-extensions: ["bcmath, curl, imagick, gd"] @@ -31,7 +31,7 @@ jobs: include: #- { php-version: '8.2', experimental: false, os: macos-latest, php-extensions: 'bcmath, curl, imagick, gd', coverage-extension: 'none' } - { php-version: '8.2', experimental: false, os: windows-latest, php-extensions: 'bcmath, curl, imagick, gd', coverage-extension: 'none' } - - { php-version: '8.4', experimental: true, os: ubuntu-latest, php-extensions: 'bcmath, curl, imagick, gd', coverage-extension: 'pcov' } + - { php-version: '8.5', experimental: true, os: ubuntu-latest, php-extensions: 'bcmath, curl, imagick, gd', coverage-extension: 'pcov' } - { php-version: 'nightly', experimental: true, os: ubuntu-latest, php-extensions: 'bcmath, curl, imagick, gd', coverage-extension: 'pcov' } env: PDFINFO_BINARY: ${{ (matrix.os == 'ubuntu-latest') && '/usr/bin/pdfinfo' || ((matrix.os == 'macos-latest') && '/usr/local/bin/pdfinfo' || 'C:\ProgramData\Chocolatey\bin\pdfinfo.exe') }} From e7ad470e33769fe4809234b090df0b8569c54b71 Mon Sep 17 00:00:00 2001 From: Nicola Asuni Date: Fri, 21 Nov 2025 10:16:36 +0000 Subject: [PATCH 07/11] remove typo --- tcpdf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcpdf.php b/tcpdf.php index 42c425e9..c78f7c09 100644 --- a/tcpdf.php +++ b/tcpdf.php @@ -24737,7 +24737,7 @@ protected function startSVGElementHandler($parser, $name, $attribs, $ctm=array() */ protected function endSVGElementHandler($parser, $name) { $name = $this->removeTagNamespace($name); - if ($this->svgdefsmode AND !in_array($name, array('defs', 'clipPath', 'linearGradient', 'radialGradient', 'stop'))) {; + if ($this->svgdefsmode AND !in_array($name, array('defs', 'clipPath', 'linearGradient', 'radialGradient', 'stop'))) { if (end($this->svgdefs) !== FALSE) { $last_svgdefs_id = key($this->svgdefs); if (isset($this->svgdefs[$last_svgdefs_id]['attribs']['child_elements'])) { From 101bb16cca70e418516ee419debb49521685dee9 Mon Sep 17 00:00:00 2001 From: Nicola Asuni Date: Fri, 21 Nov 2025 10:38:53 +0000 Subject: [PATCH 08/11] bump version --- CHANGELOG.TXT | 7 +++++++ VERSION | 2 +- composer.json | 2 +- include/tcpdf_static.php | 2 +- tcpdf.php | 8 ++++---- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 5d560d0a..bb89cefe 100644 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -1,3 +1,10 @@ +6.10.1 (2025-11-21) + - cI: Add 8.5 to CI matrix - PR #836 + - Fix PHP 8.5 deprecation for xml_parser_free - PR #835 + - Fix bad text-align from HTML source - PR #833 + - Fix image on footer problems - PR #823 + - Preserving percentage gradient decimals and correctly clamp coordinates - PR #815 + 6.10.0 (2025-05-27) - Embedded files support (Factur-X 1.07 / ZUGFeRD 2.3) #789 diff --git a/VERSION b/VERSION index cf79bf90..3094a4c6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.10.0 +6.10.1 diff --git a/composer.json b/composer.json index 8d779197..abf4d9b6 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "barcodes" ], "homepage": "http://www.tcpdf.org/", - "version": "6.10.0", + "version": "6.10.1", "license": "LGPL-3.0-or-later", "authors": [ { diff --git a/include/tcpdf_static.php b/include/tcpdf_static.php index efadc925..296e04dd 100644 --- a/include/tcpdf_static.php +++ b/include/tcpdf_static.php @@ -55,7 +55,7 @@ class TCPDF_STATIC { * Current TCPDF version. * @private static */ - private static $tcpdf_version = '6.10.0'; + private static $tcpdf_version = '6.10.1'; /** * String alias for total number of pages. diff --git a/tcpdf.php b/tcpdf.php index f833480c..306d9914 100644 --- a/tcpdf.php +++ b/tcpdf.php @@ -1,9 +1,9 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 6.10.0 + * @version 6.10.1 */ // TCPDF configuration @@ -128,7 +128,7 @@ * TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.
* @package com.tecnick.tcpdf * @brief PHP class for generating PDF documents without requiring external extensions. - * @version 6.10.0 + * @version 6.10.1 * @author Nicola Asuni - info@tecnick.com * @IgnoreAnnotation("protected") * @IgnoreAnnotation("public") From a9b33cf84d9cd71e1f39356c5975d042e34225b3 Mon Sep 17 00:00:00 2001 From: Nicola Asuni Date: Fri, 21 Nov 2025 10:45:05 +0000 Subject: [PATCH 09/11] update github actions --- .github/workflows/lint-docs.yml | 2 +- .github/workflows/tests.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint-docs.yml b/.github/workflows/lint-docs.yml index db0a86cf..f5eac53a 100644 --- a/.github/workflows/lint-docs.yml +++ b/.github/workflows/lint-docs.yml @@ -15,7 +15,7 @@ jobs: lint-docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: lint php documentation uses: sudo-bot/action-doctum@dev with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ebed410e..477e4bcd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,7 +36,7 @@ jobs: env: PDFINFO_BINARY: ${{ (matrix.os == 'ubuntu-latest') && '/usr/bin/pdfinfo' || ((matrix.os == 'macos-latest') && '/usr/local/bin/pdfinfo' || 'C:\ProgramData\Chocolatey\bin\pdfinfo.exe') }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Install pdfinfo, pdftopng or pdftoppm uses: ConorMacBride/install-package@v1 with: @@ -90,7 +90,7 @@ jobs: # For debugging issues - name: Archive test results if: failure() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 with: name: test-run-output-${{ matrix.php-version }}-${{ matrix.os }} retention-days: 1 @@ -100,7 +100,7 @@ jobs: name: Static Analysis runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Use php 8.2 uses: shivammathur/setup-php@v2 with: From 2f6b25749a9de1346f493b84a84d4e264c7620e4 Mon Sep 17 00:00:00 2001 From: Nicola Asuni Date: Fri, 21 Nov 2025 10:47:04 +0000 Subject: [PATCH 10/11] use doctum v5 --- .github/workflows/lint-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-docs.yml b/.github/workflows/lint-docs.yml index f5eac53a..fe3dcc9c 100644 --- a/.github/workflows/lint-docs.yml +++ b/.github/workflows/lint-docs.yml @@ -17,7 +17,7 @@ jobs: steps: - uses: actions/checkout@v5 - name: lint php documentation - uses: sudo-bot/action-doctum@dev + uses: sudo-bot/action-doctum@v5 with: config-file: scripts/doctum.php method: "parse" From ebd81c19154c6d2b9c22161481c3f672116f437a Mon Sep 17 00:00:00 2001 From: Nicola Asuni Date: Fri, 21 Nov 2025 10:53:38 +0000 Subject: [PATCH 11/11] update changelog with new pr --- CHANGELOG.TXT | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index bb89cefe..2394117a 100644 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -4,6 +4,7 @@ - Fix bad text-align from HTML source - PR #833 - Fix image on footer problems - PR #823 - Preserving percentage gradient decimals and correctly clamp coordinates - PR #815 + - Enables compression for PDF/A - PR #820 6.10.0 (2025-05-27) - Embedded files support (Factur-X 1.07 / ZUGFeRD 2.3) #789