Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions data.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,8 @@ Note that this document was generated using the demo script 'readme.php' which c

1<Changelog>

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
Expand All @@ -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 <c:alink:https://github.com/rospdf/pdf-php/releases>https://github.com/rospdf/pdf-php/releases</c:alink> 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

Expand Down Expand Up @@ -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.

<b>$paper</b> 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'

<b>$orientation</b> 'portrait' and 'landscape' can be used

Expand Down Expand Up @@ -915,7 +915,7 @@ x,y are the position of the lower left corner of the image, and w,h are the widt

2<addPngFromFile> (imgFileName,x,y,w,[h],[angle=0])

Similar to <i>addJpegFromFile</i>, but for PNG images.
Similar to <i>addJepgFromFile</i>, but for PNG images.

2<output> ([debug=0]) = a

Expand Down Expand Up @@ -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
A4 is 210 x 297 mm or 595.28 x 841.89 points
10 changes: 9 additions & 1 deletion src/Cezpdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down Expand Up @@ -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']) {
Expand Down Expand Up @@ -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']) {
Expand Down Expand Up @@ -1674,13 +1679,15 @@ 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) {
$lines[$k] = '<c:alink:'.$row[$options['cols'][$colName]['link']].'>'.$v.'</c:alink>';
}
}
} else {
//$lines = explode("\n",$row[$colName]);
$lines = preg_split("[\r\n|\r|\n]", $row[$colName]);
}
} else {
Expand All @@ -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 = '<c:color:'.$textColor[0].','.$textColor[1].','.$textColor[2].'>'.$line . '</c:color>';
} else {
$this->setColor(0, 0, 0, true);
$this->setStrokeColor(0, 0, 0, true);
Expand Down Expand Up @@ -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']) {
Expand Down