pdf-php icon indicating copy to clipboard operation
pdf-php copied to clipboard

Pr fixes

Open savioret opened this issue 1 year ago • 1 comments

Added some very needed doc on some functions. Fix for #175 which partially reverts 00db904 Found a scenario where can come to infinite loop and fixed it.

savioret avatar May 13 '23 08:05 savioret

I have updated the pull request to keep Cpdf clean without any justification modification in addText. I had to change Cezpdf, removing the justification checks as some cases were not covered (for example when a line break character was in the text).

image

This code reproduces the problem:

$pdf = new CezPDF('a4');
$pdf->selectFont('Helvetica');


$pdf->ezColumnsStart(['num' => 2, 'gap'=>20]);
$options = ['justification' => 'full'];

// Testing break lines should be considered as last lines
$text1 = "\nLorem ipsum dolor sit amet, vitae et sit posuere metus urna et vitae dolor consectetur adipiscing tristique nec odio id euismod."
."\nCurabitur euismod ex volutpat bibendum eleifend."
."\nDonec pretium pretium nibh."
."\nAt consectetur turpis porta et.\n";
$pdf->ezText($text1, 0, $options);
$pdf->ezColumnsStop();
$pdf->ezStream();

savioret avatar Jul 02 '23 16:07 savioret