Warning: Invalid argument supplied for foreach() in mpdf.php on line 11008 -
i using mpdf in web application.
i have create invoice documents of mpdf.. html table large number of rows (ie: if exists single page) rise error:
warning: invalid argument supplied foreach() in mpdf56/mpdf.php on line 11008
i using following code generate pdf:
require_once(mpdf_path); $mpdf=new mpdf('c','a4','0','',2,2,2,2,1,1); $stylesheet = file_get_contents(dirname(__file__).'/invoice_print.css'); $mpdf->writehtml($stylesheet,1); $html .=""; $mpdf->writehtml($html); $mpdf->output("$filename",'d');
i have tried with/without arguments in constructor of mpdf. , found mpdf works first 4 params without problem...
$mpdf=new mpdf('c','a4','0','')
but when add "margins" (ie: 5-8) params, throws error described above.
have has fix this???
i have tried mpdf 5.3 , 5.6
yep... got fix mpdf forum...
here link: http://www.mpdf1.com/mpdf/forum/comments.php?discussionid=1109&page=1#item_0
solution: replace "tableheaderfooter" function's first line from:
if(($horf=='h' || $horf=='f') && !empty($content)) {
to:
if(($horf=='h' || $horf=='f') && !empty($content) && !empty($content[0]) ) {
hope others...
Comments
Post a Comment