I wonder if there is a way in mPDF to set the header only for the first page and set the footer for all the pages except the first page.

I've been struggling with this problem for a while, unfortunately the docs not making this point so clear!

I'm working on a codeigniter project, here is the code :

 $header = '<table>
        <tr>
            <td class="myco" class="width:60%;">
                <img src="image_dir">
            </td>
            <td>

            </td>
            <td class="t_center font-m">

                <h2>The header title</h2>
                <p></p>

            </td>
        </tr>
    </table>';

and calling the header for this function :

$pdf->SetHTMLHeader($header);

same way for the footer.

0 Answers