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

Getting stuck in while loop

Open nilstr opened this issue 4 years ago • 2 comments

There are still a problem where the code gets stuck in a never ending loop in the current version. Probably related to the text length and column width. When using the eztable function the code can get stuck in a loop. I narrowed it down to the ezText function getting run with the following parameters:

$pdf->ezText("<b>Konto</b>", 10, [ "aleft" => 55.14, "aright" => 59.477, "justification" => "left"], 0);

Which make this line never return an empty string. So the while loop continues forever. https://github.com/rospdf/pdf-php/blob/f957e49ddfa6b7891de62c48b1de965a74db6c44/src/Cezpdf.php#L1985

Can be reproduced with this code:

<?php

include 'src/Cezpdf.php';

$pdf = new Cezpdf();

$pdf->ezText("<b>Konto</b>", 10, [ "aleft" => 55.14, "aright" => 59.477, "justification" => "left"], 0);

$pdf->ezStream();

nilstr avatar Dec 09 '20 16:12 nilstr

Thank you for your effort on the example code

ole1986 avatar Apr 11 '23 18:04 ole1986

This was fixed in pull request #177

savioret avatar May 15 '23 15:05 savioret