PDF Header & Footer on all pages


Hey all,

if you want to customize your template with your own header and footer, you have to edit your mdpf_helper.php in your directory (\application\helpers). If you open now the file, you have to change the things, I highlighted.


if (!defined('BASEPATH'))
    exit('No direct script access allowed');

function pdf_create($html, $filename, $stream = TRUE)

    require_once(APPPATH . 'helpers/mpdf/mpdf.php');

    $mpdf = new mPDF();
 -->$mpdf->setHTMLHeader('<img src="Fill in your PNG"/>');***
-->$mpdf->setHTMLFooter('<img src="Fill in your PNG"/>');***


    if ($stream)
        $mpdf->Output($filename . '.pdf', 'I');
        $mpdf->Output('./uploads/temp/' . $filename . '.pdf', 'F');
        return './uploads/temp/' . $filename . '.pdf';



I am not sure how to use this code block cause now I see different content there. Is this code still working? And, if so, the change needed is just these two lines?


@azurro Could you update the code block for version 1.4.9?


@Kovah for sure!