diff --git a/composer.json b/composer.json index bbccfa4e..c79e9b45 100644 --- a/composer.json +++ b/composer.json @@ -48,7 +48,7 @@ "fakerphp/faker": "^1.0", "google/recaptcha": "^1.0", "imagine/imagine": "^1.0", - "laurentmuller/fpdf2": "^2.0", + "laurentmuller/fpdf2": "^3.0", "laurentmuller/highcharts-bundle": "^2.0", "phpoffice/phpspreadsheet": "^3.0", "phpoffice/phpword": "^1.0", diff --git a/composer.lock b/composer.lock index 2aa5cee3..81fe62c8 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": "019e450017a3f9a2bc8a89869c3c4e22", + "content-hash": "c71bc30f236bb9971746c71cf0f3b590", "packages": [ { "name": "bacon/bacon-qr-code", @@ -1895,16 +1895,16 @@ }, { "name": "laurentmuller/fpdf2", - "version": "2.0.14", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/laurentmuller/fpdf2.git", - "reference": "2bc65e1b78f261ec12c667b5da30fd3acd5e34d8" + "reference": "1f2300378075c58bb25aec8994a6d19071c459bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laurentmuller/fpdf2/zipball/2bc65e1b78f261ec12c667b5da30fd3acd5e34d8", - "reference": "2bc65e1b78f261ec12c667b5da30fd3acd5e34d8", + "url": "https://api.github.com/repos/laurentmuller/fpdf2/zipball/1f2300378075c58bb25aec8994a6d19071c459bc", + "reference": "1f2300378075c58bb25aec8994a6d19071c459bc", "shasum": "" }, "require": { @@ -1954,7 +1954,7 @@ "issues": "https://github.com/laurentmuller/fpdf2/issues", "source": "https://github.com/laurentmuller/fpdf2" }, - "time": "2025-01-23T16:25:40+00:00" + "time": "2025-01-30T16:30:12+00:00" }, { "name": "laurentmuller/highcharts-bundle", diff --git a/src/Pdf/Colors/PdfDrawColor.php b/src/Pdf/Colors/PdfDrawColor.php index fd074262..36cac9de 100644 --- a/src/Pdf/Colors/PdfDrawColor.php +++ b/src/Pdf/Colors/PdfDrawColor.php @@ -13,6 +13,7 @@ namespace App\Pdf\Colors; +use fpdf\Color\PdfRgbColor; use fpdf\PdfDocument; /** @@ -22,7 +23,8 @@ class PdfDrawColor extends AbstractPdfColor { public function apply(PdfDocument $doc): void { - $doc->setDrawColor($this->red, $this->green, $this->blue); + $color = PdfRgbColor::instance($this->red, $this->green, $this->blue); + $doc->setDrawColor($color); } /** diff --git a/src/Pdf/Colors/PdfFillColor.php b/src/Pdf/Colors/PdfFillColor.php index 92cecb3e..82e38d46 100644 --- a/src/Pdf/Colors/PdfFillColor.php +++ b/src/Pdf/Colors/PdfFillColor.php @@ -13,6 +13,7 @@ namespace App\Pdf\Colors; +use fpdf\Color\PdfRgbColor; use fpdf\PdfDocument; /** @@ -22,7 +23,8 @@ class PdfFillColor extends AbstractPdfColor { public function apply(PdfDocument $doc): void { - $doc->setFillColor($this->red, $this->green, $this->blue); + $color = PdfRgbColor::instance($this->red, $this->green, $this->blue); + $doc->setFillColor($color); } /** diff --git a/src/Pdf/Colors/PdfTextColor.php b/src/Pdf/Colors/PdfTextColor.php index ab7ea87c..d42aa77c 100644 --- a/src/Pdf/Colors/PdfTextColor.php +++ b/src/Pdf/Colors/PdfTextColor.php @@ -13,6 +13,7 @@ namespace App\Pdf\Colors; +use fpdf\Color\PdfRgbColor; use fpdf\PdfDocument; /** @@ -22,7 +23,8 @@ class PdfTextColor extends AbstractPdfColor { public function apply(PdfDocument $doc): void { - $doc->setTextColor($this->red, $this->green, $this->blue); + $color = PdfRgbColor::instance($this->red, $this->green, $this->blue); + $doc->setTextColor($color); } /** diff --git a/src/Report/MemoryImageReport.php b/src/Report/MemoryImageReport.php index f667fb19..def9595f 100644 --- a/src/Report/MemoryImageReport.php +++ b/src/Report/MemoryImageReport.php @@ -26,6 +26,7 @@ use App\Service\FontAwesomeImageService; use App\Service\ImageService; use App\Utils\FileUtils; +use fpdf\Color\PdfRgbColor; use fpdf\Enums\PdfMove; use fpdf\Enums\PdfRectangleStyle; use fpdf\Enums\PdfTextAlignment; @@ -243,10 +244,10 @@ private function renderDigits(): void private function renderEllipses(): void { - $this->setDrawColor(255, 0, 0); + $this->setDrawColor(PdfRgbColor::red()); $this->ellipse(30, 220, 20, 10); $this->circle(65, 220, 10); - $this->setFillColor(0, 255, 0); + $this->setFillColor(PdfRgbColor::green()); $this->circle(65, 245, 10, PdfRectangleStyle::BOTH); $this->ellipse(30, 245, 20, 10, PdfRectangleStyle::BOTH); } diff --git a/vendor-bin/php-cs-fixer/composer.lock b/vendor-bin/php-cs-fixer/composer.lock index 78852f0c..b7692676 100644 --- a/vendor-bin/php-cs-fixer/composer.lock +++ b/vendor-bin/php-cs-fixer/composer.lock @@ -406,16 +406,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.68.4", + "version": "v3.68.5", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "5c2f466ef3d7eba8af9463bcab829370b975333f" + "reference": "7bedb718b633355272428c60736dc97fb96daf27" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/5c2f466ef3d7eba8af9463bcab829370b975333f", - "reference": "5c2f466ef3d7eba8af9463bcab829370b975333f", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/7bedb718b633355272428c60736dc97fb96daf27", + "reference": "7bedb718b633355272428c60736dc97fb96daf27", "shasum": "" }, "require": { @@ -497,7 +497,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.68.4" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.68.5" }, "funding": [ { @@ -505,7 +505,7 @@ "type": "github" } ], - "time": "2025-01-30T09:14:56+00:00" + "time": "2025-01-30T17:00:50+00:00" }, { "name": "psr/container",