Skip to content

Conversation

@savioret
Copy link

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
Copy link
Author

savioret commented Jul 2, 2023

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();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant