php - mPDF does not create a second page to continue, write over the first

one text

I'm trying to create a PDF file via mPDF where the page continues. However, the second page write over the first

Code:

require_once ('../database/conection.php');

$db->query("SET NAMES 'utf8'");
$db->query("SET character_set_connection=utf8");
$db->query("SET character_set_client=utf8");
$db->query("SET character_set_results=utf8");

$sql = $db->query("SELECT * FROM movconsumo");

require_once __DIR__ . '/../vendor\autoload.php';

$mpdf = new \Mpdf\Mpdf();

$data = '';

while ($row = $sql->fetch(PDO::FETCH_ASSOC)) {
    
   
    $data .= "<tr style='border: 1px solid black; border-collapse: collapse;'> <td style='border: 1px solid black; border-collapse: collapse;'>".$row['datamov']."</td>";
    $data .= "<td style='border: 1px solid black; border-collapse: collapse;'>".$row['nomeitem']."</td>";
    $data .= "<td style='border: 1px solid black; border-collapse: collapse;'><center>".$row['quantmov']."</center></td>";
    $data .= "<td style='border: 1px solid black; border-collapse: collapse;'>".$row['destinomov']."</td>";
    $data .= "<td style='border: 1px solid black; border-collapse: collapse;'>".$row['histmov'].'</td></tr>';
}

$mpdf->SetHTMLHeader('
<table width="100%" style="vertical-align: bottom; font-family: serif; font-size: 14pt; color: #000000; font-weight: bold; border-bottom:0.5mm solid #220044;">
<tr>
    <td width="50%"><span style="font-weight: bold;">RELAT?�RIO ITENS MOVIMENTADOS</span></td>
    <td width="45%" style="text-align: right;"><span style="font-size: 9pt;">teste<br /></span></td>
    <td width="5%" style="text-align: right;"><img src="../images/teste.png" width="100" height="105" /></td>
</tr>
</table><br><center>
<table style="border: 1px solid black; border-collapse: collapse; ">
  <tr style="border: 1px solid black; border-collapse: collapse; ">
    <th>DATA</th>
    <th>NOME</th> 
    <th>QUANTIDADE</th>
    <th>DESTINO</th>
    <th>HIST?�RICO</th>
  </tr>
'.$data."</table></center>");


//#--> page
$mpdf->SetDisplayMode('fullpage');
$mpdf->list_indent_first_level = 0; // 1 or 0 - whether to indent the first level of a list
$mpdf->AddPage('L'); // Adds a new page in Landscape orientation L/P
//
$dia = date('d/m/y');

//#--> footer
$mpdf->SetHTMLFooter('
<table width="100%" style="vertical-align: bottom; font-family: serif; font-size: 8pt; color: #000000; font-weight: bold; font-style: italic;">
<tr>
    <td width="33%"><span style="font-weight: bold; font-style: italic;">'.$dia.'</span></td>
    <td width="33%" align="center" style="font-weight: bold; font-style: italic;">{PAGENO}/{nbpg}</td>
    <td width="33%" style="text-align: right; ">Teste</td>
</tr>
</table>
');

$mpdf->Output();

I tried every way to keep the text going, however, it keeps writing on the first page. I am using mpdf 8.1 with yii2 and PHP version is 7.4 for PDF report download. It's works fine in local environment. But the text keeps writing on the first page.

Source