mpdf只打印少于450条记录

Pra*_*ngh -1 php zend-framework mpdf

我使用mpdf生成pdf但mpdf只有在记录小于450时才有效.如果记录超过450则我得到一个错误

 Out of memory (allocated 1792802816) (tried to allocate 261904 bytes) in C:\..\mpdf\classes\cssmgr.php on line 17742
Run Code Online (Sandbox Code Playgroud)

请给我一个更好的解决方案.我的代码在这里

ini_set('max_execution_time',360000);
set_time_limit(360000) ;
ignore_user_abort(true) ;
foreach($violations1 as $val)
        {   
            $exportpdf .= '<tr>';
                $exportpdf .= '<td  width="100" >'.$val['street_number'].'</td>';
                $exportpdf .= '<td  width="120" >'.$val['street_name'].'</td>';
                $exportpdf .= '<td  width="155" >'.$val['city'].'</td>';
                $exportpdf .= '<td  width="175"  >'.$val['zip'].'</td>';
                $exportpdf .= '<td  width="160" >'.$val['country'].'</td>';
            $exportpdf .= '</tr>';      
        }       
    $exportpdf .= '</table>';
$exportpdf = preg_replace('/>\s+</', "><", $exportpdf);
include("mpdf/mpdf.php");   
$mpdf=new mPDF('c','A4-L','','',32,25,34,18,16,13);
$mpdf->SetDisplayMode('fullpage');
$mpdf->list_indent_first_level = 0; 
$stylesheet = file_get_contents('mpdf/mpdf.css');
$mpdf->WriteHTML($stylesheet,1);
$mpdf->setFooter('Page {PAGENO}') ;
$mpdf->WriteHTML('<html><body>'.$exportpdf.'</body></html>');
$mpdf->Output('rec.pdf','D');
exit;
Run Code Online (Sandbox Code Playgroud)

Pra*_*ngh 5

是的,我找到了解决方案,你将不得不添加这些行

$mpdf->cacheTables = true;
$mpdf->simpleTables=true;
$mpdf->packTableData=true;
Run Code Online (Sandbox Code Playgroud)

它为我工作至少5000条记录