From 0ecd76329c05662fdd8a6facb2fe83d8f0903a41 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Mon, 4 May 2026 16:15:30 -0400 Subject: [PATCH] Bump TCPDF from 6.11.2 to 6.11.3 --- plugins/TCPDF/CHANGELOG.TXT | 5 + plugins/TCPDF/Makefile | 154 +++++++++++++++++++++++ plugins/TCPDF/README.md | 168 ++++++++++++++++--------- plugins/TCPDF/VERSION | 2 +- plugins/TCPDF/composer.json | 37 +++++- plugins/TCPDF/include/tcpdf_static.php | 2 +- plugins/TCPDF/tcpdf.php | 6 +- 7 files changed, 305 insertions(+), 69 deletions(-) create mode 100644 plugins/TCPDF/Makefile diff --git a/plugins/TCPDF/CHANGELOG.TXT b/plugins/TCPDF/CHANGELOG.TXT index 9c0d487b..3c600bc8 100644 --- a/plugins/TCPDF/CHANGELOG.TXT +++ b/plugins/TCPDF/CHANGELOG.TXT @@ -1,3 +1,8 @@ +6.11.3 (2026-04-21) + - Added deprecation notice. + - Improved composer.json. + - Added Makefile for common automation tasks. + 6.11.2 (2026-03-03) - Refactor setCompression(). diff --git a/plugins/TCPDF/Makefile b/plugins/TCPDF/Makefile new file mode 100644 index 00000000..83c0df5c --- /dev/null +++ b/plugins/TCPDF/Makefile @@ -0,0 +1,154 @@ +# Makefile +# +# @since 2026-04-21 +# @category Library +# @package TCPDF +# @author Nicola Asuni +# @copyright 2002-2026 Nicola Asuni - Tecnick.com LTD +# @license https://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT) +# @link https://github.com/tecnickcom/TCPDF +# +# This file is part of tcpdf software library. +# ---------------------------------------------------------------------------------------------------------------------- + +SHELL=/bin/bash +.SHELLFLAGS=-o pipefail -c + +# Project owner +OWNER=tecnickcom + +# Project vendor +VENDOR=${OWNER} + +# Project name +PROJECT=tcpdf + +# Project version (strip trailing line endings and accidental literal "\\n") +VERSION=$(shell sed -E 's/\\n$$//' VERSION | tr -d '\r\n') + +# Current directory +CURRENTDIR=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) + +# Target directory +TARGETDIR=$(CURRENTDIR)target + +# sed argument for in-place substitutions +SEDINPLACE=-i +ifeq ($(shell uname -s),Darwin) + SEDINPLACE=-i '' +endif + +# Default port number for the example server +PORT?=8971 + +# PHP binary +PHP=$(shell which php) + +# Composer executable +COMPOSER=$(PHP) -d "apc.enable_cli=0" $(shell which composer) + +# --- MAKE TARGETS --- + +# Display general help about this command +.PHONY: help +help: + @echo "" + @echo "$(PROJECT) Makefile." + @echo "The following commands are available:" + @echo "" + @awk '/^## /{desc=substr($$0,4)} /^\.PHONY:/{if(NF>1) {target=$$2; if(desc) printf " make %-15s: %s\n",target,desc; desc=""}}' Makefile + @echo "" + @echo "To test and build everything from scratch, use the shortcut:" + @echo " make x" + @echo "" + +# Alias for help target +.PHONY: all +all: help + +# Test and build everything from scratch +.PHONY: x +x: buildall + +## Test and build everything from scratch +.PHONY: buildall +buildall: deps + $(MAKE) qa + +## Delete vendor and generated directories +.PHONY: clean +clean: + rm -rf ./vendor ./tests/vendor $(TARGETDIR) ./build ./cache + +## Download dependencies for the library and test harness +.PHONY: deps +deps: ensuretarget + $(COMPOSER) install --no-interaction + @if [ -f ./tests/composer.json ]; then \ + $(COMPOSER) --working-dir=tests install --no-interaction; \ + fi + +## Generate source code documentation with Doctum if available +.PHONY: doc +doc: + @if [ -x ./vendor/bin/doctum ]; then \ + ./vendor/bin/doctum update ./scripts/doctum.php --force; \ + else \ + echo "Doctum is not installed. Run make deps first."; \ + exit 1; \ + fi + +## Create missing target directories for test and build artifacts +.PHONY: ensuretarget +ensuretarget: + mkdir -p $(TARGETDIR)/test + mkdir -p $(TARGETDIR)/report + mkdir -p $(TARGETDIR)/doc + +## Lint PHP files (syntax only) +.PHONY: lint +lint: + find . -type f -name '*.php' \ + -not -path './vendor/*' \ + -not -path './tests/vendor/*' \ + -print0 | xargs -0 -n1 -P4 $(PHP) -l > /dev/null + +## Run all checks +.PHONY: qa +qa: version ensuretarget lint test + +## Generate quality reports (not implemented in this legacy repository) +.PHONY: report +report: ensuretarget + @echo "No additional report target is configured for TCPDF." + +## Start the development server +.PHONY: server +server: + $(PHP) -t examples -S localhost:$(PORT) + +## Tag this git version +.PHONY: tag +tag: + git checkout main && \ + git tag -a ${VERSION} -m "Release ${VERSION}" && \ + git push origin --tags && \ + git pull + +## Run integration tests from tests/launch.sh +.PHONY: test +test: + XDEBUG_MODE=coverage sh ./tests/launch.sh + +## Set the code version from the VERSION file +.PHONY: version +version: + sed $(SEDINPLACE) -E "s#^([[:space:]]*private static [^=]+ = ')[^']*';#\1${VERSION}';#" include/tcpdf_static.php + sed $(SEDINPLACE) -E "1,170 s#^// Version[[:space:]]+: .*#// Version : ${VERSION}#" tcpdf.php + sed $(SEDINPLACE) -E "1,170 s#^ \* @version .*# * @version ${VERSION}#" tcpdf.php + +## Increase the version patch number +.PHONY: versionup +versionup: + echo ${VERSION} | gawk -F. '{printf("%d.%d.%d\n",$$1,$$2,(($$3+1)));}' > VERSION + $(MAKE) version diff --git a/plugins/TCPDF/README.md b/plugins/TCPDF/README.md index cc5a2c1e..00ad81a1 100644 --- a/plugins/TCPDF/README.md +++ b/plugins/TCPDF/README.md @@ -1,83 +1,131 @@ # TCPDF -*PHP PDF Library* +> Legacy PDF engine for PHP. **Deprecated** and maintained for existing integrations. + +[![Latest Stable Version](https://poser.pugx.org/tecnickcom/tcpdf/version)](https://packagist.org/packages/tecnickcom/tcpdf) +[![License](https://poser.pugx.org/tecnickcom/tcpdf/license)](https://packagist.org/packages/tecnickcom/tcpdf) +[![Downloads](https://poser.pugx.org/tecnickcom/tcpdf/downloads)](https://packagist.org/packages/tecnickcom/tcpdf) [![Donate via PayPal](https://img.shields.io/badge/donate-paypal-87ceeb.svg)](https://www.paypal.com/donate/?hosted_button_id=NZUEC5XS8MFBJ) -*Please consider supporting this project by making a donation via [PayPal](https://www.paypal.com/donate/?hosted_button_id=NZUEC5XS8MFBJ)* -* **category** Library -* **author** Nicola Asuni -* **copyright** 2002-2026 Nicola Asuni - Tecnick.com LTD -* **license** https://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT) -* **link** http://www.tcpdf.org -* **source** https://github.com/tecnickcom/TCPDF +If TCPDF helps your business, please consider supporting development via [PayPal](https://www.paypal.com/donate/?hosted_button_id=NZUEC5XS8MFBJ). +--- -## 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. +## Deprecation Notice +TCPDF is **deprecated** and in **maintenance-only mode**. +Active feature development has moved to [tc-lib-pdf](https://github.com/tecnickcom/tc-lib-pdf), the modern and modular successor. -## Description +For new projects, use `tecnickcom/tc-lib-pdf`. This repository remains available for legacy systems and critical compatibility fixes. -PHP library for generating PDF documents on-the-fly. +### Migration Path -### Main Features: -* no external libraries are required for the basic functions; -* all standard page formats, custom page formats, custom margins and units of measure; -* UTF-8 Unicode and Right-To-Left languages; -* TrueTypeUnicode, OpenTypeUnicode v1, TrueType, OpenType v1, Type1 and CID-0 fonts; -* font subsetting; -* methods to publish some XHTML + CSS code, Javascript and Forms; -* images, graphic (geometric figures) and transformation methods; -* supports JPEG, PNG and SVG images natively, all images supported by GD (GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM) and all images supported via ImagMagick (http://www.imagemagick.org/script/formats.php) -* 1D and 2D barcodes: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extension, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS, Datamatrix, QR-Code, PDF417; -* JPEG and PNG ICC profiles, Grayscale, RGB, CMYK, Spot Colors and Transparencies; -* automatic page header and footer management; -* document encryption up to 256 bit and digital signature certifications; -* transactions to UNDO commands; -* PDF annotations, including links, text and file attachments; -* text rendering modes (fill, stroke and clipping); -* multiple columns mode; -* no-write page regions; -* bookmarks, named destinations and table of content; -* text hyphenation; -* text stretching and spacing (tracking); -* automatic page break, line break and text alignments including justification; -* automatic page numbering and page groups; -* move and delete pages; -* page compression (requires php-zlib extension); -* XOBject Templates; -* Layers and object visibility. -* PDF/A-1b support. +- New projects: install `tecnickcom/tc-lib-pdf`. +- Existing TCPDF users: keep TCPDF for current production workloads and migrate in phases. +- Teams seeking modern architecture, Composer-first design, and stronger type-safety should prioritize `tc-lib-pdf`. -### Third party fonts: +### Why Migrate to tc-lib-pdf -This library may include third party font files released with different licenses. +- Modern architecture: modular libraries and cleaner component boundaries improve maintainability. +- Better extensibility: new features are easier to add without patching a monolithic legacy core. +- Stronger tooling fit: modern package structure works better with static analysis, CI, and automated tests. +- Lower long-term risk: reduces technical debt tied to legacy APIs and supports ongoing PHP ecosystem evolution. +- Improved delivery speed: teams can implement and ship new PDF capabilities with less friction. -All the PHP files on the fonts directory are subject to the general TCPDF license (GNU-LGPLv3), -they do not contain any binary data but just a description of the general properties of a particular font. -These files can be also generated on the fly using the font utilities and TCPDF methods. +Migration still requires planning and regression checks to preserve rendering parity for existing documents. -All the original binary TTF font files have been renamed for compatibility with TCPDF and compressed using the gzcompress PHP function that uses the ZLIB data format (.z files). +### Future Compatibility Possibility -The binary files (.z) that begins with the prefix "free" have been extracted from the GNU FreeFont collection (GNU-GPLv3). -The binary files (.z) that begins with the prefix "pdfa" have been derived from the GNU FreeFont, so they are subject to the same license. -For the details of Copyright, License and other information, please check the files inside the directory fonts/freefont-20120503 -Link : https://www.gnu.org/software/freefont/ +As a long-term possibility, TCPDF could be refactored to use `tc-lib-pdf` internally as a backend while preserving a practical level of backward compatibility for existing TCPDF integrations. -The binary files (.z) that begins with the prefix "dejavu" have been extracted from the DejaVu fonts 2.33 (Bitstream) collection. -For the details of Copyright, License and other information, please check the files inside the directory fonts/dejavu-fonts-ttf-2.33 -Link : http://dejavu-fonts.org +This is not part of a committed roadmap and there is no guarantee it will happen. It is documented here only as a potential direction that may be evaluated in the future. -The binary files (.z) that begins with the prefix "ae" have been extracted from the Arabeyes.org collection (GNU-GPLv2). -Link : http://projects.arabeyes.org/ +--- -### ICC profile: +## Overview -TCPDF includes the sRGB.icc profile from the icc-profiles-free Debian package: -https://packages.debian.org/source/stable/icc-profiles-free +TCPDF is a pure-PHP library for generating PDF documents and barcodes directly in application code. +It has been widely used across many PHP stacks and still provides a complete feature set for text rendering, page composition, graphics, signatures, forms, and standards-oriented output. -## Developer(s) Contact +| | | +|---|---| +| **Package** | `tecnickcom/tcpdf` | +| **Author** | Nicola Asuni | +| **License** | [GNU LGPL v3](https://www.gnu.org/copyleft/lesser.html) (see [LICENSE.TXT](LICENSE.TXT)) | +| **Website** | | +| **Source** | | -*2026 Nicola Asuni +--- + +## Features + +### Text & Fonts +- UTF-8 Unicode and right-to-left (RTL) language support +- TrueTypeUnicode, OpenTypeUnicode v1, TrueType, OpenType v1, Type1, and CID-0 fonts +- Font subsetting +- Text hyphenation, stretching, spacing, and rendering modes (fill/stroke/clipping) +- Automatic line breaks, page breaks, and justification + +### Layout & Content +- Standard and custom page formats, margins, and measurement units +- XHTML + CSS rendering, JavaScript, and forms +- Automatic headers and footers +- Multi-column mode and no-write page regions +- Bookmarks, named destinations, and table of contents +- Automatic page numbering, page groups, move/delete pages, and undo transactions + +### Images, Graphics & Color +- Native JPEG, PNG, and SVG support +- Geometric drawing primitives and transformations +- Support for GD image formats (`GD`, `GD2`, `GD2PART`, `GIF`, `JPEG`, `PNG`, `BMP`, `XBM`, `XPM`) +- Additional formats via ImageMagick (when available) +- JPEG/PNG ICC profiles, grayscale/RGB/CMYK/spot colors, and transparencies + +### Security, Standards & Advanced Output +- Encryption up to 256-bit and digital signature certifications +- PDF annotations (links, text, and file attachments) +- 1D and 2D barcode support (including CODE 128, EAN/UPC, Datamatrix, QR Code, PDF417) +- XObject templates and layers with object visibility controls +- PDF/A-1b support + +--- + +## Requirements + +- PHP 7.1 or later +- `ext-curl` + +Optional extensions for richer output in some workflows: `gd`, `zlib`, `imagick`. + +--- + +## Third-Party Fonts + +This library may include third-party font files released under different licenses. + +PHP metadata files under [fonts](fonts) are covered by the TCPDF license (GNU LGPL v3). They contain font metadata and can also be generated using TCPDF font utilities. + +Original binary TTF files are renamed for compatibility and compressed with PHP `gzcompress` (the `.z` format). + +| Prefix | Source | License | +|---|---|---| +| `free*` | [GNU FreeFont](https://www.gnu.org/software/freefont/) | GNU GPL v3 | +| `pdfa*` | Derived from GNU FreeFont | GNU GPL v3 | +| `dejavu*` | [DejaVu Fonts](http://dejavu-fonts.org) | Bitstream/DejaVu terms | +| `ae*` | [Arabeyes.org](http://projects.arabeyes.org/) | GNU GPL v2 | + +For full details, see the bundled notices in the corresponding subdirectories under [fonts](fonts). + +--- + +## ICC Profile + +TCPDF includes `sRGB.icc` from the Debian [`icc-profiles-free`](https://packages.debian.org/source/stable/icc-profiles-free) package. + +--- + +## Contact + +Nicola Asuni diff --git a/plugins/TCPDF/VERSION b/plugins/TCPDF/VERSION index e18a34b9..060e73a6 100644 --- a/plugins/TCPDF/VERSION +++ b/plugins/TCPDF/VERSION @@ -1 +1 @@ -6.11.2 +6.11.3 \ No newline at end of file diff --git a/plugins/TCPDF/composer.json b/plugins/TCPDF/composer.json index ac175a7f..cc5904d2 100644 --- a/plugins/TCPDF/composer.json +++ b/plugins/TCPDF/composer.json @@ -1,7 +1,7 @@ { "name": "tecnickcom/tcpdf", "type": "library", - "description": "TCPDF is a PHP class for generating PDF documents and barcodes.", + "description": "Deprecated legacy PDF engine for PHP. For new projects use tecnickcom/tc-lib-pdf.", "keywords": [ "PDF", "tcpdf", @@ -11,8 +11,7 @@ "pdf417", "barcodes" ], - "homepage": "http://www.tcpdf.org/", - "version": "6.11.2", + "homepage": "https://tcpdf.org", "license": "LGPL-3.0-or-later", "authors": [ { @@ -25,6 +24,17 @@ "php": ">=7.1.0", "ext-curl": "*" }, + "suggest": { + "tecnickcom/tc-lib-pdf": "Modern replacement for TCPDF for new projects.", + "ext-gd": "Enables additional image handling in some workflows.", + "ext-imagick": "Enables additional image format support when available.", + "ext-zlib": "Recommended for compressed streams and related features." + }, + "minimum-stability": "dev", + "prefer-stable": true, + "config": { + "sort-packages": true + }, "autoload": { "classmap": [ "config", @@ -42,5 +52,24 @@ "include/barcodes/pdf417.php", "include/barcodes/qrcode.php" ] - } + }, + "archive": { + "exclude": [ + "/.github", + "/.phpdoc", + "/examples", + "/scripts", + "/tests" + ] + }, + "support": { + "issues": "https://github.com/tecnickcom/TCPDF/issues", + "source": "https://github.com/tecnickcom/TCPDF" + }, + "funding": [ + { + "type": "paypal", + "url": "https://www.paypal.com/donate/?hosted_button_id=NZUEC5XS8MFBJ" + } + ] } diff --git a/plugins/TCPDF/include/tcpdf_static.php b/plugins/TCPDF/include/tcpdf_static.php index dc157263..86dbad57 100644 --- a/plugins/TCPDF/include/tcpdf_static.php +++ b/plugins/TCPDF/include/tcpdf_static.php @@ -55,7 +55,7 @@ class TCPDF_STATIC { * Current TCPDF version. * @private static */ - private static $tcpdf_version = '6.11.2'; + private static $tcpdf_version = '6.11.3'; /** * String alias for total number of pages. diff --git a/plugins/TCPDF/tcpdf.php b/plugins/TCPDF/tcpdf.php index cffe210d..b369532d 100644 --- a/plugins/TCPDF/tcpdf.php +++ b/plugins/TCPDF/tcpdf.php @@ -1,7 +1,7 @@ * @package com.tecnick.tcpdf * @author Nicola Asuni - * @version 6.11.2 + * @version 6.11.3 */ // 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.11.2 + * @version 6.11.3 * @author Nicola Asuni - info@tecnick.com * @IgnoreAnnotation("protected") * @IgnoreAnnotation("public")