diff --git a/composer.json b/composer.json index 15d7cc979..823217b2d 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "symfony/twig-bundle": "~6.4.0", "symfony/var-dumper": "~6.4.0", "symfony/yaml": "~6.4.0", - "tecnickcom/tcpdf": "~6.4.4", + "tecnickcom/tcpdf": "^6.6.0", "thenetworg/oauth2-azure": "^2.0" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 243b43473..e6523b00f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f2b2656c246be97b7fb58fe614089449", + "content-hash": "f12a58e43bfb3a44aba20a73a8fd747f", "packages": [ { "name": "apereo/phpcas", @@ -4789,16 +4789,16 @@ }, { "name": "tecnickcom/tcpdf", - "version": "6.4.4", + "version": "6.6.5", "source": { "type": "git", "url": "https://github.com/tecnickcom/TCPDF.git", - "reference": "42cd0f9786af7e5db4fcedaa66f717b0d0032320" + "reference": "5fce932fcee4371865314ab7f6c0d85423c5c7ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/42cd0f9786af7e5db4fcedaa66f717b0d0032320", - "reference": "42cd0f9786af7e5db4fcedaa66f717b0d0032320", + "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/5fce932fcee4371865314ab7f6c0d85423c5c7ce", + "reference": "5fce932fcee4371865314ab7f6c0d85423c5c7ce", "shasum": "" }, "require": { @@ -4827,7 +4827,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0-only" + "LGPL-3.0-or-later" ], "authors": [ { @@ -4849,7 +4849,7 @@ ], "support": { "issues": "https://github.com/tecnickcom/TCPDF/issues", - "source": "https://github.com/tecnickcom/TCPDF/tree/6.4.4" + "source": "https://github.com/tecnickcom/TCPDF/tree/6.6.5" }, "funding": [ { @@ -4857,7 +4857,7 @@ "type": "custom" } ], - "time": "2021-12-31T08:39:24+00:00" + "time": "2023-09-06T15:09:26+00:00" }, { "name": "thenetworg/oauth2-azure", diff --git a/lib/composer/installed.json b/lib/composer/installed.json index 500982986..00e24fcf7 100644 --- a/lib/composer/installed.json +++ b/lib/composer/installed.json @@ -5202,23 +5202,23 @@ }, { "name": "tecnickcom/tcpdf", - "version": "6.4.4", - "version_normalized": "6.4.4.0", + "version": "6.6.5", + "version_normalized": "6.6.5.0", "source": { "type": "git", "url": "https://github.com/tecnickcom/TCPDF.git", - "reference": "42cd0f9786af7e5db4fcedaa66f717b0d0032320" + "reference": "5fce932fcee4371865314ab7f6c0d85423c5c7ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/42cd0f9786af7e5db4fcedaa66f717b0d0032320", - "reference": "42cd0f9786af7e5db4fcedaa66f717b0d0032320", + "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/5fce932fcee4371865314ab7f6c0d85423c5c7ce", + "reference": "5fce932fcee4371865314ab7f6c0d85423c5c7ce", "shasum": "" }, "require": { "php": ">=5.3.0" }, - "time": "2021-12-31T08:39:24+00:00", + "time": "2023-09-06T15:09:26+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5243,7 +5243,7 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0-only" + "LGPL-3.0-or-later" ], "authors": [ { @@ -5265,7 +5265,7 @@ ], "support": { "issues": "https://github.com/tecnickcom/TCPDF/issues", - "source": "https://github.com/tecnickcom/TCPDF/tree/6.4.4" + "source": "https://github.com/tecnickcom/TCPDF/tree/6.6.5" }, "funding": [ { diff --git a/lib/composer/installed.php b/lib/composer/installed.php index 093e621e0..675b1d875 100644 --- a/lib/composer/installed.php +++ b/lib/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'combodo/itop', 'pretty_version' => 'dev-develop', 'version' => 'dev-develop', - 'reference' => '396356dd204c7704beee3f731ad103fb4d0468c0', + 'reference' => 'dddcb213d11aa68097d1ec9334401cea632ec944', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -22,7 +22,7 @@ 'combodo/itop' => array( 'pretty_version' => 'dev-develop', 'version' => 'dev-develop', - 'reference' => '396356dd204c7704beee3f731ad103fb4d0468c0', + 'reference' => 'dddcb213d11aa68097d1ec9334401cea632ec944', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -702,9 +702,9 @@ 'dev_requirement' => false, ), 'tecnickcom/tcpdf' => array( - 'pretty_version' => '6.4.4', - 'version' => '6.4.4.0', - 'reference' => '42cd0f9786af7e5db4fcedaa66f717b0d0032320', + 'pretty_version' => '6.6.5', + 'version' => '6.6.5.0', + 'reference' => '5fce932fcee4371865314ab7f6c0d85423c5c7ce', 'type' => 'library', 'install_path' => __DIR__ . '/../tecnickcom/tcpdf', 'aliases' => array(), diff --git a/lib/tecnickcom/tcpdf/CHANGELOG.TXT b/lib/tecnickcom/tcpdf/CHANGELOG.TXT index e90bd161a..efd3b52f2 100644 --- a/lib/tecnickcom/tcpdf/CHANGELOG.TXT +++ b/lib/tecnickcom/tcpdf/CHANGELOG.TXT @@ -1,3 +1,55 @@ +6.6.5 (2023-09-06) + - Fix corrupted file. + +6.6.4 (2023-09-06) + - Fix GitHub automation tests. + +6.6.3 (2023-09-06) + - Fix SPDX license ID (#591) + - Fix warning "array offset on value of type null" (#620) + - Improve the README about the status of this library (#589) + - Fix deprecation warning with PHP 8.1 (#614) + - Fixes for PHP 8.2 in tcpdf_fonts.php (#632) + - Fix some php 8+ edge cases (#630) + - Fix composite glyph output (#581) + - Fix "access array offset on value of type bool" with PDF/A (#583) + - Fix non-numeric value warning (#627) + - Fix issues with S25 barcode (#611) + - Fix return type annotations (#613) + - Fix some inconsistencies in type hints (#598) + +6.6.2 (2022-12-17) + - Ensure pregSplit return type is always array. + - Add ability to run tests on various operating systems (#566) + - Avoid a deprecated error from PHP8.1 (#573) + +6.6.1 (2022-12-12) + - Add PHPStan and fix level 1 errors (#307) + +6.6.0 (2022-12-06) + - Multi-byte character support for filename during output (#561). (#562) + - Fix garbage collection (#509) + - FIX: PDF417 corrupt output problem, solution set bcmath scale parameter to zero (#534) + - Fix TypeError: count() in PHP8 (#556) + - Fix-getHTMLFontUnits (#547) + - Improved embedded image in HTML allowing src="data:..." format (#552) + - Fix image abscissa when in RTL (#510) + - fix: php 8.1 notices (#548) + - Optimize PNG files (#563) + - Update documentation for a known issue. (#569) + - Fix for PHP 8.1 (#571) + +6.5.0 (2022-08-12) + - encodeUrlQuery takes into account the port (#493) + - Fixing undefined offset error in writeHTML() when last DOM element ha… + - correct some type hints (#495) + - fix: php 8.1 notices (#481) + - Fixed: null check for PHP 8.1 (#476) + - Fix Infinite Loop in Multicell with Auto Page Breaks Off (#473) + - GetCssBorderStyle Has Problem When !important Is Specified (#467) + - Support Apache 2.4 directives in htaccess file (#530) + - Remove examples from dist package (#542) + 6.4.4 (2021-12-31) - PHP 8.1 fixes diff --git a/lib/tecnickcom/tcpdf/LICENSE.TXT b/lib/tecnickcom/tcpdf/LICENSE.TXT index 49147d01a..072e73a75 100644 --- a/lib/tecnickcom/tcpdf/LICENSE.TXT +++ b/lib/tecnickcom/tcpdf/LICENSE.TXT @@ -7,7 +7,7 @@ published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - 2002-2019 Nicola Asuni - Tecnick.com LTD + 2002-2023 Nicola Asuni - Tecnick.com LTD ********************************************************************** ********************************************************************** diff --git a/lib/tecnickcom/tcpdf/README.md b/lib/tecnickcom/tcpdf/README.md index 0fb94009b..39ea1c458 100644 --- a/lib/tecnickcom/tcpdf/README.md +++ b/lib/tecnickcom/tcpdf/README.md @@ -6,15 +6,14 @@ * **category** Library * **author** Nicola Asuni -* **copyright** 2002-2021 Nicola Asuni - Tecnick.com LTD +* **copyright** 2002-2023 Nicola Asuni - Tecnick.com LTD * **license** http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT) * **link** http://www.tcpdf.org * **source** https://github.com/tecnickcom/TCPDF -## IMPORTANT -A new version of this library is under development at https://github.com/tecnickcom/tc-lib-pdf and as a consequence this version will not receive any additional development or support. -This version should be considered obsolete, new projects should use the new version as soon it will become stable. +## NOTE +A new version of this library is under development at https://github.com/tecnickcom/tc-lib-pdf and as a consequence this library is in support only mode. diff --git a/lib/tecnickcom/tcpdf/VERSION b/lib/tecnickcom/tcpdf/VERSION index 49df80bfe..5dbe61b99 100644 --- a/lib/tecnickcom/tcpdf/VERSION +++ b/lib/tecnickcom/tcpdf/VERSION @@ -1 +1 @@ -6.4.4 +6.6.5 diff --git a/lib/tecnickcom/tcpdf/composer.json b/lib/tecnickcom/tcpdf/composer.json index c31514bba..f24d581d3 100644 --- a/lib/tecnickcom/tcpdf/composer.json +++ b/lib/tecnickcom/tcpdf/composer.json @@ -12,8 +12,8 @@ "barcodes" ], "homepage": "http://www.tcpdf.org/", - "version": "6.4.4", - "license": "LGPL-3.0-only", + "version": "6.6.5", + "license": "LGPL-3.0-or-later", "authors": [ { "name": "Nicola Asuni", @@ -43,5 +43,10 @@ "include/barcodes/pdf417.php", "include/barcodes/qrcode.php" ] + }, + "archive": { + "exclude": [ + "/examples" + ] } } diff --git a/lib/tecnickcom/tcpdf/examples/barcodes/example_1d_html.php b/lib/tecnickcom/tcpdf/examples/barcodes/example_1d_html.php index 5a5f9a2aa..6d3233bd6 100644 --- a/lib/tecnickcom/tcpdf/examples/barcodes/example_1d_html.php +++ b/lib/tecnickcom/tcpdf/examples/barcodes/example_1d_html.php @@ -37,6 +37,10 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni * @version 1.0.000 + * @group barcode + * @group 1d + * @group html + * @group comparable */ // include 1D barcode class (search for installation path) diff --git a/lib/tecnickcom/tcpdf/examples/barcodes/example_1d_png.php b/lib/tecnickcom/tcpdf/examples/barcodes/example_1d_png.php index f7338efce..02ed1660e 100644 --- a/lib/tecnickcom/tcpdf/examples/barcodes/example_1d_png.php +++ b/lib/tecnickcom/tcpdf/examples/barcodes/example_1d_png.php @@ -37,6 +37,9 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni * @version 1.0.000 + * @group barcode + * @group 1d + * @group png */ // include 1D barcode class (search for installation path) diff --git a/lib/tecnickcom/tcpdf/examples/barcodes/example_1d_svg.php b/lib/tecnickcom/tcpdf/examples/barcodes/example_1d_svg.php index 557239eaa..5e5ccfc35 100644 --- a/lib/tecnickcom/tcpdf/examples/barcodes/example_1d_svg.php +++ b/lib/tecnickcom/tcpdf/examples/barcodes/example_1d_svg.php @@ -37,6 +37,10 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni * @version 1.0.000 + * @group barcode + * @group 1d + * @group svg + * @group comparable */ // include 1D barcode class (search for installation path) diff --git a/lib/tecnickcom/tcpdf/examples/barcodes/example_1d_svgi.php b/lib/tecnickcom/tcpdf/examples/barcodes/example_1d_svgi.php index 7f2ca87b6..8c65b669b 100644 --- a/lib/tecnickcom/tcpdf/examples/barcodes/example_1d_svgi.php +++ b/lib/tecnickcom/tcpdf/examples/barcodes/example_1d_svgi.php @@ -37,6 +37,10 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni * @version 1.0.000 + * @group barcode + * @group 1d + * @group svg + * @group comparable */ // include 1D barcode class (search for installation path) diff --git a/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_datamatrix_html.php b/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_datamatrix_html.php index dc7bab324..e0d200cc7 100644 --- a/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_datamatrix_html.php +++ b/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_datamatrix_html.php @@ -37,6 +37,10 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni * @version 1.0.009 + * @group barcode + * @group datamatrix + * @group html + * @group comparable */ // include 2D barcode class (search for installation path) diff --git a/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_datamatrix_png.php b/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_datamatrix_png.php index 87b7a3306..35d344dac 100644 --- a/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_datamatrix_png.php +++ b/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_datamatrix_png.php @@ -37,6 +37,9 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni * @version 1.0.009 + * @group barcode + * @group datamatrix + * @group png */ // include 2D barcode class (search for installation path) diff --git a/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_datamatrix_svg.php b/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_datamatrix_svg.php index 523ebfa3c..10d0aa36a 100644 --- a/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_datamatrix_svg.php +++ b/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_datamatrix_svg.php @@ -37,6 +37,10 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni * @version 1.0.009 + * @group barcode + * @group datamatrix + * @group svg + * @group comparable */ // include 2D barcode class (search for installation path) diff --git a/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_datamatrix_svgi.php b/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_datamatrix_svgi.php index 4470981e6..42627006f 100644 --- a/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_datamatrix_svgi.php +++ b/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_datamatrix_svgi.php @@ -37,6 +37,10 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni * @version 1.0.009 + * @group barcode + * @group datamatrix + * @group svg + * @group comparable */ // include 2D barcode class (search for installation path) diff --git a/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_pdf417_html.php b/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_pdf417_html.php index 4c4e9ee74..3d8de3102 100644 --- a/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_pdf417_html.php +++ b/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_pdf417_html.php @@ -37,6 +37,10 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni * @version 1.0.009 + * @group barcode + * @group pdf417 + * @group html + * @group comparable */ // include 2D barcode class (search for installation path) diff --git a/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_pdf417_png.php b/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_pdf417_png.php index df939bb11..b7c95855a 100644 --- a/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_pdf417_png.php +++ b/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_pdf417_png.php @@ -37,6 +37,9 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni * @version 1.0.009 + * @group barcode + * @group pdf417 + * @group png */ // include 2D barcode class (search for installation path) diff --git a/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_pdf417_svg.php b/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_pdf417_svg.php index fb29ea249..9017e5bcb 100644 --- a/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_pdf417_svg.php +++ b/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_pdf417_svg.php @@ -37,6 +37,10 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni * @version 1.0.009 + * @group barcode + * @group pdf417 + * @group svg + * @group comparable */ // include 2D barcode class (search for installation path) diff --git a/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_pdf417_svgi.php b/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_pdf417_svgi.php index 94e1c71c5..2075da740 100644 --- a/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_pdf417_svgi.php +++ b/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_pdf417_svgi.php @@ -37,6 +37,10 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni * @version 1.0.009 + * @group barcode + * @group pdf417 + * @group svg + * @group comparable */ // include 2D barcode class (search for installation path) diff --git a/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_qrcode_html.php b/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_qrcode_html.php index ac828f7d3..7c05f00f2 100644 --- a/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_qrcode_html.php +++ b/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_qrcode_html.php @@ -37,6 +37,9 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni * @version 1.0.009 + * @group barcode + * @group qrcode + * @group html */ // include 2D barcode class (search for installation path) diff --git a/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_qrcode_png.php b/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_qrcode_png.php index 71f871015..75daa7c07 100644 --- a/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_qrcode_png.php +++ b/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_qrcode_png.php @@ -37,6 +37,9 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni * @version 1.0.009 + * @group barcode + * @group qrcode + * @group png */ // include 2D barcode class (search for installation path) diff --git a/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_qrcode_svg.php b/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_qrcode_svg.php index 1baa43dec..c104ca63f 100644 --- a/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_qrcode_svg.php +++ b/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_qrcode_svg.php @@ -37,6 +37,9 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni * @version 1.0.009 + * @group barcode + * @group qrcode + * @group svg */ // include 2D barcode class (search for installation path) diff --git a/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_qrcode_svgi.php b/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_qrcode_svgi.php index 99d65908f..f31a10083 100644 --- a/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_qrcode_svgi.php +++ b/lib/tecnickcom/tcpdf/examples/barcodes/example_2d_qrcode_svgi.php @@ -37,6 +37,9 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni * @version 1.0.009 + * @group barcode + * @group qrcode + * @group svg */ // include 2D barcode class (search for installation path) diff --git a/lib/tecnickcom/tcpdf/examples/example_001.php b/lib/tecnickcom/tcpdf/examples/example_001.php index a79f2a818..82555e6b2 100644 --- a/lib/tecnickcom/tcpdf/examples/example_001.php +++ b/lib/tecnickcom/tcpdf/examples/example_001.php @@ -22,6 +22,10 @@ * @abstract TCPDF - Example: Default Header and Footer * @author Nicola Asuni * @since 2008-03-04 + * @group header + * @group footer + * @group page + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_002.php b/lib/tecnickcom/tcpdf/examples/example_002.php index c009eed7c..f40a2014a 100644 --- a/lib/tecnickcom/tcpdf/examples/example_002.php +++ b/lib/tecnickcom/tcpdf/examples/example_002.php @@ -22,6 +22,10 @@ * @abstract TCPDF - Example: Removing Header and Footer * @author Nicola Asuni * @since 2008-03-04 + * @group header + * @group footer + * @group page + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_003.php b/lib/tecnickcom/tcpdf/examples/example_003.php index 51209e65f..eeeb0c8d5 100644 --- a/lib/tecnickcom/tcpdf/examples/example_003.php +++ b/lib/tecnickcom/tcpdf/examples/example_003.php @@ -22,6 +22,10 @@ * @abstract TCPDF - Example: Custom Header and Footer * @author Nicola Asuni * @since 2008-03-04 + * @group header + * @group footer + * @group page + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_004.php b/lib/tecnickcom/tcpdf/examples/example_004.php index c5830af25..a1f69a5b9 100644 --- a/lib/tecnickcom/tcpdf/examples/example_004.php +++ b/lib/tecnickcom/tcpdf/examples/example_004.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Cell stretching * @author Nicola Asuni * @since 2008-03-04 + * @group cell + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_005.php b/lib/tecnickcom/tcpdf/examples/example_005.php index 0924c0389..c27dfeac4 100644 --- a/lib/tecnickcom/tcpdf/examples/example_005.php +++ b/lib/tecnickcom/tcpdf/examples/example_005.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Multicell * @author Nicola Asuni * @since 2008-03-04 + * @group cell + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_006.php b/lib/tecnickcom/tcpdf/examples/example_006.php index 22f97572a..f2c7dbca7 100644 --- a/lib/tecnickcom/tcpdf/examples/example_006.php +++ b/lib/tecnickcom/tcpdf/examples/example_006.php @@ -22,6 +22,9 @@ * @abstract TCPDF - Example: WriteHTML and RTL support * @author Nicola Asuni * @since 2008-03-04 + * @group html + * @group rtl + * @group pdf */ // Include the main TCPDF library (search for installation path). @@ -224,6 +227,20 @@ $html = '

Image alignments on HTML table

// output the HTML content $pdf->writeHTML($html, true, false, true, false, ''); +// create some HTML content +$html = '

Embedded Images

+ + + +
src="@..."
src="data..."
'; + +$data = base64_encode(file_get_contents("images/logo_example.png")); +$html = str_replace("@DATA1@", "@" . $data, $html); +$html = str_replace("@DATA2@", "data:image/png;base64," . $data, $html); + +// output the HTML content +$pdf->writeHTML($html, true, false, true, false, ''); + // reset pointer to the last page $pdf->lastPage(); diff --git a/lib/tecnickcom/tcpdf/examples/example_007.php b/lib/tecnickcom/tcpdf/examples/example_007.php index 07538249a..8edeb08a9 100644 --- a/lib/tecnickcom/tcpdf/examples/example_007.php +++ b/lib/tecnickcom/tcpdf/examples/example_007.php @@ -22,6 +22,10 @@ * @abstract TCPDF - Example: Two independent columns with WriteHTMLCell() * @author Nicola Asuni * @since 2008-03-04 + * @group column + * @group cell + * @group html + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_008.php b/lib/tecnickcom/tcpdf/examples/example_008.php index 5ec327f2c..2a3e716bd 100644 --- a/lib/tecnickcom/tcpdf/examples/example_008.php +++ b/lib/tecnickcom/tcpdf/examples/example_008.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Include external UTF-8 text file * @author Nicola Asuni * @since 2008-03-04 + * @group unicode + * @group pdf */ // Include the main TCPDF library (search for installation path). @@ -75,7 +77,7 @@ $pdf->setFont('freeserif', '', 12); // add a page $pdf->AddPage(); -// get esternal file content +// get external file content $utf8text = file_get_contents('data/utf8test.txt', false); // set color for text diff --git a/lib/tecnickcom/tcpdf/examples/example_009.php b/lib/tecnickcom/tcpdf/examples/example_009.php index 73a9fcfce..1daf8ea7d 100644 --- a/lib/tecnickcom/tcpdf/examples/example_009.php +++ b/lib/tecnickcom/tcpdf/examples/example_009.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Test Image * @author Nicola Asuni * @since 2008-03-04 + * @group image + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_010.php b/lib/tecnickcom/tcpdf/examples/example_010.php index 304b1638b..b99ca22b2 100644 --- a/lib/tecnickcom/tcpdf/examples/example_010.php +++ b/lib/tecnickcom/tcpdf/examples/example_010.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Text on multiple columns * @author Nicola Asuni * @since 2008-03-04 + * @group column + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_011.php b/lib/tecnickcom/tcpdf/examples/example_011.php index ba245df12..8656eb9c9 100644 --- a/lib/tecnickcom/tcpdf/examples/example_011.php +++ b/lib/tecnickcom/tcpdf/examples/example_011.php @@ -22,6 +22,9 @@ * @abstract TCPDF - Example: Colored Table * @author Nicola Asuni * @since 2008-03-04 + * @group table + * @group color + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_012.php b/lib/tecnickcom/tcpdf/examples/example_012.php index 4b17819ba..b8c03f4f1 100644 --- a/lib/tecnickcom/tcpdf/examples/example_012.php +++ b/lib/tecnickcom/tcpdf/examples/example_012.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Graphic Functions * @author Nicola Asuni * @since 2008-03-04 + * @group drawing + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_013.php b/lib/tecnickcom/tcpdf/examples/example_013.php index 55958158b..0430e8f59 100644 --- a/lib/tecnickcom/tcpdf/examples/example_013.php +++ b/lib/tecnickcom/tcpdf/examples/example_013.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Graphic Transformations * @author Nicola Asuni * @since 2008-03-04 + * @group drawing + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_014.php b/lib/tecnickcom/tcpdf/examples/example_014.php index b6726f742..eac3f6aaf 100644 --- a/lib/tecnickcom/tcpdf/examples/example_014.php +++ b/lib/tecnickcom/tcpdf/examples/example_014.php @@ -22,6 +22,9 @@ * @abstract TCPDF - Example: Javascript Form and user rights (only works on Adobe Acrobat) * @author Nicola Asuni * @since 2008-03-04 + * @group javascript + * @group form + * @group pdf */ @@ -70,7 +73,7 @@ if (@file_exists(dirname(__FILE__).'/lang/eng.php')) { // IMPORTANT: disable font subsetting to allow users editing the document $pdf->setFontSubsetting(false); -// set font +// set font. 'helvetica' MUST be used to avoid a PHP notice from PHP 7.4+ $pdf->setFont('helvetica', '', 10, '', false); // add a page diff --git a/lib/tecnickcom/tcpdf/examples/example_015.php b/lib/tecnickcom/tcpdf/examples/example_015.php index 53986dd6e..416883bde 100644 --- a/lib/tecnickcom/tcpdf/examples/example_015.php +++ b/lib/tecnickcom/tcpdf/examples/example_015.php @@ -23,6 +23,9 @@ * @abstract TCPDF - Example: Bookmarks (Table of Content) * @author Nicola Asuni * @since 2008-03-04 + * @group toc + * @group bookmark + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_016.php b/lib/tecnickcom/tcpdf/examples/example_016.php index 301f89447..f54a7463c 100644 --- a/lib/tecnickcom/tcpdf/examples/example_016.php +++ b/lib/tecnickcom/tcpdf/examples/example_016.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Document Encryption / Security * @author Nicola Asuni * @since 2008-03-04 + * @group security + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_017.php b/lib/tecnickcom/tcpdf/examples/example_017.php index 3c22360e6..94f571b4d 100644 --- a/lib/tecnickcom/tcpdf/examples/example_017.php +++ b/lib/tecnickcom/tcpdf/examples/example_017.php @@ -22,6 +22,9 @@ * @abstract TCPDF - Example: Two independent columns with MultiCell * @author Nicola Asuni * @since 2008-03-04 + * @group column + * @group cell + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_018.php b/lib/tecnickcom/tcpdf/examples/example_018.php index 675a6cba6..bacc94aff 100644 --- a/lib/tecnickcom/tcpdf/examples/example_018.php +++ b/lib/tecnickcom/tcpdf/examples/example_018.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: RTL document with Persian language * @author Nicola Asuni * @since 2008-03-06 + * @group rtl + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_019.php b/lib/tecnickcom/tcpdf/examples/example_019.php index 7dd95555f..f53a34eae 100644 --- a/lib/tecnickcom/tcpdf/examples/example_019.php +++ b/lib/tecnickcom/tcpdf/examples/example_019.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Non unicode with alternative config file * @author Nicola Asuni * @since 2008-03-04 + * @group unicode + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_020.php b/lib/tecnickcom/tcpdf/examples/example_020.php index e2f0b6fd1..32c16eacb 100644 --- a/lib/tecnickcom/tcpdf/examples/example_020.php +++ b/lib/tecnickcom/tcpdf/examples/example_020.php @@ -23,6 +23,9 @@ * @abstract TCPDF - Example: Two columns composed by MultiCell of different heights * @author Nicola Asuni * @since 2008-03-04 +* @group cell +* @group column +* @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_021.php b/lib/tecnickcom/tcpdf/examples/example_021.php index a646ed2f5..98ae49b1f 100644 --- a/lib/tecnickcom/tcpdf/examples/example_021.php +++ b/lib/tecnickcom/tcpdf/examples/example_021.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: WriteHTML text flow. * @author Nicola Asuni * @since 2008-03-04 + * @group html + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_022.php b/lib/tecnickcom/tcpdf/examples/example_022.php index cc6bf65a9..416108a96 100644 --- a/lib/tecnickcom/tcpdf/examples/example_022.php +++ b/lib/tecnickcom/tcpdf/examples/example_022.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: CMYK colors. * @author Nicola Asuni * @since 2008-03-04 + * @group color + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_023.php b/lib/tecnickcom/tcpdf/examples/example_023.php index 09d616b24..5a509efd9 100644 --- a/lib/tecnickcom/tcpdf/examples/example_023.php +++ b/lib/tecnickcom/tcpdf/examples/example_023.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Page Groups. * @author Nicola Asuni * @since 2008-03-04 + * @group page + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_024.php b/lib/tecnickcom/tcpdf/examples/example_024.php index 20cbf5ed7..f786b1123 100644 --- a/lib/tecnickcom/tcpdf/examples/example_024.php +++ b/lib/tecnickcom/tcpdf/examples/example_024.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Object Visibility and Layers * @author Nicola Asuni * @since 2008-03-04 + * @group drawing + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_025.php b/lib/tecnickcom/tcpdf/examples/example_025.php index 035201b9d..9e441be9e 100644 --- a/lib/tecnickcom/tcpdf/examples/example_025.php +++ b/lib/tecnickcom/tcpdf/examples/example_025.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Object Transparency * @author Nicola Asuni * @since 2008-03-04 + * @group drawing + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_026.php b/lib/tecnickcom/tcpdf/examples/example_026.php index 83f5e1277..8cde97130 100644 --- a/lib/tecnickcom/tcpdf/examples/example_026.php +++ b/lib/tecnickcom/tcpdf/examples/example_026.php @@ -22,6 +22,7 @@ * @abstract TCPDF - Example: Text Rendering Modes and Text Clipping * @author Nicola Asuni * @since 2008-03-04 + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_027.php b/lib/tecnickcom/tcpdf/examples/example_027.php index ffdf6d8da..d7399844a 100644 --- a/lib/tecnickcom/tcpdf/examples/example_027.php +++ b/lib/tecnickcom/tcpdf/examples/example_027.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: 1D Barcodes. * @author Nicola Asuni * @since 2008-03-04 + * @group barcode + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_028.php b/lib/tecnickcom/tcpdf/examples/example_028.php index c9bb545d8..312de99ff 100644 --- a/lib/tecnickcom/tcpdf/examples/example_028.php +++ b/lib/tecnickcom/tcpdf/examples/example_028.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: changing page formats * @author Nicola Asuni * @since 2008-03-04 + * @group page + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_029.php b/lib/tecnickcom/tcpdf/examples/example_029.php index 090c0e89a..fd7b6d87e 100644 --- a/lib/tecnickcom/tcpdf/examples/example_029.php +++ b/lib/tecnickcom/tcpdf/examples/example_029.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Set PDF viewer display preferences. * @author Nicola Asuni * @since 2008-06-09 + * @group viewer + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_030.php b/lib/tecnickcom/tcpdf/examples/example_030.php index ad822cc6e..4b57b7ac3 100644 --- a/lib/tecnickcom/tcpdf/examples/example_030.php +++ b/lib/tecnickcom/tcpdf/examples/example_030.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Colour gradients * @author Nicola Asuni * @since 2008-06-09 + * @group color + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_031.php b/lib/tecnickcom/tcpdf/examples/example_031.php index 6a1d40bf6..354ffcd76 100644 --- a/lib/tecnickcom/tcpdf/examples/example_031.php +++ b/lib/tecnickcom/tcpdf/examples/example_031.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Pie Chart * @author Nicola Asuni * @since 2008-06-09 + * @group drawing + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_032.php b/lib/tecnickcom/tcpdf/examples/example_032.php index 9aa483189..dbba89a03 100644 --- a/lib/tecnickcom/tcpdf/examples/example_032.php +++ b/lib/tecnickcom/tcpdf/examples/example_032.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: EPS/AI image * @author Nicola Asuni * @since 2008-06-09 + * @group image + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_033.php b/lib/tecnickcom/tcpdf/examples/example_033.php index 14708c44f..3696e5205 100644 --- a/lib/tecnickcom/tcpdf/examples/example_033.php +++ b/lib/tecnickcom/tcpdf/examples/example_033.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Mixed font types * @author Nicola Asuni * @since 2008-06-24 + * @group font + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_034.php b/lib/tecnickcom/tcpdf/examples/example_034.php index c57bd01c9..29b156398 100644 --- a/lib/tecnickcom/tcpdf/examples/example_034.php +++ b/lib/tecnickcom/tcpdf/examples/example_034.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Clipping * @author Nicola Asuni * @since 2008-03-04 + * @group cell + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_035.php b/lib/tecnickcom/tcpdf/examples/example_035.php index 6860a7e8b..78cf99337 100644 --- a/lib/tecnickcom/tcpdf/examples/example_035.php +++ b/lib/tecnickcom/tcpdf/examples/example_035.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Line styles with cells and multicells * @author Nicola Asuni * @since 2008-03-04 + * @group cell + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_036.php b/lib/tecnickcom/tcpdf/examples/example_036.php index 62ba2eb0e..195d13993 100644 --- a/lib/tecnickcom/tcpdf/examples/example_036.php +++ b/lib/tecnickcom/tcpdf/examples/example_036.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Annotations * @author Nicola Asuni * @since 2008-08-08 + * @group annotation + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_037.php b/lib/tecnickcom/tcpdf/examples/example_037.php index beb988600..af705b424 100644 --- a/lib/tecnickcom/tcpdf/examples/example_037.php +++ b/lib/tecnickcom/tcpdf/examples/example_037.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Spot colors. * @author Nicola Asuni * @since 2008-09-12 + * @group color + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_038.php b/lib/tecnickcom/tcpdf/examples/example_038.php index df58a8ba3..568610aca 100644 --- a/lib/tecnickcom/tcpdf/examples/example_038.php +++ b/lib/tecnickcom/tcpdf/examples/example_038.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: CID-0 CJK unembedded font * @author Nicola Asuni * @since 2008-09-15 + * @group font + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_039.php b/lib/tecnickcom/tcpdf/examples/example_039.php index 07a7d2f96..0eabd0840 100644 --- a/lib/tecnickcom/tcpdf/examples/example_039.php +++ b/lib/tecnickcom/tcpdf/examples/example_039.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: HTML justification * @author Nicola Asuni * @since 2008-10-18 + * @group html + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_040.php b/lib/tecnickcom/tcpdf/examples/example_040.php index 548e10b68..970370807 100644 --- a/lib/tecnickcom/tcpdf/examples/example_040.php +++ b/lib/tecnickcom/tcpdf/examples/example_040.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Booklet mode (double-sided pages) * @author Nicola Asuni * @since 2008-10-28 + * @group page + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_041.php b/lib/tecnickcom/tcpdf/examples/example_041.php index 225a1e315..68ba81c76 100644 --- a/lib/tecnickcom/tcpdf/examples/example_041.php +++ b/lib/tecnickcom/tcpdf/examples/example_041.php @@ -22,6 +22,9 @@ * @abstract TCPDF - Annotation - FileAttachment * @author Nicola Asuni * @since 2008-12-07 + * @group annotation + * @group attachment + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_042.php b/lib/tecnickcom/tcpdf/examples/example_042.php index 995cf23c3..039e3e1b8 100644 --- a/lib/tecnickcom/tcpdf/examples/example_042.php +++ b/lib/tecnickcom/tcpdf/examples/example_042.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Test Image with alpha channel * @author Nicola Asuni * @since 2008-12-23 + * @group image + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_043.php b/lib/tecnickcom/tcpdf/examples/example_043.php index 16ccfa039..d73e46a5f 100644 --- a/lib/tecnickcom/tcpdf/examples/example_043.php +++ b/lib/tecnickcom/tcpdf/examples/example_043.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Disk caching * @author Nicola Asuni * @since 2009-01-02 + * @group cache + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_044.php b/lib/tecnickcom/tcpdf/examples/example_044.php index 2b31a50be..668ccc5c8 100644 --- a/lib/tecnickcom/tcpdf/examples/example_044.php +++ b/lib/tecnickcom/tcpdf/examples/example_044.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Move, copy and delete pages * @author Nicola Asuni * @since 2009-01-02 + * @group page + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_045.php b/lib/tecnickcom/tcpdf/examples/example_045.php index 97fe4548d..a7f613731 100644 --- a/lib/tecnickcom/tcpdf/examples/example_045.php +++ b/lib/tecnickcom/tcpdf/examples/example_045.php @@ -22,6 +22,9 @@ * @abstract TCPDF - Example: Bookmarks and Table of Content * @author Nicola Asuni * @since 2008-03-04 + * @group toc + * @group bookmark + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_046.php b/lib/tecnickcom/tcpdf/examples/example_046.php index f6346e9c1..1071b54f0 100644 --- a/lib/tecnickcom/tcpdf/examples/example_046.php +++ b/lib/tecnickcom/tcpdf/examples/example_046.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: text Hyphenation * @author Nicola Asuni * @since 2009-02-28 + * @group text + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_047.php b/lib/tecnickcom/tcpdf/examples/example_047.php index 4783456f3..a6bd1f528 100644 --- a/lib/tecnickcom/tcpdf/examples/example_047.php +++ b/lib/tecnickcom/tcpdf/examples/example_047.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Transactions * @author Nicola Asuni * @since 2009-03-19 + * @group transaction + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_048.php b/lib/tecnickcom/tcpdf/examples/example_048.php index 974e7f97e..b7226fe18 100644 --- a/lib/tecnickcom/tcpdf/examples/example_048.php +++ b/lib/tecnickcom/tcpdf/examples/example_048.php @@ -22,6 +22,9 @@ * @abstract TCPDF - Example: HTML tables and table headers * @author Nicola Asuni * @since 2009-03-20 + * @group html + * @group table + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_049.php b/lib/tecnickcom/tcpdf/examples/example_049.php index 11a2649c3..d2a46ada9 100644 --- a/lib/tecnickcom/tcpdf/examples/example_049.php +++ b/lib/tecnickcom/tcpdf/examples/example_049.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: WriteHTML with TCPDF callback functions * @author Nicola Asuni * @since 2008-03-04 + * @group html + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_050.php b/lib/tecnickcom/tcpdf/examples/example_050.php index 0647be61f..6bbb299e2 100644 --- a/lib/tecnickcom/tcpdf/examples/example_050.php +++ b/lib/tecnickcom/tcpdf/examples/example_050.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: 2D barcodes. * @author Nicola Asuni * @since 2008-03-04 + * @group barcode + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_051.php b/lib/tecnickcom/tcpdf/examples/example_051.php index 486d0c6c3..c3a9ce2f2 100644 --- a/lib/tecnickcom/tcpdf/examples/example_051.php +++ b/lib/tecnickcom/tcpdf/examples/example_051.php @@ -22,6 +22,9 @@ * @abstract TCPDF - Example: Full page background * @author Nicola Asuni * @since 2009-04-16 + * @group background + * @group page + * @group pdf */ // Include the main TCPDF library (search for installation path). @@ -40,7 +43,7 @@ class MYPDF extends TCPDF { $this->setAutoPageBreak(false, 0); // set bacground image $img_file = K_PATH_IMAGES.'image_demo.jpg'; - $this->Image($img_file, 0, 0, 210, 297, '', '', '', false, 300, '', false, false, 0); + $this->Image($img_file, null, 0, 210, 297, '', '', '', false, 300, 'C', false, false, 0); // restore auto-page-break status $this->setAutoPageBreak($auto_page_break, $bMargin); // set the starting point for the page content @@ -124,7 +127,7 @@ $auto_page_break = $pdf->getAutoPageBreak(); $pdf->setAutoPageBreak(false, 0); // set bacground image $img_file = K_PATH_IMAGES.'image_demo.jpg'; -$pdf->Image($img_file, 0, 0, 210, 297, '', '', '', false, 300, '', false, false, 0); +$pdf->Image($img_file, null, 0, 210, 297, '', '', '', false, 300, 'C', false, false, 0); // restore auto-page-break status $pdf->setAutoPageBreak($auto_page_break, $bMargin); // set the starting point for the page content diff --git a/lib/tecnickcom/tcpdf/examples/example_052.php b/lib/tecnickcom/tcpdf/examples/example_052.php index 7618aae0f..10cfb2e4f 100644 --- a/lib/tecnickcom/tcpdf/examples/example_052.php +++ b/lib/tecnickcom/tcpdf/examples/example_052.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Certification Signature (experimental) * @author Nicola Asuni * @since 2009-05-07 + * @group security + * @group pdf */ // Include the main TCPDF library (search for installation path). @@ -87,7 +89,7 @@ $info = array( // set document signature $pdf->setSignature($certificate, $certificate, 'tcpdfdemo', '', 2, $info); -// set font +// set font. 'helvetica' MUST be used to avoid a PHP notice from PHP 7.4+ $pdf->setFont('helvetica', '', 12); // add a page diff --git a/lib/tecnickcom/tcpdf/examples/example_053.php b/lib/tecnickcom/tcpdf/examples/example_053.php index 29b94aaa7..dbeb67e25 100644 --- a/lib/tecnickcom/tcpdf/examples/example_053.php +++ b/lib/tecnickcom/tcpdf/examples/example_053.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Javascript example. * @author Nicola Asuni * @since 2009-09-02 + * @group javascript + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_054.php b/lib/tecnickcom/tcpdf/examples/example_054.php index 32f73c596..3a5011d49 100644 --- a/lib/tecnickcom/tcpdf/examples/example_054.php +++ b/lib/tecnickcom/tcpdf/examples/example_054.php @@ -22,6 +22,9 @@ * @abstract TCPDF - Example: XHTML Forms * @author Nicola Asuni * @since 2009-09-07 + * @group html + * @group form + * @group pdf */ // Include the main TCPDF library (search for installation path). @@ -69,7 +72,7 @@ if (@file_exists(dirname(__FILE__).'/lang/eng.php')) { // IMPORTANT: disable font subsetting to allow users editing the document $pdf->setFontSubsetting(false); -// set font +// set font. 'helvetica' MUST be used to avoid a PHP notice from PHP 7.4+ $pdf->setFont('helvetica', '', 10, '', false); // add a page diff --git a/lib/tecnickcom/tcpdf/examples/example_055.php b/lib/tecnickcom/tcpdf/examples/example_055.php index 496d84bae..0f50da096 100644 --- a/lib/tecnickcom/tcpdf/examples/example_055.php +++ b/lib/tecnickcom/tcpdf/examples/example_055.php @@ -22,6 +22,9 @@ * @abstract TCPDF - Example: XHTML Forms * @author Nicola Asuni * @since 2009-10-21 + * @group html + * @group form + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_056.php b/lib/tecnickcom/tcpdf/examples/example_056.php index c8fba4cfb..40ef2508b 100644 --- a/lib/tecnickcom/tcpdf/examples/example_056.php +++ b/lib/tecnickcom/tcpdf/examples/example_056.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Crop marks and color registration bars * @author Nicola Asuni * @since 2010-03-26 + * @group color + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_057.php b/lib/tecnickcom/tcpdf/examples/example_057.php index 8fe84bd8b..c0bbe4af3 100644 --- a/lib/tecnickcom/tcpdf/examples/example_057.php +++ b/lib/tecnickcom/tcpdf/examples/example_057.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Cell vertical alignments * @author Nicola Asuni * @since 2008-03-04 + * @group cell + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_058.php b/lib/tecnickcom/tcpdf/examples/example_058.php index 684fe8b42..583228bbc 100644 --- a/lib/tecnickcom/tcpdf/examples/example_058.php +++ b/lib/tecnickcom/tcpdf/examples/example_058.php @@ -22,6 +22,9 @@ * @abstract TCPDF - Example: SVG Image * @author Nicola Asuni * @since 2010-05-02 + * @group svg + * @group image + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_059.php b/lib/tecnickcom/tcpdf/examples/example_059.php index 9e0f7affb..6f05b2e8e 100644 --- a/lib/tecnickcom/tcpdf/examples/example_059.php +++ b/lib/tecnickcom/tcpdf/examples/example_059.php @@ -22,6 +22,9 @@ * @abstract TCPDF - Example: Table Of Content using HTML templates. * @author Nicola Asuni * @since 2010-05-06 + * @group toc + * @group html + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_060.php b/lib/tecnickcom/tcpdf/examples/example_060.php index a2ca8aad8..dcdd9cc22 100644 --- a/lib/tecnickcom/tcpdf/examples/example_060.php +++ b/lib/tecnickcom/tcpdf/examples/example_060.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Advanced page settings. * @author Nicola Asuni * @since 2010-05-17 + * @group page + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_061.php b/lib/tecnickcom/tcpdf/examples/example_061.php index ae7d51a94..607547dfc 100644 --- a/lib/tecnickcom/tcpdf/examples/example_061.php +++ b/lib/tecnickcom/tcpdf/examples/example_061.php @@ -22,6 +22,9 @@ * @abstract TCPDF - Example: XHTML + CSS * @author Nicola Asuni * @since 2010-05-25 + * @group html + * @group css + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_062.php b/lib/tecnickcom/tcpdf/examples/example_062.php index 0e2c28f2c..d0bf89fe9 100644 --- a/lib/tecnickcom/tcpdf/examples/example_062.php +++ b/lib/tecnickcom/tcpdf/examples/example_062.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: XObject Template * @author Nicola Asuni * @since 2010-08-25 + * @group object + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_063.php b/lib/tecnickcom/tcpdf/examples/example_063.php index 5e52b98f6..f68f4f90a 100644 --- a/lib/tecnickcom/tcpdf/examples/example_063.php +++ b/lib/tecnickcom/tcpdf/examples/example_063.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: Text stretching and spacing (tracking) * @author Nicola Asuni * @since 2010-09-29 + * @group text + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_064.php b/lib/tecnickcom/tcpdf/examples/example_064.php index cc00a8117..8efaf4fea 100644 --- a/lib/tecnickcom/tcpdf/examples/example_064.php +++ b/lib/tecnickcom/tcpdf/examples/example_064.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: No-write page regions * @author Nicola Asuni * @since 2010-10-14 + * @group page + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_065.php b/lib/tecnickcom/tcpdf/examples/example_065.php index 448ac9a27..90794804c 100644 --- a/lib/tecnickcom/tcpdf/examples/example_065.php +++ b/lib/tecnickcom/tcpdf/examples/example_065.php @@ -22,6 +22,8 @@ * @abstract TCPDF - Example: PDF/A-1b mode * @author Nicola Asuni * @since 2011-09-28 + * @group A-1b + * @group pdf */ // Include the main TCPDF library (search for installation path). diff --git a/lib/tecnickcom/tcpdf/examples/example_066.php b/lib/tecnickcom/tcpdf/examples/example_066.php index fed4d19e9..c7304c7a2 100644 --- a/lib/tecnickcom/tcpdf/examples/example_066.php +++ b/lib/tecnickcom/tcpdf/examples/example_066.php @@ -14,6 +14,8 @@ * @abstract TCPDF - Example: PDF/A-1b mode * @author Nicola Asuni * @since 2021-03-26 + * @group A-1b + * @group pdf */ // Load the autoloader, move one folder back from examples diff --git a/lib/tecnickcom/tcpdf/examples/example_067.php b/lib/tecnickcom/tcpdf/examples/example_067.php new file mode 100644 index 000000000..e0262bfde --- /dev/null +++ b/lib/tecnickcom/tcpdf/examples/example_067.php @@ -0,0 +1,223 @@ +setCreator(PDF_CREATOR); +$pdf->setAuthor('Owen Leibman'); +$pdf->setTitle('TCPDF Example 067'); +$pdf->setSubject('TCPDF Tutorial'); +$pdf->setKeywords('TCPDF, PDF, example, test, guide'); + +// set default header data +$pdf->setHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 067', PDF_HEADER_STRING); + +// set header and footer fonts +$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); +$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); + +// set default monospaced font +$pdf->setDefaultMonospacedFont(PDF_FONT_MONOSPACED); + +// set margins +$pdf->setMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); +$pdf->setHeaderMargin(PDF_MARGIN_HEADER); +$pdf->setFooterMargin(PDF_MARGIN_FOOTER); + +// set auto page breaks +$pdf->setAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); + +// set image scale factor +$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); + +// set some language-dependent strings (optional) +if (@file_exists(dirname(__FILE__).'/lang/eng.php')) { + require_once(dirname(__FILE__).'/lang/eng.php'); + $pdf->setLanguageArray($l); +} + +// --------------------------------------------------------- + +// set font +$pdf->setFont('helvetica', 'B', 20); + +// add a page +$pdf->AddPage(); + +$pdf->Write(0, 'Example of HTML tables', '', 0, 'L', true, 0, false, false, 0); + +$pdf->setFont('helvetica', '', 8); + +// ----------------------------------------------------------------------------- + +$tbl = << + + COL 1 - ROW 1
COLSPAN 3 + COL 2 - ROW 1 + COL 3 - ROW 1 + + + COL 2 - ROW 2 - COLSPAN 2
text line
text line
text line
text line + COL 3 - ROW 2 + + + COL 3 - ROW 3 + + + +EOD; + +$pdf->writeHTML($tbl, true, false, false, false, ''); + +// ----------------------------------------------------------------------------- + +$tbl = << + + COL 1 - ROW 1
COLSPAN 3 + COL 2 - ROW 1 + COL 3 - ROW 1 + + + COL 2 - ROW 2 - COLSPAN 2
text line
text line
text line
text line + COL 3 - ROW 2 + + + COL 3 - ROW 3 + + + +EOD; + +$pdf->writeHTML($tbl, true, false, false, false, ''); + +// ----------------------------------------------------------------------------- + +$tbl = << + + COL 1 - ROW 1
COLSPAN 3 + COL 2 - ROW 1 + COL 3 - ROW 1 + + + COL 2 - ROW 2 - COLSPAN 2
text line
text line
text line
text line + COL 3 - ROW 2 + + + COL 3 - ROW 3 + + + +EOD; + +$pdf->writeHTML($tbl, true, false, false, false, ''); + +// ----------------------------------------------------------------------------- + +$tbl = << + + COL 1 - ROW 1
COLSPAN 3 + COL 2 - ROW 1 + COL 3 - ROW 1 + + + COL 2 - ROW 2 - COLSPAN 2
text line
text line
text line
text line + COL 3 - ROW 2 + + + COL 3 - ROW 3 + + + +EOD; + +$pdf->writeHTML($tbl, true, false, false, false, ''); + +// ----------------------------------------------------------------------------- + +$tbl = << + + COL 1 - ROW 1
COLSPAN 3 + COL 2 - ROW 1 + COL 3 - ROW 1 + + + COL 2 - ROW 2 - COLSPAN 2
text line
text line
text line
text line + COL 3 - ROW 2 + + + COL 3 - ROW 3 + + + +EOD; + +$pdf->writeHTML($tbl, true, false, false, false, ''); + +// ----------------------------------------------------------------------------- + +// At medium thickness, which is what you get with only one +// setting for style, everything looks the same. +// Included just for completeness. +$tbl = << + + COL 1 - ROW 1
COLSPAN 3 + COL 2 - ROW 1 + COL 3 - ROW 1 + + + COL 2 - ROW 2 - COLSPAN 2
text line
text line
text line
text line + COL 3 - ROW 2 + + + COL 3 - ROW 3 + + + +EOD; + +$pdf->writeHTML($tbl, true, false, false, false, ''); +// ----------------------------------------------------------------------------- + +//Close and output PDF document +$pdf->Output('example_067.pdf', 'I'); + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/lib/tecnickcom/tcpdf/examples/images/alpha.png b/lib/tecnickcom/tcpdf/examples/images/alpha.png index 544791860..4980117de 100644 Binary files a/lib/tecnickcom/tcpdf/examples/images/alpha.png and b/lib/tecnickcom/tcpdf/examples/images/alpha.png differ diff --git a/lib/tecnickcom/tcpdf/examples/images/image_with_alpha.png b/lib/tecnickcom/tcpdf/examples/images/image_with_alpha.png index 3011618de..f87dc9a1b 100644 Binary files a/lib/tecnickcom/tcpdf/examples/images/image_with_alpha.png and b/lib/tecnickcom/tcpdf/examples/images/image_with_alpha.png differ diff --git a/lib/tecnickcom/tcpdf/examples/images/img.png b/lib/tecnickcom/tcpdf/examples/images/img.png index 9c1a07544..2461637e3 100644 Binary files a/lib/tecnickcom/tcpdf/examples/images/img.png and b/lib/tecnickcom/tcpdf/examples/images/img.png differ diff --git a/lib/tecnickcom/tcpdf/examples/images/logo_example.png b/lib/tecnickcom/tcpdf/examples/images/logo_example.png index 13799452b..a57be4ce9 100644 Binary files a/lib/tecnickcom/tcpdf/examples/images/logo_example.png and b/lib/tecnickcom/tcpdf/examples/images/logo_example.png differ diff --git a/lib/tecnickcom/tcpdf/examples/images/tcpdf_cell.png b/lib/tecnickcom/tcpdf/examples/images/tcpdf_cell.png index 98a1553a8..2e3e92ccb 100644 Binary files a/lib/tecnickcom/tcpdf/examples/images/tcpdf_cell.png and b/lib/tecnickcom/tcpdf/examples/images/tcpdf_cell.png differ diff --git a/lib/tecnickcom/tcpdf/examples/images/tcpdf_signature.png b/lib/tecnickcom/tcpdf/examples/images/tcpdf_signature.png index a4f063725..64caa51fe 100644 Binary files a/lib/tecnickcom/tcpdf/examples/images/tcpdf_signature.png and b/lib/tecnickcom/tcpdf/examples/images/tcpdf_signature.png differ diff --git a/lib/tecnickcom/tcpdf/examples/index.php b/lib/tecnickcom/tcpdf/examples/index.php index 75125235e..d865689b1 100644 --- a/lib/tecnickcom/tcpdf/examples/index.php +++ b/lib/tecnickcom/tcpdf/examples/index.php @@ -85,6 +85,8 @@ echo '<'.'?'.'xml version="1.0" encoding="UTF-8"'.'?'.'>';
  • Text stretching and spacing (tracking/kerning): [PDF]
  • No-write page regions: [PDF]
  • PDF/A-1b (ISO 19005-1:2005) document: [PDF]
  • +
  • Using WriteHTMLCell: [PDF]
  • +
  • Shorthand border styles including !important: [PDF]
  • Barcodes

    diff --git a/lib/tecnickcom/tcpdf/include/barcodes/datamatrix.php b/lib/tecnickcom/tcpdf/include/barcodes/datamatrix.php index 38bd625f7..d1cc6d2a9 100644 --- a/lib/tecnickcom/tcpdf/include/barcodes/datamatrix.php +++ b/lib/tecnickcom/tcpdf/include/barcodes/datamatrix.php @@ -778,7 +778,7 @@ class Datamatrix { if (isset($this->chset['SH1'][$chr])) { $temp_cw[] = 0; // shift 1 $shiftset = $this->chset['SH1']; - } elseif (isset($chr, $this->chset['SH2'][$chr])) { + } elseif (isset($this->chset['SH2'][$chr])) { $temp_cw[] = 1; // shift 2 $shiftset = $this->chset['SH2']; } elseif (($enc == ENC_C40) AND isset($this->chset['S3C'][$chr])) { diff --git a/lib/tecnickcom/tcpdf/include/barcodes/pdf417.php b/lib/tecnickcom/tcpdf/include/barcodes/pdf417.php index 742802e1f..bda24822f 100644 --- a/lib/tecnickcom/tcpdf/include/barcodes/pdf417.php +++ b/lib/tecnickcom/tcpdf/include/barcodes/pdf417.php @@ -943,8 +943,8 @@ class PDF417 { // tmp array for the 6 bytes block $cw6 = array(); do { - $d = bcmod($t, '900'); - $t = bcdiv($t, '900'); + $d = bcmod($t, '900', 0); + $t = bcdiv($t, '900', 0); // prepend the value to the beginning of the array array_unshift($cw6, $d); } while ($t != '0'); @@ -969,8 +969,8 @@ class PDF417 { } $t = '1'.$code; do { - $d = bcmod($t, '900'); - $t = bcdiv($t, '900'); + $d = bcmod($t, '900', 0); + $t = bcdiv($t, '900', 0); array_unshift($cw, $d); } while ($t != '0'); $code = $rest; diff --git a/lib/tecnickcom/tcpdf/include/barcodes/qrcode.php b/lib/tecnickcom/tcpdf/include/barcodes/qrcode.php index 2e7f2f576..1a64a4cb5 100644 --- a/lib/tecnickcom/tcpdf/include/barcodes/qrcode.php +++ b/lib/tecnickcom/tcpdf/include/barcodes/qrcode.php @@ -884,14 +884,15 @@ class QRcode { protected function getCode() { if ($this->count < $this->dataLength) { $row = $this->count % $this->blocks; - $col = $this->count / $this->blocks; + $col = (int)($this->count / $this->blocks); if ($col >= $this->rsblocks[0]['dataLength']) { $row += $this->b1; } + $row = (int) $row; $ret = $this->rsblocks[$row]['data'][$col]; } elseif ($this->count < $this->dataLength + $this->eccLength) { $row = ($this->count - $this->dataLength) % $this->blocks; - $col = ($this->count - $this->dataLength) / $this->blocks; + $col = (int)(($this->count - $this->dataLength) / $this->blocks); $ret = $this->rsblocks[$row]['ecc'][$col]; } else { return 0; @@ -1062,7 +1063,7 @@ class QRcode { protected function makeMaskNo($maskNo, $width, $s, &$d, $maskGenOnly=false) { $b = 0; $bitMask = array(); - $bitMask = $this->generateMaskNo($maskNo, $width, $s, $d); + $bitMask = $this->generateMaskNo($maskNo, $width, $s); if ($maskGenOnly) { return; } @@ -1460,7 +1461,7 @@ class QRcode { $stringLen = strlen($this->dataStr); $p = 0; while ($p < $stringLen) { - $mode = $this->identifyMode(substr($this->dataStr, $p), $this->hint); + $mode = $this->identifyMode(substr($this->dataStr, $p)); if ($mode == QR_MODE_KJ) { $p += 2; } else { @@ -1692,7 +1693,7 @@ class QRcode { return -1; } $buf = array($size, $index, $parity); - $entry = $this->newInputItem(QR_MODE_ST, 3, buf); + $entry = $this->newInputItem(QR_MODE_ST, 3, $buf); array_unshift($items, $entry); return $items; } diff --git a/lib/tecnickcom/tcpdf/include/tcpdf_fonts.php b/lib/tecnickcom/tcpdf/include/tcpdf_fonts.php index c692ef87d..a71c84b7e 100644 --- a/lib/tecnickcom/tcpdf/include/tcpdf_fonts.php +++ b/lib/tecnickcom/tcpdf/include/tcpdf_fonts.php @@ -1151,7 +1151,7 @@ class TCPDF_FONTS { $subsetglyphs[$g] = true; } } - } + } break; } case 6: { // Format 6: Trimmed table mapping @@ -1323,43 +1323,43 @@ class TCPDF_FONTS { // set the checkSumAdjustment to 0 $table[$tag]['data'] = substr($table[$tag]['data'], 0, 8)."\x0\x0\x0\x0".substr($table[$tag]['data'], 12); } - $pad = 4 - ($table[$tag]['length'] % 4); - if ($pad != 4) { - // the length of a table must be a multiple of four bytes - $table[$tag]['length'] += $pad; - $table[$tag]['data'] .= str_repeat("\x0", $pad); - } $table[$tag]['offset'] = $offset; $offset += $table[$tag]['length']; + $numPad = ($offset + 3 & ~3) - $offset; + if($numPad > 0) { + $table[$tag]['data'] .= str_repeat("\x0", $numPad); + $offset += $numPad; + } // check sum is not changed (so keep the following line commented) - //$table[$tag]['checkSum'] = self::_getTTFtableChecksum($table[$tag]['data'], $table[$tag]['length']); + //$table[$tag]['checkSum'] = self::_getTTFtableChecksum($table[$tag]['data'], $table[$tag]['length'] + $numPad); } else { unset($table[$tag]); } } // add loca + $table['loca'] = array(); $table['loca']['data'] = $loca; $table['loca']['length'] = strlen($loca); - $pad = 4 - ($table['loca']['length'] % 4); - if ($pad != 4) { - // the length of a table must be a multiple of four bytes - $table['loca']['length'] += $pad; - $table['loca']['data'] .= str_repeat("\x0", $pad); - } $table['loca']['offset'] = $offset; - $table['loca']['checkSum'] = self::_getTTFtableChecksum($table['loca']['data'], $table['loca']['length']); $offset += $table['loca']['length']; + $numPad = ($offset + 3 & ~3) - $offset; + if($numPad > 0) { + $table['loca']['data'] .= str_repeat("\x0", $numPad); + $offset += $numPad; + } + $table['loca']['checkSum'] = self::_getTTFtableChecksum($table['loca']['data'], $table['loca']['length'] + $numPad); // add glyf + $table['glyf'] = array(); $table['glyf']['data'] = $glyf; $table['glyf']['length'] = strlen($glyf); - $pad = 4 - ($table['glyf']['length'] % 4); - if ($pad != 4) { - // the length of a table must be a multiple of four bytes - $table['glyf']['length'] += $pad; - $table['glyf']['data'] .= str_repeat("\x0", $pad); - } $table['glyf']['offset'] = $offset; - $table['glyf']['checkSum'] = self::_getTTFtableChecksum($table['glyf']['data'], $table['glyf']['length']); + $offset += $table['glyf']['length']; + $numPad = ($offset + 3 & ~3) - $offset; + if($numPad > 0) { + $table['glyf']['data'] .= str_repeat("\x0", $numPad); + $offset += $numPad; + } + $table['glyf']['checkSum'] = self::_getTTFtableChecksum($table['glyf']['data'], $table['glyf']['length'] + $numPad); // rebuild font $font = ''; $font .= pack('N', 0x10000); // sfnt version @@ -1383,7 +1383,7 @@ class TCPDF_FONTS { } // set checkSumAdjustment on head table $checkSumAdjustment = 0xB1B0AFBA - self::_getTTFtableChecksum($font, strlen($font)); - $font = substr($font, 0, $table['head']['offset'] + 8).pack('N', $checkSumAdjustment).substr($font, $table['head']['offset'] + 12); + $font = substr($font, 0, $table['head']['offset'] + $offset + 8).pack('N', $checkSumAdjustment).substr($font, $table['head']['offset'] + $offset + 12); return $font; } @@ -1780,9 +1780,9 @@ class TCPDF_FONTS { */ public static function UTF8ArrayToUniArray($ta, $isunicode=true) { if ($isunicode) { - return array_map(array('TCPDF_FONTS', 'unichrUnicode'), $ta); + return array_map(get_called_class().'::unichrUnicode', $ta); } - return array_map(array('TCPDF_FONTS', 'unichrASCII'), $ta); + return array_map(get_called_class().'::unichrASCII', $ta); } /** @@ -1998,10 +1998,11 @@ class TCPDF_FONTS { * @public static */ public static function UTF8StringToArray($str, $isunicode, &$currentfont) { + $str = is_null($str) ? '' : $str; if ($isunicode) { // requires PCRE unicode support turned on $chars = TCPDF_STATIC::pregSplit('//','u', $str, -1, PREG_SPLIT_NO_EMPTY); - $carr = array_map(array('TCPDF_FONTS', 'uniord'), $chars); + $carr = array_map(get_called_class().'::uniord', $chars); } else { $chars = str_split($str); $carr = array_map('ord', $chars); diff --git a/lib/tecnickcom/tcpdf/include/tcpdf_static.php b/lib/tecnickcom/tcpdf/include/tcpdf_static.php index a118d0588..4c28850e8 100644 --- a/lib/tecnickcom/tcpdf/include/tcpdf_static.php +++ b/lib/tecnickcom/tcpdf/include/tcpdf_static.php @@ -3,11 +3,11 @@ // File name : tcpdf_static.php // Version : 1.1.4 // Begin : 2002-08-03 -// Last Update : 2019-11-01 +// Last Update : 2023-09-06 // Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com // License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html) // ------------------------------------------------------------------- -// Copyright (C) 2002-2021 Nicola Asuni - Tecnick.com LTD +// Copyright (C) 2002-2023 Nicola Asuni - Tecnick.com LTD // // This file is part of TCPDF software library. // @@ -55,7 +55,7 @@ class TCPDF_STATIC { * Current TCPDF version. * @private static */ - private static $tcpdf_version = '6.4.4'; + private static $tcpdf_version = '6.6.5'; /** * String alias for total number of pages. @@ -128,39 +128,6 @@ class TCPDF_STATIC { return "\x54\x43\x50\x44\x46\x20".self::getTCPDFVersion()."\x20\x28\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x74\x63\x70\x64\x66\x2e\x6f\x72\x67\x29"; } - /** - * Sets the current active configuration setting of magic_quotes_runtime (if the set_magic_quotes_runtime function exist) - * @param boolean $mqr FALSE for off, TRUE for on. - * @since 4.6.025 (2009-08-17) - * @public static - */ - public static function set_mqr($mqr) { - if (!defined('PHP_VERSION_ID')) { - $version = PHP_VERSION; - define('PHP_VERSION_ID', (($version[0] * 10000) + ($version[2] * 100) + $version[4])); - } - if (PHP_VERSION_ID < 50300) { - @set_magic_quotes_runtime($mqr); - } - } - - /** - * Gets the current active configuration setting of magic_quotes_runtime (if the get_magic_quotes_runtime function exist) - * @return int Returns 0 if magic quotes runtime is off or get_magic_quotes_runtime doesn't exist, 1 otherwise. - * @since 4.6.025 (2009-08-17) - * @public static - */ - public static function get_mqr() { - if (!defined('PHP_VERSION_ID')) { - $version = PHP_VERSION; - define('PHP_VERSION_ID', (($version[0] * 10000) + ($version[2] * 100) + $version[4])); - } - if (PHP_VERSION_ID < 50300) { - return @get_magic_quotes_runtime(); - } - return 0; - } - /** * Check if the URL exist. * @param string $url URL to check. @@ -319,7 +286,7 @@ class TCPDF_STATIC { */ public static function _escapeXML($str) { $replaceTable = array("\0" => '', '&' => '&', '<' => '<', '>' => '>'); - $str = strtr($str, $replaceTable); + $str = strtr($str === null ? '' : $str, $replaceTable); return $str; } @@ -852,9 +819,7 @@ class TCPDF_STATIC { if (isset($prop['charLimit'])) { $opt['maxlen'] = intval($prop['charLimit']); } - if (!isset($ff)) { - $ff = 0; // default value - } + $ff = 0; // readonly: The read-only characteristic of a field. If a field is read-only, the user can see the field but cannot change it. if (isset($prop['readonly']) AND ($prop['readonly'] == 'true')) { $ff += 1 << 0; @@ -1811,7 +1776,11 @@ class TCPDF_STATIC { $flags = $flags === null ? 0 : $flags; // the bug only happens on PHP 5.2 when using the u modifier if ((strpos($modifiers, 'u') === FALSE) OR (count(preg_split('//u', "\n\t", -1, PREG_SPLIT_NO_EMPTY)) == 2)) { - return preg_split($pattern.$modifiers, $subject, $limit, $flags); + $ret = preg_split($pattern.$modifiers, $subject, $limit, $flags); + if ($ret === false) { + return array(); + } + return is_array($ret) ? $ret : array(); } // preg_split is bugged - try alternative solution $ret = array(); @@ -1887,7 +1856,8 @@ class TCPDF_STATIC { if (isset($urlData['query']) && $urlData['query']) { $urlQueryData = array(); parse_str(urldecode($urlData['query']), $urlQueryData); - $updatedUrl = $urlData['scheme'] . '://' . $urlData['host'] . $urlData['path'] . '?' . http_build_query($urlQueryData); + $port = isset($urlData['port']) ? ':'.$urlData['port'] : ''; + $updatedUrl = $urlData['scheme'].'://'.$urlData['host'].$port.$urlData['path'].'?'.http_build_query($urlQueryData); } else { $updatedUrl = $url; } @@ -2154,7 +2124,7 @@ class TCPDF_STATIC { * Array of page formats * measures are calculated in this way: (inches * 72) or (millimeters * 72 / 25.4) * @public static - * + * * @var array */ public static $page_formats = array( diff --git a/lib/tecnickcom/tcpdf/tcpdf.php b/lib/tecnickcom/tcpdf/tcpdf.php index 400434730..cd0205129 100644 --- a/lib/tecnickcom/tcpdf/tcpdf.php +++ b/lib/tecnickcom/tcpdf/tcpdf.php @@ -1,13 +1,13 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 6.3.2 + * @version 6.6.5 */ // TCPDF configuration @@ -128,7 +128,7 @@ require_once(dirname(__FILE__).'/include/tcpdf_static.php'); * 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.3.2 + * @version 6.6.5 * @author Nicola Asuni - info@tecnick.com * @IgnoreAnnotation("protected") * @IgnoreAnnotation("public") @@ -574,12 +574,14 @@ class TCPDF { /** * Minimum distance between header and top page margin. * @protected + * @var float */ protected $header_margin; /** * Minimum distance between footer and bottom page margin. * @protected + * @var float */ protected $footer_margin; @@ -2024,9 +2026,6 @@ class TCPDF { $this->header_xobj_autoreset = false; $this->custom_xmp = ''; $this->custom_xmp_rdf = ''; - // Call cleanup method after script execution finishes or exit() is called. - // NOTE: This will not be executed if the process is killed with a SIGTERM or SIGKILL signal. - register_shutdown_function(array($this, '_destroy'), true); } /** @@ -2464,7 +2463,7 @@ class TCPDF { */ public function getCellHeight($fontsize, $padding=TRUE) { $height = ($fontsize * $this->cell_height_ratio); - if ($padding) { + if ($padding && !empty($this->cell_padding)) { $height += ($this->cell_padding['T'] + $this->cell_padding['B']); } return round($height, 6); @@ -2530,7 +2529,7 @@ class TCPDF { /** * Returns the page width in units. * @param int|null $pagenum page number (empty = current page) - * @return int page width. + * @return int|float page width. * @author Nicola Asuni * @public * @since 1.5.2 @@ -2546,7 +2545,7 @@ class TCPDF { /** * Returns the page height in units. * @param int|null $pagenum page number (empty = current page) - * @return int page height. + * @return int|float page height. * @author Nicola Asuni * @public * @since 1.5.2 @@ -2562,7 +2561,7 @@ class TCPDF { /** * Returns the page break margin. * @param int|null $pagenum page number (empty = current page) - * @return int page break margin. + * @return int|float page break margin. * @author Nicola Asuni * @public * @since 1.5.2 @@ -2588,9 +2587,9 @@ class TCPDF { /** * Defines the left, top and right margins. - * @param float $left Left margin. - * @param float $top Top margin. - * @param float $right Right margin. Default value is the left one. + * @param int|float $left Left margin. + * @param int|float $top Top margin. + * @param int|float|null $right Right margin. Default value is the left one. * @param boolean $keepmargins if true overwrites the default page margins * @public * @since 1.0 @@ -2613,7 +2612,7 @@ class TCPDF { /** * Defines the left margin. The method can be called before creating the first page. If the current abscissa gets out of page, it is brought back to the margin. - * @param float $margin The margin. + * @param int|float $margin The margin. * @public * @since 1.4 * @see SetTopMargin(), SetRightMargin(), SetAutoPageBreak(), SetMargins() @@ -2628,7 +2627,7 @@ class TCPDF { /** * Defines the top margin. The method can be called before creating the first page. - * @param float $margin The margin. + * @param int|float $margin The margin. * @public * @since 1.5 * @see SetLeftMargin(), SetRightMargin(), SetAutoPageBreak(), SetMargins() @@ -2643,7 +2642,7 @@ class TCPDF { /** * Defines the right margin. The method can be called before creating the first page. - * @param float $margin The margin. + * @param int|float $margin The margin. * @public * @since 1.5 * @see SetLeftMargin(), SetTopMargin(), SetAutoPageBreak(), SetMargins() @@ -2657,7 +2656,7 @@ class TCPDF { /** * Set the same internal Cell padding for top, right, bottom, left- - * @param float $pad internal padding. + * @param int|float $pad internal padding. * @public * @since 2.1.000 (2008-01-09) * @see getCellPaddings(), setCellPaddings() @@ -2673,10 +2672,10 @@ class TCPDF { /** * Set the internal Cell paddings. - * @param float|null $left left padding - * @param float|null $top top padding - * @param float|null $right right padding - * @param float|null $bottom bottom padding + * @param int|float|null $left left padding + * @param int|float|null $top top padding + * @param int|float|null $right right padding + * @param int|float|null $bottom bottom padding * @public * @since 5.9.000 (2010-10-03) * @see getCellPaddings(), SetCellPadding() @@ -2709,10 +2708,10 @@ class TCPDF { /** * Set the internal Cell margins. - * @param float|null $left left margin - * @param float|null $top top margin - * @param float|null $right right margin - * @param float|null $bottom bottom margin + * @param int|float|null $left left margin + * @param int|float|null $top top margin + * @param int|float|null $right right margin + * @param int|float|null $bottom bottom margin * @public * @since 5.9.000 (2010-10-03) * @see getCellMargins() @@ -2745,7 +2744,7 @@ class TCPDF { /** * Adjust the internal Cell padding array to take account of the line width. - * @param string|array|int $brd Indicates if borders must be drawn around the cell. The value can be a number:
    • 0: no border (default)
    • 1: frame
    or a string containing some or all of the following characters (in any order):
    • L: left
    • T: top
    • R: right
    • B: bottom
    or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @param string|array|int|bool $brd Indicates if borders must be drawn around the cell. The value can be a number:
    • 0: no border (default)
    • 1: frame
    or a string containing some or all of the following characters (in any order):
    • L: left
    • T: top
    • R: right
    • B: bottom
    or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) * @return void|array array of adjustments * @public * @since 5.9.000 (2010-10-03) @@ -3375,7 +3374,7 @@ class TCPDF { /** * Set header margin. * (minimum distance between header and top page margin) - * @param int $hm distance in user units + * @param float $hm distance in user units * @public */ public function setHeaderMargin($hm=10) { @@ -3395,7 +3394,7 @@ class TCPDF { /** * Set footer margin. * (minimum distance between footer and bottom page margin) - * @param int $fm distance in user units + * @param float $fm distance in user units * @public */ public function setFooterMargin($fm=10) { @@ -4105,6 +4104,7 @@ class TCPDF { * @param float $fontsize Font size in points. The default value is the current size. * @param boolean $getarray if true returns an array of characters widths, if false returns the total length. * @return float[]|float total string length or array of characted widths + * @phpstan-return ($getarray is true ? float[] : float) total string length or array of characted widths * @author Nicola Asuni * @public * @since 1.2 @@ -4121,6 +4121,7 @@ class TCPDF { * @param float $fontsize Font size in points. The default value is the current size. * @param boolean $getarray if true returns an array of characters widths, if false returns the total length. * @return float[]|float total string length or array of characted widths + * @phpstan-return ($getarray is true ? float[] : float) total string length or array of characted widths * @author Nicola Asuni * @public * @since 2.4.000 (2008-03-06) @@ -4283,7 +4284,7 @@ class TCPDF { // all fonts must be embedded $family = 'pdfa'.$family; } - $tempstyle = strtoupper($style); + $tempstyle = strtoupper($style === null ? '' : $style); $style = ''; // underline if (strpos($tempstyle, 'U') !== false) { @@ -4350,6 +4351,22 @@ class TCPDF { } // include font file if (!TCPDF_STATIC::empty_string($fontfile) AND (@TCPDF_STATIC::file_exists($fontfile))) { + $type=null; + $name=null; + $desc=null; + $up=-null; + $ut=null; + $cw=null; + $cbbox=null; + $dw=null; + $enc=null; + $cidinfo=null; + $file=null; + $ctg=null; + $diff=null; + $originalsize=null; + $size1=null; + $size2=null; include($fontfile); } else { $this->Error('Could not include font definition file: '.$family.''); @@ -5151,6 +5168,7 @@ class TCPDF { */ protected function getCellCode($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M') { // replace 'NO-BREAK SPACE' (U+00A0) character with a simple space + $txt = is_null($txt) ? '' : $txt; $txt = str_replace(TCPDF_FONTS::unichr(160, $this->isunicode), ' ', $txt); $prev_cell_margin = $this->cell_margin; $prev_cell_padding = $this->cell_padding; @@ -5526,12 +5544,12 @@ class TCPDF { $xdk = $xdx * $k; // print text $s .= sprintf('BT %F %F Td [(%s)] TJ ET', $xdk, (($this->h - $basefonty) * $k), $txt2); - if (isset($uniblock)) { + if (isset($uniblock)) { // @phpstan-ignore-line // print overlapping characters as separate string $xshift = 0; // horizontal shift $ty = (($this->h - $basefonty + (0.2 * $this->FontSize)) * $k); $spw = (($w - $txwidth - $this->cell_padding['L'] - $this->cell_padding['R']) / ($ns?$ns:1)); - foreach ($uniblock as $uk => $uniarr) { + foreach ($uniblock as $uk => $uniarr) { // @phpstan-ignore-line if (($uk % 2) == 0) { // x space to skip if ($spacewidth != 0) { @@ -6395,7 +6413,7 @@ class TCPDF { // calculate maximum width for a single character on string $chrw = $this->GetArrStringWidth($chars, '', '', 0, true); array_walk($chrw, array($this, 'getRawCharWidth')); - $maxchwidth = max($chrw); + $maxchwidth = ((is_array($chrw) || $chrw instanceof Countable) && count($chrw) > 0) ? max($chrw) : 0; // get array of chars $uchars = TCPDF_FONTS::UTF8ArrayToUniArray($chars, $this->isunicode); // get the number of characters @@ -6495,14 +6513,16 @@ class TCPDF { $shy = false; // account for margin changes if ((($this->y + $this->lasth) > $this->PageBreakTrigger) AND ($this->inPageBody())) { - $this->AcceptPageBreak(); - if ($this->rtl) { - $this->x -= $margin['R']; - } else { - $this->x += $margin['L']; + if ($this->AcceptPageBreak()) + { + if ($this->rtl) { + $this->x -= $margin['R']; + } else { + $this->x += $margin['L']; + } + $this->lMargin += $margin['L']; + $this->rMargin += $margin['R']; } - $this->lMargin += $margin['L']; - $this->rMargin += $margin['R']; } $w = $this->getRemainingWidth(); $wmax = ($w - $this->cell_padding['L'] - $this->cell_padding['R']); @@ -6700,14 +6720,16 @@ class TCPDF { } // account for margin changes if ((($this->y + $this->lasth) > $this->PageBreakTrigger) AND ($this->inPageBody())) { - $this->AcceptPageBreak(); - if ($this->rtl) { - $this->x -= $margin['R']; - } else { - $this->x += $margin['L']; + if ($this->AcceptPageBreak()) + { + if ($this->rtl) { + $this->x -= $margin['R']; + } else { + $this->x += $margin['L']; + } + $this->lMargin += $margin['L']; + $this->rMargin += $margin['R']; } - $this->lMargin += $margin['L']; - $this->rMargin += $margin['R']; } $w = $this->getRemainingWidth(); $wmax = $w - $this->cell_padding['L'] - $this->cell_padding['R']; @@ -6854,6 +6876,8 @@ class TCPDF { } // resize the block to be contained on the remaining available page or column space if ($fitonpage) { + // fallback to avoid division by zero + $h = $h == 0 ? 1 : $h; $ratio_wh = ($w / $h); if (($y + $h) > $this->PageBreakTrigger) { $h = $this->PageBreakTrigger - $y; @@ -7099,8 +7123,6 @@ class TCPDF { } elseif ($type == 'jpg') { $type = 'jpeg'; } - $mqr = TCPDF_STATIC::get_mqr(); - TCPDF_STATIC::set_mqr(false); // Specific image handlers (defined on TCPDF_IMAGES CLASS) $mtd = '_parse'.$type; // GD image handler function @@ -7202,7 +7224,6 @@ class TCPDF { // unable to process image return false; } - TCPDF_STATIC::set_mqr($mqr); if ($ismask) { // force grayscale $info['cs'] = 'DeviceGray'; @@ -7230,7 +7251,7 @@ class TCPDF { } elseif ($palign == 'R') { $ximg = $this->w - $this->rMargin - $w; } else { - $ximg = $x; + $ximg = $this->rtl ? $x - $w : $x; } if ($ismask OR $hidden) { @@ -7614,7 +7635,7 @@ class TCPDF { * Send the document to a given destination: string, local file or browser. * In the last case, the plug-in may be used (if present) or a download ("Save as" dialog box) may be forced.
    * The method first calls Close() if necessary to terminate the document. - * @param string $name The name of the file when saved. Note that special characters are removed and blanks characters are replaced with the underscore character. + * @param string $name The name of the file when saved * @param string $dest Destination where to send the document. It can take one of the following values:
    • I: send the file inline to the browser (default). The plug-in is used if available. The name given by name is used when one selects the "Save as" option on the link generating the PDF.
    • D: send to the browser and force a file download with the name given by name.
    • F: save to a local server file with the name given by name.
    • S: return the document as a string (name is ignored).
    • FI: equivalent to F + I option
    • FD: equivalent to F + D option
    • E: return the document as base64 mime multi-part email attachment (RFC 2045)
    * @return string * @public @@ -7632,10 +7653,7 @@ class TCPDF { $dest = $dest ? 'D' : 'F'; } $dest = strtoupper($dest); - if ($dest[0] != 'F') { - $name = preg_replace('/[\s]+/', '_', $name); - $name = preg_replace('/[^a-zA-Z0-9_\.-]/', '', $name); - } + if ($this->sign) { // *** apply digital signature to the document *** // get the document content @@ -7706,7 +7724,8 @@ class TCPDF { header('Pragma: public'); header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - header('Content-Disposition: inline; filename="'.basename($name).'"'); + header('Content-Disposition: inline; filename="' . rawurlencode(basename($name)) . '"; ' . + 'filename*=UTF-8\'\'' . rawurlencode(basename($name))); TCPDF_STATIC::sendOutputData($this->getBuffer(), $this->bufferlen); } else { echo $this->getBuffer(); @@ -7737,7 +7756,8 @@ class TCPDF { header('Content-Type: application/pdf'); } // use the Content-Disposition header to supply a recommended filename - header('Content-Disposition: attachment; filename="'.basename($name).'"'); + header('Content-Disposition: attachment; filename="' . rawurlencode(basename($name)) . '"; ' . + 'filename*=UTF-8\'\'' . rawurlencode(basename($name))); header('Content-Transfer-Encoding: binary'); TCPDF_STATIC::sendOutputData($this->getBuffer(), $this->bufferlen); break; @@ -8429,7 +8449,7 @@ class TCPDF { $annots .= ' /Name /Note'; } $hasStateModel = isset($pl['opt']['statemodel']); - $hasState = isset($pl['opt']['state']); + $hasState = isset($pl['opt']['state']); $statemodels = array('Marked', 'Review'); if (!$hasStateModel && !$hasState) { break; @@ -8867,8 +8887,6 @@ class TCPDF { $this->_newobj(); $this->_out('<< /Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$diff.'] >>'."\n".'endobj'); } - $mqr = TCPDF_STATIC::get_mqr(); - TCPDF_STATIC::set_mqr(false); foreach ($this->FontFiles as $file => $info) { // search and get font file to embedd $fontfile = TCPDF_FONTS::getFontFullPath($file, $info['fontdir']); @@ -8922,7 +8940,6 @@ class TCPDF { $this->_out($out); } } - TCPDF_STATIC::set_mqr($mqr); foreach ($this->fontkeys as $k) { //Font objects $font = $this->getFontBuffer($k); @@ -9191,6 +9208,7 @@ class TCPDF { foreach ($this->imagekeys as $file) { $info = $this->getImageBuffer($file); // set object for alternate images array + $altoid = null; if ((!$this->pdfa_mode) AND isset($info['altimgs']) AND !empty($info['altimgs'])) { $altoid = $this->_newobj(); $out = '['; @@ -9238,7 +9256,7 @@ class TCPDF { $out .= ' /Decode [1 0 1 0 1 0 1 0]'; } $out .= ' /BitsPerComponent '.$info['bpc']; - if (isset($altoid) AND ($altoid > 0)) { + if ($altoid > 0) { // reference to alternate images dictionary $out .= ' /Alternates '.$altoid.' 0 R'; } @@ -9913,7 +9931,7 @@ class TCPDF { } $out .= ' >> >>'; } - $font = $this->getFontBuffer('helvetica'); + $font = $this->getFontBuffer((($this->pdfa_mode) ? 'pdfa' : '') .'helvetica'); $out .= ' /DA (/F'.$font['i'].' 0 Tf 0 g)'; $out .= ' /Q '.(($this->rtl)?'2':'0'); //$out .= ' /XFA '; @@ -11698,7 +11716,7 @@ class TCPDF { if ($this->state != 2) { return; } - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { + if (!(false === strpos($style, 'F')) AND is_array($fill_color)) { $this->setFillColorArray($fill_color); } $op = TCPDF_STATIC::getPathPaintOperator($style); @@ -11728,7 +11746,7 @@ class TCPDF { if ($this->state != 2) { return; } - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { + if (!(false === strpos($style, 'F')) AND is_array($fill_color)) { $this->setFillColorArray($fill_color); } $op = TCPDF_STATIC::getPathPaintOperator($style); @@ -11771,7 +11789,7 @@ class TCPDF { if (TCPDF_STATIC::empty_string($ry) OR ($ry == 0)) { $ry = $rx; } - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { + if (!(false === strpos($style, 'F')) AND is_array($fill_color)) { $this->setFillColorArray($fill_color); } $op = TCPDF_STATIC::getPathPaintOperator($style); @@ -11990,7 +12008,7 @@ class TCPDF { } $nc += 4; } - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { + if (!(false === strpos($style, 'F')) AND is_array($fill_color)) { $this->setFillColorArray($fill_color); } $op = TCPDF_STATIC::getPathPaintOperator($style); @@ -12193,7 +12211,7 @@ class TCPDF { return; } // Rounded - if (!(false === strpos($style, 'F')) AND isset($fill_color)) { + if (!(false === strpos($style, 'F')) AND is_array($fill_color)) { $this->setFillColorArray($fill_color); } $op = TCPDF_STATIC::getPathPaintOperator($style); @@ -15072,9 +15090,7 @@ class TCPDF { // translate $this->_out(sprintf('%F %F %F %F %F %F cm', 1, 0, 0, 1, $dx, $dy + ($this->hPt - (2 * $y * $k) - ($y2 - $y1)))); // scale - if (isset($scale_x)) { - $this->_out(sprintf('%F %F %F %F %F %F cm', $scale_x, 0, 0, $scale_y, $x1 * (1 - $scale_x), $y2 * (1 - $scale_y))); - } + $this->_out(sprintf('%F %F %F %F %F %F cm', $scale_x, 0, 0, $scale_y, $x1 * (1 - $scale_x), $y2 * (1 - $scale_y))); // handle pc/unix/mac line endings $lines = preg_split('/[\r\n]+/si', $data, -1, PREG_SPLIT_NO_EMPTY); $u=0; @@ -16017,14 +16033,14 @@ class TCPDF { */ protected function getCSSBorderStyle($cssborder) { $bprop = preg_split('/[\s]+/', trim($cssborder)); + $count = count($bprop); + if ($count > 0 && $bprop[$count - 1] === '!important') { + unset($bprop[$count - 1]); + --$count; + } + $border = array(); // value to be returned - switch (count($bprop)) { - case 3: { - $width = $bprop[0]; - $style = $bprop[1]; - $color = $bprop[2]; - break; - } + switch ($count) { case 2: { $width = 'medium'; $style = $bprop[0]; @@ -16037,12 +16053,18 @@ class TCPDF { $color = 'black'; break; } - default: { + case 0: { $width = 'medium'; $style = 'solid'; $color = 'black'; break; } + default: { + $width = $bprop[0]; + $style = $bprop[1]; + $color = $bprop[2]; + break; + } } if ($style == 'none') { return array(); @@ -16352,6 +16374,7 @@ class TCPDF { break; } default: { + $parentSize = $this->getHTMLUnitToUnits($parent_size, $refsize, $defaultunit, true); $size = $this->getHTMLUnitToUnits($val, $parent_size, $defaultunit, true); } } @@ -17359,6 +17382,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: ++$key; } } + if ($key == $maxel) break; if ($dom[$key]['tag'] AND isset($dom[$key]['attribute']['pagebreak'])) { // check for pagebreak if (($dom[$key]['attribute']['pagebreak'] == 'true') OR ($dom[$key]['attribute']['pagebreak'] == 'left') OR ($dom[$key]['attribute']['pagebreak'] == 'right')) { @@ -17732,7 +17756,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: $pend = ''; } } - if ((isset($plalign) AND ((($plalign == 'C') OR ($plalign == 'J') OR (($plalign == 'R') AND (!$this->rtl)) OR (($plalign == 'L') AND ($this->rtl)))))) { + if ((((($plalign == 'C') OR ($plalign == 'J') OR (($plalign == 'R') AND (!$this->rtl)) OR (($plalign == 'L') AND ($this->rtl)))))) { // calculate shifting amount $tw = $w; if (($plalign == 'J') AND $this->isRTLTextDir() AND ($this->num_columns > 1)) { @@ -18338,7 +18362,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: $dom[$trid]['cellpos'][($cellid - 1)]['bgcolor'] = $dom[$parentid]['bgcolor']; } // store border info - if (isset($tdborder) AND !empty($tdborder)) { + if (!empty($tdborder)) { $dom[$trid]['cellpos'][($cellid - 1)]['border'] = $tdborder; } $prevLastH = $this->lasth; @@ -18574,7 +18598,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: $strrest = $this->Write($this->lasth, $dom[$key]['value'], '', $wfill, '', false, 0, true, $firstblock, 0, $wadj); // restore default direction if ($reverse_dir AND ($wadj == 0)) { - $this->x = $xws; + $this->x = $xws; // @phpstan-ignore-line $this->rtl = !$this->rtl; $reverse_dir = false; } @@ -18683,7 +18707,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: $pend = ''; } } - if ((isset($plalign) AND ((($plalign == 'C') OR (($plalign == 'R') AND (!$this->rtl)) OR (($plalign == 'L') AND ($this->rtl)))))) { + if ((((($plalign == 'C') OR (($plalign == 'R') AND (!$this->rtl)) OR (($plalign == 'L') AND ($this->rtl)))))) { // calculate shifting amount $tw = $w; if ($this->lMargin != $prevlMargin) { @@ -18990,6 +19014,9 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: // data stream $imgsrc = '@'.base64_decode(substr($imgsrc, 1)); $type = ''; + } else if (preg_match('@^data:image/([^;]*);base64,(.*)@', $imgsrc, $reg)) { + $imgsrc = '@'.base64_decode($reg[2]); + $type = $reg[1]; } elseif ( $this->allowLocalFiles && substr($imgsrc, 0, 7) === 'file://') { // get image type from a local file path $imgsrc = substr($imgsrc, 7); @@ -19703,7 +19730,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: $table_el = $dom[($dom[$key]['parent'])]; } // for each row - if (count($table_el['trids']) > 0) { + if (!empty($table_el['trids'])) { unset($xmax); } foreach ($table_el['trids'] as $j => $trkey) { @@ -22034,7 +22061,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: public function setTextRenderingMode($stroke=0, $fill=true, $clip=false) { // Ref.: PDF 32000-1:2008 - 9.3.6 Text Rendering Mode // convert text rendering parameters - if ($stroke < 0) { + if ($stroke < 0 || !is_numeric($stroke)) { $stroke = 0; } if ($fill === true) { @@ -23883,9 +23910,7 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: } $firstcmd = false; } // end foreach - if (!empty($op)) { - $this->_out($op); - } + $this->_out($op); return array($xmin, $ymin, ($xmax - $xmin), ($ymax - $ymin)); } diff --git a/lib/tecnickcom/tcpdf/tcpdf_barcodes_1d.php b/lib/tecnickcom/tcpdf/tcpdf_barcodes_1d.php index 10a79a72e..45d35616c 100644 --- a/lib/tecnickcom/tcpdf/tcpdf_barcodes_1d.php +++ b/lib/tecnickcom/tcpdf/tcpdf_barcodes_1d.php @@ -828,7 +828,7 @@ class TCPDFBarcode { $chr['5'] = '11101011101010'; $chr['6'] = '10111011101010'; $chr['7'] = '10101011101110'; - $chr['8'] = '10101110111010'; + $chr['8'] = '11101010111010'; $chr['9'] = '10111010111010'; if ($checksum) { // add checksum @@ -838,7 +838,7 @@ class TCPDFBarcode { // add leading zero if code-length is odd $code = '0'.$code; } - $seq = '11011010'; + $seq = '1110111010'; $clen = strlen($code); for ($i = 0; $i < $clen; ++$i) { $digit = $code[$i]; @@ -848,7 +848,7 @@ class TCPDFBarcode { } $seq .= $chr[$digit]; } - $seq .= '1101011'; + $seq .= '111010111'; $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); return $this->binseq_to_array($seq, $bararray); } diff --git a/lib/tecnickcom/tcpdf/tcpdf_import.php b/lib/tecnickcom/tcpdf/tcpdf_import.php index cc6fda780..57f9f4f4b 100644 --- a/lib/tecnickcom/tcpdf/tcpdf_import.php +++ b/lib/tecnickcom/tcpdf/tcpdf_import.php @@ -61,7 +61,7 @@ class TCPDF_IMPORT extends TCPDF { /** * Import an existing PDF document * @param string $filename Filename of the PDF document to import. - * @return true in case of success, false otherwise + * @return void * @public * @since 1.0.000 (2011-05-24) */ diff --git a/lib/tecnickcom/tcpdf/tools/.htaccess b/lib/tecnickcom/tcpdf/tools/.htaccess index 8d2f25636..9996e3bde 100644 --- a/lib/tecnickcom/tcpdf/tools/.htaccess +++ b/lib/tecnickcom/tcpdf/tools/.htaccess @@ -1 +1,10 @@ -deny from all +# Apache 2.4 + + Require all denied + + +# Apache 2.2 + + Order Deny,Allow + Deny from all +