I actually use MPDF in order to show my HTML code on a PDF. The problem that I have a lot of payroll employees , and I want to make each payroll on a page. This code works well.
$html = $this->view->partial('fiche/telechargerfiche.phtml',
array('fichep' => $recuperationFiche));
$mpdf=new mPDF();
foreach ($recuperationFiche as $fiche) {
$mpdf->SetDisplayMode('fullpage');
$mpdf->WriteHTML($html);
$mpdf->SetHTMLFooter("<div style='text-align: center'><img src='pieddepage.jpg' /></div>") ;
$mpdf->Output();
exit;
But the problem is that my payrolls is shown successively in the same page. Now I want to make each payroll on an independant page . I have to use a foreach , but I don't know where is the error , because it's shown to me the same result :
$html = $this->view->partial('fiche/telechargerfiche.phtml',
array('fichep' => $recuperationFiche));
$mpdf=new mPDF();
foreach ($recuperationFiche as $fiche) {
$mpdf->SetDisplayMode('fullpage');
$mpdf->WriteHTML($html);
$mpdf->SetHTMLFooter("<div style='text-align: center'><img src='pieddepage.jpg' /></div>") ;
$mpdf->Output();
exit;
}