How to fix overlapped text in header with MPDF library

1

I'm having a problem with the header in relation to body text when generating a PDF.

The header is being overwritten by body text, how to solve this?

I am using the SetHTMLHeader method for the header and the WriteHTML method for body text. Is there any way to increase the size reserved for the header with this library, or something else that solves it?

My current code:

<?php
session_start();
include('mpdf60/mpdf.php');
$paragrafo = "";
for($x=1;$x<=12;$x++){
    $paragrafo.=$_SESSION['c'.$x]."<br/>";
}
$cabecalho = $_POST['cabecalho'];

$mpdf=new mPDF();
$mpdf->SetDisplayMode('fullpage');

$mpdf->SetHTMLHeader($cabecalho);
$mpdf->WriteHTML($paragrafo);
$mpdf->Output();
exit;?>

How I wanted you to stay:

Howareyoudoing:

    
asked by anonymous 01.02.2016 / 19:43

1 answer

1

I did it! Thanks @Bacco for the link! I changed the following line:

$mpdf=new mPDF();

by:

$mpdf = new mPDF(
             '',    // mode - default ''
             '',    // format - A4, for example, default ''
             0,     // font size - default 0
             '',    // default font family
             15,    // margin_left
             15,    // margin right
             58,     // margin top    -- aumentei aqui para que não ficasse em cima do header
             0,    // margin bottom
             6,     // margin header
             0,     // margin footer
             'L');  // L - landscape, P - portrait
    
01.02.2016 / 22:28