From a5754de1d140b01be85f39fe75bfe7e9946d96b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Mon, 11 May 2026 19:28:48 -0300 Subject: [PATCH] Upgrade TCPDF for GIS visualization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Uses new tc-lib-pdf package. Signed-off-by: MaurĂ­cio Meneghini Fauth --- app/constants.php | 1 + composer.json | 12 +- composer.lock | 910 +++++++++++++++++- src/Gis/GisGeometry.php | 4 +- src/Gis/GisGeometryCollection.php | 4 +- src/Gis/GisLineString.php | 15 +- src/Gis/GisMultiLineString.php | 15 +- src/Gis/GisMultiPoint.php | 15 +- src/Gis/GisMultiPolygon.php | 15 +- src/Gis/GisPoint.php | 15 +- src/Gis/GisPolygon.php | 16 +- src/Gis/GisVisualization.php | 31 +- tests/test_data/gis/empty-expected.pdf | Bin 6882 -> 6474 bytes tests/test_data/gis/geometries-expected.pdf | Bin 11357 -> 10457 bytes .../gis/geometrycollection-expected.pdf | Bin 11406 -> 10506 bytes tests/unit/Gis/GisVisualizationTest.php | 51 +- 16 files changed, 1017 insertions(+), 87 deletions(-) diff --git a/app/constants.php b/app/constants.php index c83c4afb6556..74d43c68aac1 100644 --- a/app/constants.php +++ b/app/constants.php @@ -44,6 +44,7 @@ * @see https://github.com/phpmyadmin/phpmyadmin/issues/16709 */ define('K_PATH_IMAGES', ROOT_PATH); +define('K_PATH_FONTS', realpath(__DIR__ . '/../vendor/tecnickcom/tc-lib-pdf-font/target/fonts')); // phpcs:enable unset($vendorConfig); diff --git a/composer.json b/composer.json index 4a6b7458053a..608ae155b080 100644 --- a/composer.json +++ b/composer.json @@ -120,6 +120,7 @@ "pragmarx/google2fa-qrcode": "^3.0", "psalm/plugin-phpunit": "^0.19", "symfony/console": "^7.1", + "tecnickcom/tc-lib-pdf": "^8.20", "tecnickcom/tcpdf": "^6.4.4", "vimeo/psalm": "^6.0", "web-auth/webauthn-lib": "^4.9" @@ -145,7 +146,16 @@ "@php phpstan analyse --generate-baseline", "@php psalm --no-cache --threads=max --set-baseline=psalm-baseline.xml" ], - "twig-lint": "@php bin/console lint:twig --ansi --show-deprecations" + "twig-lint": "@php bin/console lint:twig --ansi --show-deprecations", + "tc-lib-pdf-fonts": [ + "[ -d vendor/tecnickcom/tc-lib-pdf-font ] && make -C vendor/tecnickcom/tc-lib-pdf-font deps fonts || true" + ], + "post-install-cmd": [ + "@tc-lib-pdf-fonts" + ], + "post-update-cmd": [ + "@tc-lib-pdf-fonts" + ] }, "config":{ "sort-packages": true, diff --git a/composer.lock b/composer.lock index ad2cb4890b80..e5ce35c8bc14 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": "73186323ccc5039f8a832b45873d703f", + "content-hash": "5c2df82ccce7cbcdb08f3bd6eb228cb2", "packages": [ { "name": "composer/ca-bundle", @@ -8510,6 +8510,914 @@ ], "time": "2026-03-24T13:12:05+00:00" }, + { + "name": "tecnickcom/tc-lib-barcode", + "version": "2.4.39", + "source": { + "type": "git", + "url": "https://github.com/tecnickcom/tc-lib-barcode.git", + "reference": "11886fb5a44ec0f6e77302439e9ebf55034383fa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tecnickcom/tc-lib-barcode/zipball/11886fb5a44ec0f6e77302439e9ebf55034383fa", + "reference": "11886fb5a44ec0f6e77302439e9ebf55034383fa", + "shasum": "" + }, + "require": { + "ext-bcmath": "*", + "ext-date": "*", + "ext-gd": "*", + "ext-pcre": "*", + "php": ">=8.1", + "tecnickcom/tc-lib-color": "^2.5" + }, + "require-dev": { + "pdepend/pdepend": "^2.16", + "phpcompatibility/php-compatibility": "^10.0.0@dev", + "phpmd/phpmd": "^2.15", + "phpunit/phpunit": "^13.1 || ^12.5 || ^11.5 || ^10.5", + "squizlabs/php_codesniffer": "^4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Com\\Tecnick\\Barcode\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Nicola Asuni", + "email": "info@tecnick.com", + "role": "lead" + } + ], + "description": "PHP library to generate linear and bidimensional barcodes", + "homepage": "https://tcpdf.org", + "keywords": [ + "3 of 9", + "ANSI MH10.8M-1983", + "CBC", + "CODABAR", + "CODE 11", + "CODE 128 A B C", + "CODE 39", + "CODE 93", + "EAN 13", + "EAN 8", + "ECC200", + "ISO IEC 15438 2006", + "ISO IEC 16022", + "ISO IEC 24778 2008", + "Intelligent Mail Barcode", + "Interleaved 2 of 5", + "KIX", + "Klant", + "MSI", + "Onecode", + "PHARMACODE", + "PHARMACODE TWO-TRACKS", + "POSTNET", + "RMS4CC", + "Standard 2 of 5", + "UPC-A", + "UPC-E", + "USD-3", + "USPS-B-3200", + "USS-93", + "aztec", + "barcode", + "datamatrix", + "pdf417", + "planet", + "qr-code", + "royal mail", + "tc-lib-barcode", + "upc" + ], + "support": { + "issues": "https://github.com/tecnickcom/tc-lib-barcode/issues", + "source": "https://github.com/tecnickcom/tc-lib-barcode" + }, + "funding": [ + { + "url": "https://github.com/sponsors/tecnickcom", + "type": "github" + } + ], + "time": "2026-05-01T19:04:12+00:00" + }, + { + "name": "tecnickcom/tc-lib-color", + "version": "2.5.3", + "source": { + "type": "git", + "url": "https://github.com/tecnickcom/tc-lib-color.git", + "reference": "136d522f1640723e490b79171e910e647403d971" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tecnickcom/tc-lib-color/zipball/136d522f1640723e490b79171e910e647403d971", + "reference": "136d522f1640723e490b79171e910e647403d971", + "shasum": "" + }, + "require": { + "ext-pcre": "*", + "php": ">=8.1" + }, + "require-dev": { + "pdepend/pdepend": "^2.16", + "phpcompatibility/php-compatibility": "^10.0.0@dev", + "phpmd/phpmd": "^2.15", + "phpunit/phpunit": "^13.1 || ^12.5 || ^11.5 || ^10.5", + "squizlabs/php_codesniffer": "^4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Com\\Tecnick\\Color\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Nicola Asuni", + "email": "info@tecnick.com", + "role": "lead" + } + ], + "description": "PHP library to manipulate various color representations", + "homepage": "https://tcpdf.org", + "keywords": [ + "cmyk", + "color", + "colors", + "colour", + "colours", + "hsl", + "hsla", + "javascript", + "rgb", + "rgba", + "tc-lib-color", + "web" + ], + "support": { + "issues": "https://github.com/tecnickcom/tc-lib-color/issues", + "source": "https://github.com/tecnickcom/tc-lib-color" + }, + "funding": [ + { + "url": "https://github.com/sponsors/tecnickcom", + "type": "github" + } + ], + "time": "2026-05-01T19:02:25+00:00" + }, + { + "name": "tecnickcom/tc-lib-file", + "version": "2.5.2", + "source": { + "type": "git", + "url": "https://github.com/tecnickcom/tc-lib-file.git", + "reference": "5b8515d77dfb5e387b3070423b84b96981be060f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tecnickcom/tc-lib-file/zipball/5b8515d77dfb5e387b3070423b84b96981be060f", + "reference": "5b8515d77dfb5e387b3070423b84b96981be060f", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-pcre": "*", + "php": ">=8.1" + }, + "require-dev": { + "pdepend/pdepend": "^2.16", + "phpcompatibility/php-compatibility": "^10.0.0@dev", + "phpmd/phpmd": "^2.15", + "phpunit/phpunit": "^13.1 || ^12.5 || ^11.5 || ^10.5", + "squizlabs/php_codesniffer": "^4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Com\\Tecnick\\File\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Nicola Asuni", + "email": "info@tecnick.com", + "role": "lead" + } + ], + "description": "PHP library to read byte-level data from files", + "homepage": "https://tcpdf.org", + "keywords": [ + "Double", + "bit", + "byte", + "file", + "long", + "read", + "short", + "tc-lib-file" + ], + "support": { + "issues": "https://github.com/tecnickcom/tc-lib-file/issues", + "source": "https://github.com/tecnickcom/tc-lib-file" + }, + "funding": [ + { + "url": "https://github.com/sponsors/tecnickcom", + "type": "github" + } + ], + "time": "2026-05-01T19:02:40+00:00" + }, + { + "name": "tecnickcom/tc-lib-pdf", + "version": "8.20.0", + "source": { + "type": "git", + "url": "https://github.com/tecnickcom/tc-lib-pdf.git", + "reference": "1848df4f74957dce5a14f3623082daf6429b3a9c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tecnickcom/tc-lib-pdf/zipball/1848df4f74957dce5a14f3623082daf6429b3a9c", + "reference": "1848df4f74957dce5a14f3623082daf6429b3a9c", + "shasum": "" + }, + "require": { + "ext-date": "*", + "ext-pcre": "*", + "php": ">=8.1", + "tecnickcom/tc-lib-barcode": "^2.4", + "tecnickcom/tc-lib-color": "^2.5", + "tecnickcom/tc-lib-file": "^2.5", + "tecnickcom/tc-lib-pdf-encrypt": "^2.2", + "tecnickcom/tc-lib-pdf-font": "^2.12", + "tecnickcom/tc-lib-pdf-graph": "^2.4", + "tecnickcom/tc-lib-pdf-image": "^2.2", + "tecnickcom/tc-lib-pdf-page": "^4.3", + "tecnickcom/tc-lib-pdf-parser": "^3.1", + "tecnickcom/tc-lib-unicode": "^2.1", + "tecnickcom/tc-lib-unicode-data": "^2.0" + }, + "require-dev": { + "pdepend/pdepend": "^2.16", + "phpcompatibility/php-compatibility": "^10.0.0@dev", + "phpmd/phpmd": "^2.15", + "phpunit/phpunit": "^13.1 || ^12.5 || ^11.5 || ^10.5", + "squizlabs/php_codesniffer": "^4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Com\\Tecnick\\Pdf\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Nicola Asuni", + "email": "info@tecnick.com", + "role": "lead" + } + ], + "description": "PHP PDF Library", + "homepage": "https://tcpdf.org", + "keywords": [ + "PDFD32000-2008", + "TCPDF", + "document", + "pdf", + "tc-lib-pdf" + ], + "support": { + "issues": "https://github.com/tecnickcom/tc-lib-pdf/issues", + "source": "https://github.com/tecnickcom/tc-lib-pdf" + }, + "funding": [ + { + "url": "https://github.com/sponsors/tecnickcom", + "type": "github" + } + ], + "time": "2026-05-10T21:44:55+00:00" + }, + { + "name": "tecnickcom/tc-lib-pdf-encrypt", + "version": "2.2.2", + "source": { + "type": "git", + "url": "https://github.com/tecnickcom/tc-lib-pdf-encrypt.git", + "reference": "59237c2ba96e3d2ded12ce3dafcebd666036a81a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tecnickcom/tc-lib-pdf-encrypt/zipball/59237c2ba96e3d2ded12ce3dafcebd666036a81a", + "reference": "59237c2ba96e3d2ded12ce3dafcebd666036a81a", + "shasum": "" + }, + "require": { + "ext-date": "*", + "ext-hash": "*", + "ext-openssl": "*", + "ext-pcre": "*", + "php": ">=8.1" + }, + "require-dev": { + "pdepend/pdepend": "^2.16", + "phpcompatibility/php-compatibility": "^10.0.0@dev", + "phpmd/phpmd": "^2.15", + "phpunit/phpunit": "^13.1 || ^12.5 || ^11.5 || ^10.5", + "squizlabs/php_codesniffer": "^4.0" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "autoload": { + "psr-4": { + "Com\\Tecnick\\Pdf\\Encrypt\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Nicola Asuni", + "email": "info@tecnick.com", + "role": "lead" + } + ], + "description": "PHP library to encrypt data for PDF", + "homepage": "https://tcpdf.org", + "keywords": [ + "aes", + "encrypt", + "encryption", + "pdf", + "rc4", + "tc-lib-pdf-encrypt" + ], + "support": { + "issues": "https://github.com/tecnickcom/tc-lib-pdf-encrypt/issues", + "source": "https://github.com/tecnickcom/tc-lib-pdf-encrypt" + }, + "funding": [ + { + "url": "https://github.com/sponsors/tecnickcom", + "type": "github" + } + ], + "time": "2026-05-01T19:02:57+00:00" + }, + { + "name": "tecnickcom/tc-lib-pdf-filter", + "version": "2.1.2", + "source": { + "type": "git", + "url": "https://github.com/tecnickcom/tc-lib-pdf-filter.git", + "reference": "547a3b05d15e623d0edbedab54d4332a823cd6e6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tecnickcom/tc-lib-pdf-filter/zipball/547a3b05d15e623d0edbedab54d4332a823cd6e6", + "reference": "547a3b05d15e623d0edbedab54d4332a823cd6e6", + "shasum": "" + }, + "require": { + "ext-pcre": "*", + "ext-zlib": "*", + "php": ">=8.1" + }, + "require-dev": { + "pdepend/pdepend": "^2.16", + "phpcompatibility/php-compatibility": "^10.0.0@dev", + "phpmd/phpmd": "^2.15", + "phpunit/phpunit": "^13.1 || ^12.5 || ^11.5 || ^10.5", + "squizlabs/php_codesniffer": "^4.0" + }, + "suggest": { + "ext-imagick": "Required for JPXDecode (JPEG 2000) filter support" + }, + "type": "library", + "autoload": { + "psr-4": { + "Com\\Tecnick\\Pdf\\Filter\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Nicola Asuni", + "email": "info@tecnick.com", + "role": "lead" + } + ], + "description": "PHP library to decode PDF compression and encryption filters", + "homepage": "https://tcpdf.org", + "keywords": [ + "compression", + "encryption", + "filter", + "pdf", + "tc-lib-pdf-filter" + ], + "support": { + "issues": "https://github.com/tecnickcom/tc-lib-pdf-filter/issues", + "source": "https://github.com/tecnickcom/tc-lib-pdf-filter" + }, + "funding": [ + { + "url": "https://github.com/sponsors/tecnickcom", + "type": "github" + } + ], + "time": "2026-05-01T19:03:10+00:00" + }, + { + "name": "tecnickcom/tc-lib-pdf-font", + "version": "2.12.0", + "source": { + "type": "git", + "url": "https://github.com/tecnickcom/tc-lib-pdf-font.git", + "reference": "b4c96f0556a42208bea02802c23cdbfea96f3d73" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tecnickcom/tc-lib-pdf-font/zipball/b4c96f0556a42208bea02802c23cdbfea96f3d73", + "reference": "b4c96f0556a42208bea02802c23cdbfea96f3d73", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-pcre": "*", + "ext-zlib": "*", + "php": ">=8.1", + "tecnickcom/tc-lib-file": "^2.5", + "tecnickcom/tc-lib-pdf-encrypt": "^2.2", + "tecnickcom/tc-lib-unicode-data": "^2.0" + }, + "require-dev": { + "pdepend/pdepend": "^2.16", + "phpcompatibility/php-compatibility": "^10.0.0@dev", + "phpmd/phpmd": "^2.15", + "phpunit/phpunit": "^13.1 || ^12.5 || ^11.5 || ^10.5", + "squizlabs/php_codesniffer": "^4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Com\\Tecnick\\Pdf\\Font\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Nicola Asuni", + "email": "info@tecnick.com", + "role": "lead" + } + ], + "description": "PHP library containing PDF page formats and definitions", + "homepage": "https://tcpdf.org", + "keywords": [ + "PFB", + "afm", + "font", + "import", + "pdf", + "tc-lib-pdf-font", + "ttf" + ], + "support": { + "issues": "https://github.com/tecnickcom/tc-lib-pdf-font/issues", + "source": "https://github.com/tecnickcom/tc-lib-pdf-font" + }, + "funding": [ + { + "url": "https://github.com/sponsors/tecnickcom", + "type": "github" + } + ], + "time": "2026-05-07T20:21:51+00:00" + }, + { + "name": "tecnickcom/tc-lib-pdf-graph", + "version": "2.4.24", + "source": { + "type": "git", + "url": "https://github.com/tecnickcom/tc-lib-pdf-graph.git", + "reference": "0d21ec87996292724498ea201b2a1d3d7fddbbb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tecnickcom/tc-lib-pdf-graph/zipball/0d21ec87996292724498ea201b2a1d3d7fddbbb6", + "reference": "0d21ec87996292724498ea201b2a1d3d7fddbbb6", + "shasum": "" + }, + "require": { + "ext-zlib": "*", + "php": ">=8.1", + "tecnickcom/tc-lib-color": "^2.5", + "tecnickcom/tc-lib-pdf-encrypt": "^2.2" + }, + "require-dev": { + "pdepend/pdepend": "^2.16", + "phpcompatibility/php-compatibility": "^10.0.0@dev", + "phpmd/phpmd": "^2.15", + "phpunit/phpunit": "^13.1 || ^12.5 || ^11.5 || ^10.5", + "squizlabs/php_codesniffer": "^4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Com\\Tecnick\\Pdf\\Graph\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Nicola Asuni", + "email": "info@tecnick.com", + "role": "lead" + } + ], + "description": "PHP library containing PDF graphic and geometric methods", + "homepage": "https://tcpdf.org", + "keywords": [ + "geometry", + "graphic", + "pdf", + "tc-lib-pdf-graph", + "transformation" + ], + "support": { + "issues": "https://github.com/tecnickcom/tc-lib-pdf-graph/issues", + "source": "https://github.com/tecnickcom/tc-lib-pdf-graph" + }, + "funding": [ + { + "url": "https://github.com/sponsors/tecnickcom", + "type": "github" + } + ], + "time": "2026-05-05T18:15:43+00:00" + }, + { + "name": "tecnickcom/tc-lib-pdf-image", + "version": "2.2.2", + "source": { + "type": "git", + "url": "https://github.com/tecnickcom/tc-lib-pdf-image.git", + "reference": "043dd072c2a8620dc967a3dd73ee65240e270f6a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tecnickcom/tc-lib-pdf-image/zipball/043dd072c2a8620dc967a3dd73ee65240e270f6a", + "reference": "043dd072c2a8620dc967a3dd73ee65240e270f6a", + "shasum": "" + }, + "require": { + "ext-gd": "*", + "ext-zlib": "*", + "php": ">=8.1", + "tecnickcom/tc-lib-color": "^2.5", + "tecnickcom/tc-lib-file": "^2.5", + "tecnickcom/tc-lib-pdf-encrypt": "^2.2" + }, + "require-dev": { + "pdepend/pdepend": "^2.16", + "phpcompatibility/php-compatibility": "^10.0.0@dev", + "phpmd/phpmd": "^2.15", + "phpunit/phpunit": "^13.1 || ^12.5 || ^11.5 || ^10.5", + "squizlabs/php_codesniffer": "^4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Com\\Tecnick\\Pdf\\Image\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Nicola Asuni", + "email": "info@tecnick.com", + "role": "lead" + } + ], + "description": "PHP library containing PDF Image methods", + "homepage": "https://tcpdf.org", + "keywords": [ + "image", + "jpeg", + "jpg", + "pdf", + "png", + "tc-lib-pdf-image" + ], + "support": { + "issues": "https://github.com/tecnickcom/tc-lib-pdf-image/issues", + "source": "https://github.com/tecnickcom/tc-lib-pdf-image" + }, + "funding": [ + { + "url": "https://github.com/sponsors/tecnickcom", + "type": "github" + } + ], + "time": "2026-05-01T19:05:52+00:00" + }, + { + "name": "tecnickcom/tc-lib-pdf-page", + "version": "4.3.23", + "source": { + "type": "git", + "url": "https://github.com/tecnickcom/tc-lib-pdf-page.git", + "reference": "0f2207b9d0f16358fb6f5747d3c4f9fde88c5c34" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tecnickcom/tc-lib-pdf-page/zipball/0f2207b9d0f16358fb6f5747d3c4f9fde88c5c34", + "reference": "0f2207b9d0f16358fb6f5747d3c4f9fde88c5c34", + "shasum": "" + }, + "require": { + "ext-date": "*", + "ext-zlib": "*", + "php": ">=8.1", + "tecnickcom/tc-lib-color": "^2.5", + "tecnickcom/tc-lib-pdf-encrypt": "^2.2" + }, + "require-dev": { + "pdepend/pdepend": "^2.16", + "phpcompatibility/php-compatibility": "^10.0.0@dev", + "phpmd/phpmd": "^2.15", + "phpunit/phpunit": "^13.1 || ^12.5 || ^11.5 || ^10.5", + "squizlabs/php_codesniffer": "^4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Com\\Tecnick\\Pdf\\Page\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Nicola Asuni", + "email": "info@tecnick.com", + "role": "lead" + } + ], + "description": "PHP library containing PDF page formats and definitions", + "homepage": "https://tcpdf.org", + "keywords": [ + "format", + "page", + "pdf", + "tc-lib-pdf-page" + ], + "support": { + "issues": "https://github.com/tecnickcom/tc-lib-pdf-page/issues", + "source": "https://github.com/tecnickcom/tc-lib-pdf-page" + }, + "funding": [ + { + "url": "https://github.com/sponsors/tecnickcom", + "type": "github" + } + ], + "time": "2026-05-01T19:05:18+00:00" + }, + { + "name": "tecnickcom/tc-lib-pdf-parser", + "version": "3.1.2", + "source": { + "type": "git", + "url": "https://github.com/tecnickcom/tc-lib-pdf-parser.git", + "reference": "9f0c184eec9258c8671ad7a745e99608ea5515b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tecnickcom/tc-lib-pdf-parser/zipball/9f0c184eec9258c8671ad7a745e99608ea5515b6", + "reference": "9f0c184eec9258c8671ad7a745e99608ea5515b6", + "shasum": "" + }, + "require": { + "ext-pcre": "*", + "php": ">=8.1", + "tecnickcom/tc-lib-pdf-filter": "^2.1" + }, + "require-dev": { + "pdepend/pdepend": "^2.16", + "phpcompatibility/php-compatibility": "^10.0.0@dev", + "phpmd/phpmd": "^2.15", + "phpunit/phpunit": "^13.1 || ^12.5 || ^11.5 || ^10.5", + "squizlabs/php_codesniffer": "^4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Com\\Tecnick\\Pdf\\Parser\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Nicola Asuni", + "email": "info@tecnick.com", + "role": "lead" + } + ], + "description": "PHP library to parse PDF documents", + "homepage": "https://tcpdf.org", + "keywords": [ + "document", + "parser", + "pdf", + "tc-lib-pdf-parser" + ], + "support": { + "issues": "https://github.com/tecnickcom/tc-lib-pdf-parser/issues", + "source": "https://github.com/tecnickcom/tc-lib-pdf-parser" + }, + "funding": [ + { + "url": "https://github.com/sponsors/tecnickcom", + "type": "github" + } + ], + "time": "2026-05-01T19:04:32+00:00" + }, + { + "name": "tecnickcom/tc-lib-unicode", + "version": "2.1.2", + "source": { + "type": "git", + "url": "https://github.com/tecnickcom/tc-lib-unicode.git", + "reference": "b31d4b29708177fb1e67612fdbc85c05aec64431" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tecnickcom/tc-lib-unicode/zipball/b31d4b29708177fb1e67612fdbc85c05aec64431", + "reference": "b31d4b29708177fb1e67612fdbc85c05aec64431", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "ext-pcre": "*", + "php": ">=8.1", + "tecnickcom/tc-lib-unicode-data": "^2.0" + }, + "require-dev": { + "pdepend/pdepend": "^2.16", + "phpcompatibility/php-compatibility": "^10.0.0@dev", + "phpmd/phpmd": "^2.15", + "phpunit/phpunit": "^13.1 || ^12.5 || ^11.5 || ^10.5", + "squizlabs/php_codesniffer": "^4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Com\\Tecnick\\Unicode\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Nicola Asuni", + "email": "info@tecnick.com", + "role": "lead" + } + ], + "description": "PHP library containing Unicode methods", + "homepage": "https://tcpdf.org", + "keywords": [ + "font", + "pdf", + "tc-lib-unicode", + "unicode", + "utf-8" + ], + "support": { + "issues": "https://github.com/tecnickcom/tc-lib-unicode/issues", + "source": "https://github.com/tecnickcom/tc-lib-unicode" + }, + "funding": [ + { + "url": "https://github.com/sponsors/tecnickcom", + "type": "github" + } + ], + "time": "2026-05-01T19:05:00+00:00" + }, + { + "name": "tecnickcom/tc-lib-unicode-data", + "version": "2.0.53", + "source": { + "type": "git", + "url": "https://github.com/tecnickcom/tc-lib-unicode-data.git", + "reference": "c0e5ca58418eb8ca3f4aad220e45a71d9ab14eea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tecnickcom/tc-lib-unicode-data/zipball/c0e5ca58418eb8ca3f4aad220e45a71d9ab14eea", + "reference": "c0e5ca58418eb8ca3f4aad220e45a71d9ab14eea", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "pdepend/pdepend": "^2.16", + "phpcompatibility/php-compatibility": "^10.0.0@dev", + "phpmd/phpmd": "^2.15", + "phpunit/phpunit": "^13.1 || ^12.5 || ^11.5 || ^10.5", + "squizlabs/php_codesniffer": "^4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Com\\Tecnick\\Unicode\\Data\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Nicola Asuni", + "email": "info@tecnick.com", + "role": "lead" + } + ], + "description": "PHP library containing Unicode definitions", + "homepage": "https://tcpdf.org", + "keywords": [ + "font", + "pdf", + "tc-lib-unicode-data", + "unicode", + "utf-8" + ], + "support": { + "issues": "https://github.com/tecnickcom/tc-lib-unicode-data/issues", + "source": "https://github.com/tecnickcom/tc-lib-unicode-data" + }, + "funding": [ + { + "url": "https://github.com/sponsors/tecnickcom", + "type": "github" + } + ], + "time": "2026-05-01T19:03:32+00:00" + }, { "name": "tecnickcom/tcpdf", "version": "6.11.3", diff --git a/src/Gis/GisGeometry.php b/src/Gis/GisGeometry.php index 69fac586fcb6..c5b6670d4af6 100644 --- a/src/Gis/GisGeometry.php +++ b/src/Gis/GisGeometry.php @@ -7,10 +7,10 @@ namespace PhpMyAdmin\Gis; +use Com\Tecnick\Pdf\Tcpdf; use PhpMyAdmin\Gis\Ds\Extent; use PhpMyAdmin\Gis\Ds\ScaleData; use PhpMyAdmin\Image\ImageWrapper; -use TCPDF; use function explode; use function mb_strripos; @@ -72,7 +72,7 @@ abstract public function prepareRowAsPdf( string $label, array $color, ScaleData $scaleData, - TCPDF $pdf, + Tcpdf $pdf, ): void; /** diff --git a/src/Gis/GisGeometryCollection.php b/src/Gis/GisGeometryCollection.php index 5bc740a6b091..53f73b6ef1f1 100644 --- a/src/Gis/GisGeometryCollection.php +++ b/src/Gis/GisGeometryCollection.php @@ -7,11 +7,11 @@ namespace PhpMyAdmin\Gis; +use Com\Tecnick\Pdf\Tcpdf; use ErrorException; use PhpMyAdmin\Gis\Ds\Extent; use PhpMyAdmin\Gis\Ds\ScaleData; use PhpMyAdmin\Image\ImageWrapper; -use TCPDF; use function count; use function implode; @@ -94,7 +94,7 @@ public function prepareRowAsPdf( string $label, array $color, ScaleData $scaleData, - TCPDF $pdf, + Tcpdf $pdf, ): void { // Trim to remove leading 'GEOMETRYCOLLECTION(' and trailing ')' $geomCol = mb_substr($spatial, 19, -1); diff --git a/src/Gis/GisLineString.php b/src/Gis/GisLineString.php index 41e81492308a..55193a891ff3 100644 --- a/src/Gis/GisLineString.php +++ b/src/Gis/GisLineString.php @@ -7,10 +7,10 @@ namespace PhpMyAdmin\Gis; +use Com\Tecnick\Pdf\Tcpdf; use PhpMyAdmin\Gis\Ds\Extent; use PhpMyAdmin\Gis\Ds\ScaleData; use PhpMyAdmin\Image\ImageWrapper; -use TCPDF; use function count; use function implode; @@ -104,23 +104,24 @@ public function prepareRowAsPdf( string $label, array $color, ScaleData $scaleData, - TCPDF $pdf, + Tcpdf $pdf, ): void { - $lineStyle = ['all' => ['width' => 1.5, 'color' => $color]]; + $lineStyle = ['lineWidth' => 1.5, 'lineColor' => sprintf('rgb(%d,%d,%d)', $color[0], $color[1], $color[2])]; // Trim to remove leading 'LINESTRING(' and trailing ')' $linestring = mb_substr($spatial, 11, -1); $pointsArr = $this->extractPoints1dLinear($linestring, $scaleData); - $pdf->PolyLine($pointsArr, 'S', $lineStyle); + $pdf->page->addContent($pdf->graph->getPolygon($pointsArr, 'S', ['all' => $lineStyle])); if ($label === '') { return; } // print label - $pdf->setXY($pointsArr[2], $pointsArr[3]); - $pdf->setFontSize(5); - $pdf->Cell(0, 0, $label); + $font = $pdf->font->getCurrentFont(); + $labelFont = $pdf->font->insert($pdf->pon, $font['key'], $font['style'], 5); + $pdf->page->addContent($labelFont['out']); + $pdf->page->addContent($pdf->getTextCell($label, $pointsArr[2], $pointsArr[3])); } /** diff --git a/src/Gis/GisMultiLineString.php b/src/Gis/GisMultiLineString.php index 54cae0d260ff..f89c0280b690 100644 --- a/src/Gis/GisMultiLineString.php +++ b/src/Gis/GisMultiLineString.php @@ -7,10 +7,10 @@ namespace PhpMyAdmin\Gis; +use Com\Tecnick\Pdf\Tcpdf; use PhpMyAdmin\Gis\Ds\Extent; use PhpMyAdmin\Gis\Ds\ScaleData; use PhpMyAdmin\Image\ImageWrapper; -use TCPDF; use function count; use function explode; @@ -119,9 +119,9 @@ public function prepareRowAsPdf( string $label, array $color, ScaleData $scaleData, - TCPDF $pdf, + Tcpdf $pdf, ): void { - $lineStyle = ['all' => ['width' => 1.5, 'color' => $color]]; + $lineStyle = ['lineWidth' => 1.5, 'lineColor' => sprintf('rgb(%d,%d,%d)', $color[0], $color[1], $color[2])]; // Trim to remove leading 'MULTILINESTRING((' and trailing '))' $multilineString = mb_substr($spatial, 17, -2); @@ -131,13 +131,14 @@ public function prepareRowAsPdf( $firstLine = true; foreach ($linestrings as $linestring) { $pointsArr = $this->extractPoints1dLinear($linestring, $scaleData); - $pdf->PolyLine($pointsArr, 'S', $lineStyle); + $pdf->page->addContent($pdf->graph->getPolygon($pointsArr, 'S', ['all' => $lineStyle])); // print label if ($label !== '' && $firstLine) { - $pdf->setXY($pointsArr[2], $pointsArr[3]); - $pdf->setFontSize(5); - $pdf->Cell(0, 0, $label); + $font = $pdf->font->getCurrentFont(); + $labelFont = $pdf->font->insert($pdf->pon, $font['key'], $font['style'], 5); + $pdf->page->addContent($labelFont['out']); + $pdf->page->addContent($pdf->getTextCell($label, $pointsArr[2], $pointsArr[3])); } $firstLine = false; diff --git a/src/Gis/GisMultiPoint.php b/src/Gis/GisMultiPoint.php index 96cdada33c69..436f21900279 100644 --- a/src/Gis/GisMultiPoint.php +++ b/src/Gis/GisMultiPoint.php @@ -7,10 +7,10 @@ namespace PhpMyAdmin\Gis; +use Com\Tecnick\Pdf\Tcpdf; use PhpMyAdmin\Gis\Ds\Extent; use PhpMyAdmin\Gis\Ds\ScaleData; use PhpMyAdmin\Image\ImageWrapper; -use TCPDF; use function count; use function implode; @@ -102,9 +102,9 @@ public function prepareRowAsPdf( string $label, array $color, ScaleData $scaleData, - TCPDF $pdf, + Tcpdf $pdf, ): void { - $line = ['width' => 1.25, 'color' => $color]; + $style = ['lineWidth' => 1.25, 'lineColor' => sprintf('rgb(%d,%d,%d)', $color[0], $color[1], $color[2])]; // Trim to remove leading 'MULTIPOINT(' and trailing ')' $multipoint = mb_substr($spatial, 11, -1); @@ -112,7 +112,7 @@ public function prepareRowAsPdf( foreach ($pointsArr as $point) { // draw a small circle to mark the point - $pdf->Circle($point[0], $point[1], 2, 0, 360, 'D', $line); + $pdf->page->addContent($pdf->graph->getCircle($point[0], $point[1], 2, style: $style)); } if ($label === '' || ! isset($pointsArr[0])) { @@ -120,9 +120,10 @@ public function prepareRowAsPdf( } // print label for each point - $pdf->setXY($pointsArr[0][0], $pointsArr[0][1]); - $pdf->setFontSize(5); - $pdf->Cell(0, 0, $label); + $font = $pdf->font->getCurrentFont(); + $labelFont = $pdf->font->insert($pdf->pon, $font['key'], $font['style'], 5); + $pdf->page->addContent($labelFont['out']); + $pdf->page->addContent($pdf->getTextCell($label, $pointsArr[0][0], $pointsArr[0][1])); } /** diff --git a/src/Gis/GisMultiPolygon.php b/src/Gis/GisMultiPolygon.php index 9503df069745..c68e8755ca32 100644 --- a/src/Gis/GisMultiPolygon.php +++ b/src/Gis/GisMultiPolygon.php @@ -7,11 +7,11 @@ namespace PhpMyAdmin\Gis; +use Com\Tecnick\Pdf\Tcpdf; use PhpMyAdmin\Gis\Ds\Extent; use PhpMyAdmin\Gis\Ds\Polygon; use PhpMyAdmin\Gis\Ds\ScaleData; use PhpMyAdmin\Image\ImageWrapper; -use TCPDF; use function array_merge; use function array_slice; @@ -122,12 +122,13 @@ public function prepareRowAsPdf( string $label, array $color, ScaleData $scaleData, - TCPDF $pdf, + Tcpdf $pdf, ): void { // Trim to remove leading 'MULTIPOLYGON(((' and trailing ')))' $multipolygon = mb_substr($spatial, 15, -3); // Separate each polygon $wktPolygons = explode(')),((', $multipolygon); + $style = ['fillColor' => sprintf('rgb(%d,%d,%d)', $color[0], $color[1], $color[2])]; foreach ($wktPolygons as $wktPolygon) { $wktRings = explode('),(', $wktPolygon); @@ -139,7 +140,7 @@ public function prepareRowAsPdf( } // draw polygon - $pdf->Polygon($pointsArr, 'F*', [], $color); + $pdf->page->addContent($pdf->graph->getBasicPolygon($pointsArr, 'F*', $style)); // mark label point if applicable if (isset($labelPoint)) { continue; @@ -153,9 +154,11 @@ public function prepareRowAsPdf( } // print label if applicable - $pdf->setXY($labelPoint[0], $labelPoint[1]); - $pdf->setFontSize(5); - $pdf->Cell(0, 0, $label); + $font = $pdf->font->getCurrentFont(); + $labelFont = $pdf->font->insert($pdf->pon, $font['key'], $font['style'], 5); + $pdf->page->addContent($labelFont['out']); + $pdf->page->addContent($pdf->color->getPdfColor('black')); + $pdf->page->addContent($pdf->getTextCell($label, $labelPoint[0], $labelPoint[1])); } /** diff --git a/src/Gis/GisPoint.php b/src/Gis/GisPoint.php index dabcc407581a..2b5e03de5b8d 100644 --- a/src/Gis/GisPoint.php +++ b/src/Gis/GisPoint.php @@ -7,10 +7,10 @@ namespace PhpMyAdmin\Gis; +use Com\Tecnick\Pdf\Tcpdf; use PhpMyAdmin\Gis\Ds\Extent; use PhpMyAdmin\Gis\Ds\ScaleData; use PhpMyAdmin\Image\ImageWrapper; -use TCPDF; use function mb_substr; use function round; @@ -100,9 +100,9 @@ public function prepareRowAsPdf( string $label, array $color, ScaleData $scaleData, - TCPDF $pdf, + Tcpdf $pdf, ): void { - $line = ['width' => 1.25, 'color' => $color]; + $style = ['lineWidth' => 1.25, 'lineColor' => sprintf('rgb(%d,%d,%d)', $color[0], $color[1], $color[2])]; // Trim to remove leading 'POINT(' and trailing ')' $point = mb_substr($spatial, 6, -1); @@ -113,15 +113,16 @@ public function prepareRowAsPdf( } // draw a small circle to mark the point - $pdf->Circle($pointsArr[0], $pointsArr[1], 2, 0, 360, 'D', $line); + $pdf->page->addContent($pdf->graph->getCircle($pointsArr[0], $pointsArr[1], 2, style: $style)); if ($label === '') { return; } // print label if applicable - $pdf->setXY($pointsArr[0], $pointsArr[1]); - $pdf->setFontSize(5); - $pdf->Cell(0, 0, $label); + $font = $pdf->font->getCurrentFont(); + $labelFont = $pdf->font->insert($pdf->pon, $font['key'], $font['style'], 5); + $pdf->page->addContent($labelFont['out']); + $pdf->page->addContent($pdf->getTextCell($label, $pointsArr[0], $pointsArr[1])); } /** diff --git a/src/Gis/GisPolygon.php b/src/Gis/GisPolygon.php index aad8bd5be567..e038924b95ab 100644 --- a/src/Gis/GisPolygon.php +++ b/src/Gis/GisPolygon.php @@ -7,10 +7,10 @@ namespace PhpMyAdmin\Gis; +use Com\Tecnick\Pdf\Tcpdf; use PhpMyAdmin\Gis\Ds\Extent; use PhpMyAdmin\Gis\Ds\ScaleData; use PhpMyAdmin\Image\ImageWrapper; -use TCPDF; use function array_merge; use function array_slice; @@ -101,7 +101,7 @@ public function prepareRowAsPdf( string $label, array $color, ScaleData $scaleData, - TCPDF $pdf, + Tcpdf $pdf, ): void { // Trim to remove leading 'POLYGON((' and trailing '))' $polygon = mb_substr($spatial, 9, -2); @@ -115,16 +115,20 @@ public function prepareRowAsPdf( $pointsArr = array_merge($pointsArr, $ring); } + $style = ['fillColor' => sprintf('rgb(%d,%d,%d)', $color[0], $color[1], $color[2])]; + // draw polygon - $pdf->Polygon($pointsArr, 'F*', [], $color); + $pdf->page->addContent($pdf->graph->getBasicPolygon($pointsArr, 'F*', $style)); if ($label === '') { return; } // print label if applicable - $pdf->setXY($pointsArr[2], $pointsArr[3]); - $pdf->setFontSize(5); - $pdf->Cell(0, 0, $label); + $font = $pdf->font->getCurrentFont(); + $labelFont = $pdf->font->insert($pdf->pon, $font['key'], $font['style'], 5); + $pdf->page->addContent($labelFont['out']); + $pdf->page->addContent($pdf->color->getPdfColor('black')); + $pdf->page->addContent($pdf->getTextCell($label, $pointsArr[2], $pointsArr[3])); } /** diff --git a/src/Gis/GisVisualization.php b/src/Gis/GisVisualization.php index 937afab6562d..c0190c09c621 100644 --- a/src/Gis/GisVisualization.php +++ b/src/Gis/GisVisualization.php @@ -7,6 +7,7 @@ namespace PhpMyAdmin\Gis; +use Com\Tecnick\Pdf\Tcpdf; use PhpMyAdmin\Config; use PhpMyAdmin\Dbal\DatabaseInterface; use PhpMyAdmin\Gis\Ds\Extent; @@ -14,7 +15,7 @@ use PhpMyAdmin\Gis\Ds\ScaleData; use PhpMyAdmin\Image\ImageWrapper; use PhpMyAdmin\Util; -use TCPDF; +use PhpMyAdmin\Version; use function assert; use function count; @@ -340,25 +341,19 @@ private function asPdfFile(): FileDownload $pdf = $this->createEmptyPdf(Config::getInstance()->config->PDFDefaultPageSize ?? 'A4'); $this->prepareDataSet($this->data, 'pdf', $pdf); - $blob = $pdf->Output('', 'S'); + $blob = $pdf->getOutPDFString(); return new FileDownload(mime: 'application/pdf', extension: 'pdf', blob: $blob); } - private function createEmptyPdf(string $format): TCPDF + private function createEmptyPdf(string $format): Tcpdf { - $pdf = new TCPDF( - orientation: 'P', - unit: 'pt', - format: $format, - unicode: true, - encoding: 'UTF-8', - diskcache: false, - ); - $pdf->setPrintHeader(false); - $pdf->setPrintFooter(false); - $pdf->setAutoPageBreak(false); - $pdf->AddPage(); + $pdf = new Tcpdf('pt', compress: false); + $pdf->setCreator('phpMyAdmin ' . Version::VERSION); + $fontRegular = $pdf->font->insert($pdf->pon, 'helvetica', '', 14); + $pdf->addPage(['format' => $format, 'orientation' => 'P']); + $pdf->page->enableAutoPageBreak(false); + $pdf->page->addContent($fontRegular['out']); return $pdf; } @@ -438,7 +433,7 @@ private function scaleDataSet(array $data): ScaleData|null * * @param mixed[][] $data Raw data * @param string $format Format of the visualization - * @param ImageWrapper|TCPDF|null $renderer Image object in the case of png, TCPDF object in the case of pdf + * @param ImageWrapper|Tcpdf|null $renderer Image object in the case of png, TCPDF object in the case of pdf * @psalm-param T $format * * @psalm-return (T is 'svg' ? string : (T is 'ol' ? list : null)) @@ -449,7 +444,7 @@ private function scaleDataSet(array $data): ScaleData|null private function prepareDataSet( array $data, string $format, - ImageWrapper|TCPDF|null $renderer = null, + ImageWrapper|Tcpdf|null $renderer = null, ): array|string|null { $svg = ''; $olDataset = []; @@ -478,7 +473,7 @@ private function prepareDataSet( assert($renderer instanceof ImageWrapper); $gisObj->prepareRowAsPng($wkt, $label, $color, $scaleData, $renderer); } elseif ($format === 'pdf') { - assert($renderer instanceof TCPDF); + assert($renderer instanceof Tcpdf); $gisObj->prepareRowAsPdf($wkt, $label, $color, $scaleData, $renderer); } elseif ($format === 'ol') { $olDataset[] = $gisObj->prepareRowAsOl($wkt, (int) $row['srid'], $label); diff --git a/tests/test_data/gis/empty-expected.pdf b/tests/test_data/gis/empty-expected.pdf index bc59d69f6eb1a162ab12ac661f97b148afaf7683..febe7b9c5d9e985cf243c717ec8e3ebfa435bc3e 100644 GIT binary patch delta 1392 zcmb7EOHUI~6rKr`$0eACs40rcA*O(d?VahnwbVdM69UAhZ8V}RhW54{QfBJRZ4gZ) zCPvrf{sMmi3s&yfnYhpeKfs7fw{Cr$nHI2$i%yd>bG~!>-E+_V?m3Bm2zmX5Tt1)% z5bxnUGEsy2h%yhN$agg;%~juXMMuLFfZeyAGixpd~_c*sJjAJ~s$*9xJ3M~vx z$#F41qz;6_p~ELb-(^oZi+4(}5kn4$H5PYiGH4>(7qIB(f0N)NMR(*t70cS(GkSQba)KP(3z8g0Y z>_9nYS1i57b<@ZY(glmTJmx+3g-PP9t>T@}FNeivUt*8m*V)bjHrZ))N4+kTZR)K* zpn|0v{I4_@yC|m9%48w-Z79SyUsGm z&B>Qud!Tb`KSB>tMAFYt<&s3{If>GqIrRhd&0-U(9I9q!XXeeD_ujny{od{i{=pf} ztuIz*m{}mX4}ZRVL!86mOBaBy`>_ZmFtDHoYS5S(16mXN(Lvl0`@j=5T@}Heubvt+ z8K5`fsHH^%)USq(^E-p5fzHQLYp#|`h=zD_mtG>yO=C{kE_qZjx%mdvx*p|tDWiR|r7h6L@{R|u$ zQH@IpF-w5qCUaa==~4j)qt<}lS%o~R*o?NF28!FoGPk(R7@Oss*?i6V%Ce^L!P6=h z8(oOvK*UhDFoKRX4_ILvK=0O;Pp15?l&vzQ{{nm(E05j+y8KfntNir%H8*9Z^x!E- zZRS(EDT%$6DyJy+cG6AtbK33iUawxKCr;(#^o05=JEA5saL%2zj;?3^Hq`t6i)!Wk zJzOW%@8^rjeth7U3TNHRa!A6*)pJg0_6 zejAy`Z%Tl!q>aX|c<9ej_4dN}(VgK@{UevvSg0N zL9<+2tX9<1tUXvdr4rO}HfJz(akQwOjnd9qON8?cxfg{{?^09UleZu|c<=x*UKP?0 zeCb0mq3z>G{(UT(1WC4tCh(+z>o~RpP3Y-L3~NX?2zxqa6)>4o-PJ_2N(K9jGSM+s zv{hj&cYU__>6u+R8|1{^DdCStw~v>(HY=(pV^^}w!a9v22^t8jzU8nPK|#G6^NGV< KlFKcvRmnfdBv&;6 diff --git a/tests/test_data/gis/geometries-expected.pdf b/tests/test_data/gis/geometries-expected.pdf index 9a2cb113df1de055f8aed8f1d58a12abe4e11f25..80ab0a83015d2525d0bbca54aae56a8540e1eb2c 100644 GIT binary patch delta 2158 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 diff --git a/tests/test_data/gis/geometrycollection-expected.pdf b/tests/test_data/gis/geometrycollection-expected.pdf index 1e4b2460ff9f6aab417abad0f491d82d916e13a4..62daada6be9cef7422dd60079503094469c0bb24 100644 GIT binary patch delta 2176 zcmbVNPfR0K7@q-Qvk#H30lG_z`_{lNe`Mag`O}#qTNYZnF$hcA#&to6L;EO&cBYvQ zA_qfEJeZA|z&o0lc=K%I&5OaC2V=Z>)Ppf5CY$JW^_!uEExQKswe#}c_rCdk@B4j! z=932xGoj(7RC>OrWltA@#ZsZhf!SmSGb18X{#v9rE~rlv4?o!Lci z6RW0f;zR<~JeOG&gl2P?q$#GFBnJcMHt<}o`(Nc$QgmMt?;?KCGg$wuZNH7b-P132 z^Y=S@?kKAQWg?a8?(kYi&-YYrwD9&wxErh5PywSwuzjhEY z%O7|2M=OXLvSgZoqhig7!6l8DX5cc)qEo9H)tg2&O_rz;ga3I(;r5aG@157g_KmRs zE8LApGD~s3hG~G_WjA1gpb=xfA(I{I7un zc^*^FF+WCh=_xbkqZoW3y zRlol7*Ox-*GK?wW7B(hltzrW4-$n-yBmLc|Ab&Zq^lXX$10R=H#sAsW?cifvdsWsiR|CiBqv?W>v@gE;yF z+ZY84S*IH1ACC`hs&Nx~S?eKuAfJ+HaRZuKtDdert*65{s~0z8asFuhuuG;|91Rc8 I-Aki?06ZNp>i_@% delta 2165 zcmbVN&2Jk;6t@#MjW%^+T04mylD-O(I8@o)S?`CP8q<8#v{lmt$4F2ol^lEHI3#wm z*~qFm#8p7ar-{1d6&~|)*E|6xkmRYiafeb0YU%G~SK}wmMs2gzJr%?U2FVY55+A6N`;bS0;TQ+a?fizhz*|g*)=r!k5+0NP~ zwegd#*fv>~N@beOfLfhjAPm=N|3pGCOZoERiopH&Hy)R+n5BZf3~EeP6A9R~Ei=0& z$f9P*^gx9SFH>28%mRJ#R9>c15GK+fB^fY9ceL~aJ0W{pw!|~vwV}9Bn2$m96#At-C1-fE1;N>BM8y^3u1xR1!NSRpO zjvukMAAZ#;1(_j>(Wny9BA^;NIUBlaz^X8ZqNkf9X*fL%$>|yrX4HYGk(d}$88dW9 zJ3x**K=6M1v%7aaK{r0~^x!>DPs`E^N7;-r#>vh-ywll>*E@UvQ=pFmTy5l=7SlwY#Y(IJJiZ_4jmGV*=SuDJ zK0Ui@1a3DI7&$cI8rP3fr+TNW7{asVifNg7SiAx0NfJt!4_7J`(ax>sm&CGFm>(J0 zhse{h!ESRjTSm07q}2QTIWb2+wq-tYddnt9YN2jA_n}) z?Fe0|6v-w?ugxs3m^mBbao*h*QZBHLkfv{}n~wB?G`F>ASNm6rr8l_TlW(Sp7_M|A zP>eEP=H~=OWSUM5uGOGb_m!TxIt^hOW202bBOp!VA6=m&2`>q|G*PzlrUe<9jJex5 zfs^JydNp;aR)v>sdwoojo?v-|pXMS+m+&2b_lvVuIlq;oRl<+|bfsOBu36WVE9nB4 z?h>m-q4s>(wd}I#U3ZPSBzh~=SH#JHj-9@Cd^6Bj{k|WVZq-$J_lLl5ZhY8N!dpFO zaHBU$Z9m@Y{h;lvERV@DUJnl8tzfL)-3yM@n~#HU;my$SNnO-M1)2}A`$gzXEB-j} zsc)SAU?%Vcn#(PlYgzpIxhVSKcRbhcMX|4A_v*lB$ML5g!84I9Brr78k0(RjLR_-) zOJk|2WCE`ZCGfqWK{vzChoZPJEcMT$+83d;wYs{1w})Rkuc;9O zco<|TflzJ86fpXG9~e_(^m9EhX2?1|9De@1tVSuN4ot?Bzb&FO7CT_asetValue(null, '6.6.2'); - } - - public static function tearDownAfterClass(): void - { - $property = new ReflectionProperty(TCPDF_STATIC::class, 'tcpdf_version'); - $property->setValue(null, $property->getDefaultValue()); - } - protected function setUp(): void { parent::setUp(); @@ -392,15 +394,18 @@ public function testPdf(string $name, array $data): void new GisVisualizationSettings(width: 560, height: 420, spatialColumn: 'wkt', labelColumn: 'label'), ); $vis = new ReflectionClass($visualization); - /** @var TCPDF $pdf */ - $pdf = $vis->getMethod('createEmptyPdf')->invoke($visualization, 'A4'); - $pdf->setDocCreationTimestamp(1700000000); - $pdf->setDocModificationTimestamp(1700000000); - $pdf->setCompression(false); - (new ReflectionProperty($pdf, 'file_id'))->setValue($pdf, md5($name)); + + $pdf = new Tcpdf('pt', compress: false); + $fontRegular = $pdf->font->insert($pdf->pon, 'helvetica', '', 14); + $pdf->addPage(['format' => 'A4', 'orientation' => 'P', 'time' => 1700000000]); + $pdf->page->addContent($fontRegular['out']); + (new ReflectionProperty($pdf, 'version'))->setValue($pdf, '8.20.0'); + (new ReflectionProperty($pdf, 'doctime'))->setValue($pdf, 1700000000); + (new ReflectionProperty($pdf, 'docmodtime'))->setValue($pdf, 1700000000); + (new ReflectionProperty($pdf, 'fileid'))->setValue($pdf, md5($name)); $vis->getMethod('prepareDataSet')->invoke($visualization, $data, 'pdf', $pdf); - $pdfBlob = $pdf->Output(dest: 'S'); + $pdfBlob = $pdf->getOutPDFString(); $this->assertSameOrSaveNewVersion($name, 'pdf', $pdfBlob); }