Reply To: Invoice pdf generation error

Thanks for your answer.

The field I use is the “Email” field present in each reservation. I insert it in my invoice template with the [email] tag.
I think I get this error because the client email is displayed into a small frame in my invoice template, so the case where the email does not fit the line occurs often.

The issue is located in the _tag_open_WRITE method of the HTML2PDF class :

$words = explode(' ', $txt);
// while we have words, and the text does not fit
// on the line => we cut the sentence
while ($x+$w>$right && $x<$right+$space && count($words)) {
  if ($nb>10000) {
    $txt = '';
    foreach ($words as $k => $word) $txt.= ($k ? ' ' : '').$word[0];
    throw new HTML2PDF_exception(2, array($txt, $right-$left, $w));

This does not take into account the fact that a word could be very long with no space to break.
I will try to contact Laurent MINGUET to report this issue.