diff --git a/data.txt b/data.txt index 7db02f7..32c5de3 100644 --- a/data.txt +++ b/data.txt @@ -29,14 +29,8 @@ Note that this document was generated using the demo script 'readme.php' which c 1 -3<0.12.65> -- Fix PHP 8.1 conversion from float deprecation #168 - -3<0.12.64> -- Compatibility with PHP 8.1 #164 - 3<0.12.63> -- Fix notice with PHP 7.4 #146 +- Merged PR #146 3<0.12.62> - Fixed repeating background image when using ezColumnsStart @@ -50,11 +44,17 @@ Note that this document was generated using the demo script 'readme.php' which c - Slighty improved *.afm font loading for compatibility reason 3<0.12.58> + - Recovered $test option in addText() method #128 - Fixed broken PDF 1.3 standard when using callbacks - Proper calculate full justification on last line -Please refer to https://github.com/rospdf/pdf-php/releases for all previous changes +3<0.12.57> + +- Fixed issue #134 +- Set automated full justification to 90 % + +Please refer to https://github.com/rospdf/pdf-php/releases for all previous changes #NP @@ -86,7 +86,7 @@ Valid values for paper are listed below, a two or four member array can also be Starting ezpdf with the code below will create an a4 portrait document. $paper The valid values for the paper (thanks to the work of Nicola Asuni) are: -'4A0', '2A0', 'A0', 'A1', 'A2', 'A3', 'A4', 'A5', 'A6' , 'A7', 'A8', 'A9', 'A10', 'B0', 'B1', 'B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B8', 'B9', 'B10', 'C0', 'C1', 'C2' , 'C3', 'C4' , 'C5', 'C6', 'C7', 'C8', 'C9', 'C10' , 'RA0', 'RA1', 'RA2', 'RA3', 'RA4', 'SRA0', 'SRA1', 'SRA2', 'SRA3', 'SRA4', 'LETTER', 'LEGAL', 'EXECUTIVE', 'FOLIO' +'4A0', '2A0', 'A0', 'A1', 'A2', 'A3', 'A4', 'A5', 'A6' , 'A7', 'A8', 'A9', 'A10', 'B0', 'B1', 'B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B8', 'B9', 'B10', 'C0', 'C1', 'C2' , 'C3', 'C4' , 'C5', 'C6', 'C7', 'C8', 'C9', 'C10' , 'RA0', 'RA1', 'RA2', 'RA3', 'RA4', 'SRA0', 'SRA1', 'SRA2', 'SRA3', 'SRA4', 'LETTER', 'LEGAL', 'EXECUTIVE', 'FOLIO', 'ETQ51X25' $orientation 'portrait' and 'landscape' can be used @@ -915,7 +915,7 @@ x,y are the position of the lower left corner of the image, and w,h are the widt 2 (imgFileName,x,y,w,[h],[angle=0]) -Similar to addJpegFromFile, but for PNG images. +Similar to addJepgFromFile, but for PNG images. 2 ([debug=0]) = a @@ -1182,4 +1182,4 @@ and some additional user contributed notes are (thanks Andrew): 1/72" is 0.3528mm or 1 point 1 point was historically 0.0138 inches, a little under 1/72" 10mm is 28.35 points -A4 is 210 x 297 mm or 595.28 x 841.89 points \ No newline at end of file +A4 is 210 x 297 mm or 595.28 x 841.89 points diff --git a/src/Cezpdf.php b/src/Cezpdf.php index 44a4e41..df47ec1 100644 --- a/src/Cezpdf.php +++ b/src/Cezpdf.php @@ -257,6 +257,9 @@ public function __construct($paper = 'a4', $orientation = 'portrait', $type = 'n case 'FOLIO': $size = [0, 0, 612.00, 936.00]; break; + case 'ETQ51X25': + $size = [0, 0, 70.87, 145.67]; + break; } switch (strtolower($orientation)) { case 'landscape': @@ -1496,6 +1499,7 @@ public function ezTable(&$data, $cols = '', $title = '', $options = '') $height = $this->getFontHeight($options['fontSize']); $descender = $this->getFontDescender($options['fontSize']); +// $y0 = $y + $descender; // REPLACED THIS LINE WITH THE FOLLOWING $y0 = $y - $options['rowGap']; $dy = 0; if ($options['showHeadings']) { @@ -1636,6 +1640,7 @@ public function ezTable(&$data, $cols = '', $title = '', $options = '') $this->setColor($options['textCol'][0], $options['textCol'][1], $options['textCol'][2], 1); $y = ($options['nextPageY']) ? $nextPageY : ($this->ez['pageHeight'] - $this->ez['topMargin']); +// $y0 = $y + $descender; // REPLACED THIS LINE WITH THE FOLLOWING $y0 = $y - $options['rowGap']; $mx = 0; if ($options['showHeadings']) { @@ -1674,6 +1679,7 @@ public function ezTable(&$data, $cols = '', $title = '', $options = '') $colNewPage = 0; if (isset($row[$colName])) { if (isset($options['cols'][$colName]) && isset($options['cols'][$colName]['link']) && strlen($options['cols'][$colName]['link'])) { + //$lines = explode("\n",$row[$colName]); $lines = preg_split("[\r\n|\r|\n]", $row[$colName]); if (isset($row[$options['cols'][$colName]['link']]) && strlen($row[$options['cols'][$colName]['link']])) { foreach ($lines as $k => $v) { @@ -1681,6 +1687,7 @@ public function ezTable(&$data, $cols = '', $title = '', $options = '') } } } else { + //$lines = explode("\n",$row[$colName]); $lines = preg_split("[\r\n|\r|\n]", $row[$colName]); } } else { @@ -1694,6 +1701,7 @@ public function ezTable(&$data, $cols = '', $title = '', $options = '') if (isset($row[$colName.'Color'])) { $textColor = $row[$colName.'Color']; $this->setColor($textColor[0], $textColor[1], $textColor[2], true); + //$line = ''.$line . ''; } else { $this->setColor(0, 0, 0, true); $this->setStrokeColor(0, 0, 0, true); @@ -1946,7 +1954,7 @@ public function ezText($text, $size = 0, $options = [], $test = 0) for ($i = 0; $i < $c; $i++) { $line = $lines[$i]; $start = 1; - while ($l = strlen($line) || $start) { + while (strlen($line) || $start) { $start = 0; $this->y = $this->y - $height; if ($this->y < $this->ez['bottomMargin']) {