Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/lint-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ 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
uses: sudo-bot/action-doctum@v5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good, a new version will be out soon. TCPDF has basic docs so everything is good for now

with:
config-file: scripts/doctum.php
method: "parse"
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -31,12 +31,12 @@ 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') }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Install pdfinfo, pdftopng or pdftoppm
uses: ConorMacBride/install-package@v1
with:
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.TXT
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
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
- Enables compression for PDF/A - PR #820

6.10.0 (2025-05-27)
- Embedded files support (Factur-X 1.07 / ZUGFeRD 2.3) #789

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.10.0
6.10.1
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand Down
2 changes: 1 addition & 1 deletion examples/example_001.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<h1>Welcome to <a href="http://www.tcpdf.org" style="text-decoration:none;background-color:#CC0000;color:black;">&nbsp;<span style="color:black;">TC</span><span style="color:white;">PDF</span>&nbsp;</a>!</h1>
<i>This is the first example of TCPDF library.</i>
<p>This text is printed using the <i>writeHTMLCell()</i> method but you can also use: <i>Multicell(), writeHTML(), Write(), Cell() and Text()</i>.</p>
<p>Please check the source code documentation and other examples for further information.</p>
<p style="text-align: ;">Please check the source code documentation and other examples for further information.</p>
<p style="color:#CC0000;">TO IMPROVE AND EXPAND TCPDF I NEED YOUR SUPPORT, PLEASE <a href="http://sourceforge.net/donate/index.php?group_id=128076">MAKE A DONATION!</a></p>
EOD;

Expand Down
2 changes: 1 addition & 1 deletion include/tcpdf_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
35 changes: 18 additions & 17 deletions tcpdf.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
//============================================================+
// File name : tcpdf.php
// Version : 6.10.0
// Version : 6.10.1
// Begin : 2002-08-03
// Last Update : 2025-05-27
// Last Update : 2025-11-21
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
Expand Down Expand Up @@ -104,7 +104,7 @@
* Tools to encode your unicode fonts are on fonts/utils directory.</p>
* @package com.tecnick.tcpdf
* @author Nicola Asuni
* @version 6.10.0
* @version 6.10.1
*/

// TCPDF configuration
Expand All @@ -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.<br>
* @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")
Expand Down Expand Up @@ -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;
}
}
}
Expand Down Expand Up @@ -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']);
Expand Down Expand Up @@ -6925,8 +6922,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))) {
Expand Down Expand Up @@ -16918,7 +16915,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
Expand Down Expand Up @@ -23268,8 +23265,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);
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -24737,7 +24738,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'])) {
Expand Down
Loading