From b69c3a7574adead079cae5ee795134d252cec6f3 Mon Sep 17 00:00:00 2001 From: Miguel Martinez Date: Sun, 2 Jul 2023 17:52:25 +0200 Subject: [PATCH] Unfortunately current conditions were not covering all cases --- src/Cezpdf.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Cezpdf.php b/src/Cezpdf.php index 3f87472..51a7657 100644 --- a/src/Cezpdf.php +++ b/src/Cezpdf.php @@ -1721,7 +1721,7 @@ public function ezTable(&$data, $cols = '', $title = '', $options = '') if (isset($options['cols'][$colName]) && isset($options['cols'][$colName]['justification'])) { $just = $options['cols'][$colName]['justification']; - if ($just == 'full' && (empty($lines[$i + 1]) || count($lines) == $i + 1)) { + if ($just == 'full') { // do not fully justify if its the absolute last line (taking line breaks into account) $tmp = $this->addText($pos[$colName], $this->y, $options['fontSize'], $line, $maxWidth[$colName], $just, 0,0,1); if (!strlen($tmp)) { @@ -1977,7 +1977,7 @@ public function ezText($text, $size = 0, $options = [], $test = 0) $right = $this->ez['pageWidth'] - $this->ez['rightMargin'] - ((is_array($options) && isset($options['right'])) ? $options['right'] : 0); } - if ($just == 'full' && (empty($lines[$i + 1]) || $c == $i + 1)) { + if ($just == 'full') { // do not fully justify if its the absolute last line (taking line breaks into account) $tmp = $this->addText($left, $this->y, $size, $line, $right - $left, $just, 0, 0, 1); if (!strlen($tmp)) {