[packages/php-fpdf] - up to 1.86; refresh fpdf-draw addon for PHP 7+ (drop ereg)

arekm arekm at pld-linux.org
Mon May 4 16:10:44 CEST 2026


commit 3d353bd27fefd64dd95a406af8fe830109878f96
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Mon May 4 16:09:45 2026 +0200

    - up to 1.86; refresh fpdf-draw addon for PHP 7+ (drop ereg)

 fpdf-draw.php | 17 +++++++----------
 php-fpdf.spec | 10 +++++-----
 2 files changed, 12 insertions(+), 15 deletions(-)
---
diff --git a/php-fpdf.spec b/php-fpdf.spec
index 1eb8429..0975a8b 100644
--- a/php-fpdf.spec
+++ b/php-fpdf.spec
@@ -2,16 +2,16 @@
 Summary:	PHP class which allows to generate PDF files with pure PHP
 Summary(pl.UTF-8):	Klasa PHP pozwalająca na generowanie plikow PDF w czystym PHP
 Name:		php-fpdf
-Version:	1.83
+Version:	1.86
 Release:	1
 License:	Freeware
 Group:		Libraries
-# Source0:	http://fpdf.org/en/dl.php?v=183&f=tgz?/fpdf%{sver}.tgz
+# Source0:	https://fpdf.org/en/dl.php?v=186&f=tgz?/fpdf%{sver}.tgz
 Source0:	fpdf%{sver}.tgz
-# Source0-md5:	a2df6bf87895229a9bd04980df8ca27e
-# http://www.fpdf.de/downloads/addons/69/
+# Source0-md5:	e33b7e5aefd219f9687e0c67d72d130e
+# https://www.fpdf.org/en/script/script69.php
 Source1:	fpdf-draw.php
-# Source1-md5:	cd7711f7b39a0066ac20cb3f535ba973
+# Source1-md5:	52122b864db3ed627ffa5bbf7731204b
 Source2:	fpdf-verdana.tar.gz
 # Source2-md5:	101cd6ae9867ade8cbb12973a35e83f8
 URL:		http://www.fpdf.org/
diff --git a/fpdf-draw.php b/fpdf-draw.php
index b77ad1b..b21f17f 100644
--- a/fpdf-draw.php
+++ b/fpdf-draw.php
@@ -33,20 +33,17 @@ class PDF_Draw extends FPDF {
 		if (isset($dash)) {
 			$dash_string = '';
 			if ($dash) {
-				if(ereg('^.+,', $dash))
-					$tab = explode(',', $dash);
-				else
-					$tab = array($dash);
+				$tab = explode(',', $dash);
 				$dash_string = '';
 				foreach ($tab as $i => $v) {
 					if ($i > 0)
 						$dash_string .= ' ';
-					$dash_string .= sprintf('%.2f', $v);
+					$dash_string .= sprintf('%.2F', $v);
 				}
 			}
 			if (!isset($phase) || !$dash)
 				$phase = 0;
-			$this->_out(sprintf('[%s] %.2f d', $dash_string, $phase));
+			$this->_out(sprintf('[%s] %.2F d', $dash_string, $phase));
 		}
 		if (isset($color)) {
 			list($r, $g, $b) = $color;
@@ -205,7 +202,7 @@ class PDF_Draw extends FPDF {
 			$y0 = ($this->h - $y0) * $this->k;
 			if ($angle != 0) {
 				$a = -deg2rad((float) $angle);
-				$this->_out(sprintf('q %.2f %.2f %.2f %.2f %.2f %.2f cm', cos($a), -1 * sin($a), sin($a), cos($a), $x0, $y0));
+				$this->_out(sprintf('q %.2F %.2F %.2F %.2F %.2F %.2F cm', cos($a), -1 * sin($a), sin($a), cos($a), $x0, $y0));
 				$x0 = 0;
 				$y0 = 0;
 			}
@@ -461,14 +458,14 @@ class PDF_Draw extends FPDF {
 	// Parameters:
 	// - x, y: Point
 	function _Point($x, $y) {
-		$this->_out(sprintf('%.2f %.2f m', $x * $this->k, ($this->h - $y) * $this->k));
+		$this->_out(sprintf('%.2F %.2F m', $x * $this->k, ($this->h - $y) * $this->k));
 	}
 
 	// Draws a line from last draw point
 	// Parameters:
 	// - x, y: End point
 	function _Line($x, $y) {
-		$this->_out(sprintf('%.2f %.2f l', $x * $this->k, ($this->h - $y) * $this->k));
+		$this->_out(sprintf('%.2F %.2F l', $x * $this->k, ($this->h - $y) * $this->k));
 	}
 
 	// Draws a B�zier curve from last draw point
@@ -477,7 +474,7 @@ class PDF_Draw extends FPDF {
 	// - x2, y2: Control point 2
 	// - x3, y3: End point
 	function _Curve($x1, $y1, $x2, $y2, $x3, $y3) {
-		$this->_out(sprintf('%.2f %.2f %.2f %.2f %.2f %.2f c', $x1 * $this->k, ($this->h - $y1) * $this->k, $x2 * $this->k, ($this->h - $y2) * $this->k, $x3 * $this->k, ($this->h - $y3) * $this->k));
+		$this->_out(sprintf('%.2F %.2F %.2F %.2F %.2F %.2F c', $x1 * $this->k, ($this->h - $y1) * $this->k, $x2 * $this->k, ($this->h - $y2) * $this->k, $x3 * $this->k, ($this->h - $y3) * $this->k));
 	}
 
 }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php-fpdf.git/commitdiff/3d353bd27fefd64dd95a406af8fe830109878f96



More information about the pld-cvs-commit mailing list