0

I use mpdf library and if I launch the report I have a limit characters error. Any ideas or workaround?

1 Answers1

0

I had the same issue today and yep, I have an idea:

$long_html = strlen($html);
$long_int  = intval($long_html/100000);

if($long_int > 0)
{
    for($i = 0; $i<$long_int; $i++)
    {
        $temp_html = substr($html, ($i*100000),99999);
        $mpdf->WriteHTML($temp_html);
    }
    //Last block
    $temp_html = substr($html, ($i*100000),($long_html-($i*100000)));
    $mpdf->WriteHTML($temp_html);
}
else
{
    $mpdf->WriteHTML($html);
}
hedka77
  • 107
  • 5
  • 17