diff --git a/lpdf.php b/lpdf.php index ab99a5d..8c57137 100644 --- a/lpdf.php +++ b/lpdf.php @@ -203,7 +203,8 @@ class lpdf if($nr==$prevnr) { - echo "breaking because nr==prevnr ($nr==$prevnr) trying to output [$textstr] (debug: fontsize=$fontsize, lineheight=$lineheight, stringwidth=$stringwidth, left=".$this->loc(0.75).", top=".$this->loc($this->yloc).", width=".$this->loc(7).", height=$lineheight)\n"; +//Comment this out, so if it ever does happen, the PDF will still generate, it just might be missing a small blurb somewhere, better than no PDF at all +// echo "breaking because nr==prevnr ($nr==$prevnr) trying to output [$textstr] (debug: fontsize=$fontsize, lineheight=$lineheight, stringwidth=$stringwidth, left=".$this->loc(0.75).", top=".$this->loc($this->yloc).", width=".$this->loc(7).", height=$lineheight)\n"; break; } @@ -371,12 +372,16 @@ class lpdf $this->loc($x), $this->loc($y), $this->loc($desired_width), $this->loc($desired_line_height), $align,'blind'); + $prevnr=$nr; while($nr > 0) { $nr=pdf_show_boxed($this->pdf, substr($text, -$nr), $this->loc($x), $this->loc($y), $this->loc($desired_width), $this->loc($desired_line_height), $align,'blind'); $lines ++; + if($nr==$prevnr) break; + $prevnr=$nr; + } /* Now adjust the ypos, and do it for real */ @@ -393,16 +398,16 @@ class lpdf $this->loc($x), $this->loc($y), $this->loc($desired_width), $this->loc($desired_line_height), $align,null); + $prevnr=$nr; while($nr > 0) { $y -= $desired_line_height; $nr=pdf_show_boxed($this->pdf, substr($text, -$nr), $this->loc($x), $this->loc($y), $this->loc($desired_width), $this->loc($desired_line_height), $align,null); + if($nr==$prevnr) break; + $prevnr=$nr; } - - - } function newLabel($show_box=false, $show_fairname=false, $show_logo=false)