Set mpdf header and footer for pdf view.ctp

#1

Hi there,

I am using mpdf in my cakephp project. I create complete view for pdf. but can not set mpdf header and footer

here is my code:
// Set Array for view
$event_tickets = array(‘user’ => $user_arr, ‘events’ => $events_arr, ‘event_days’ => $day_arr, ‘event_tickets’ => $ticket_arr, ‘ticket_barcode_img’ => $getBarcode, ‘ticket_barcode_ref’ => $ticket_barcode_ref);

        // Get view object for rendering html
        $View = new View($this, false);
        $View->layout = false;
        $View->set('ticket_PDF', $event_tickets);
        // Get complete HTML of PDF
        $html = $View->render('generate_ticket_pdf');

        require(APP . 'Vendor/mpdf/mpdf.php');
        // initializing mPDF
        $this->Mpdf->init();
        $this->Mpdf->WriteHTML($html);

        $this->Mpdf->Output(WWW_ROOT . 'files/tickets/' . $referenceNumber . '.pdf', 'F');

PDF generate successfully but i can not set header and footer for pdf view. I also try this also
$mpdf->SetHTMLFooter()
$this->Mpdf->WriteHTML($html);

I must set header and footer so they can show on every page of pdf.
Any suggestions. Where am I doing wrong.