pdf-php
pdf-php copied to clipboard
Pr fixes
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.
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).
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();