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.

<?php

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->defaultheaderfontsize=10;
-->$mpdf->setHTMLFooter('<img src="Fill in your PNG"/>');***
    $mpdf->SetAutoFont();

    $mpdf->WriteHTML($html);

    if ($stream)
    {
        $mpdf->Output($filename . '.pdf', 'I');
    }
    else
    {
        $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!

@Kovah that’s exactly my problem with the logo for the 2nd page. Is there already a solution for 1.5.11?