What are the potential pitfalls of mixing HTML code with fpdf when generating PDF documents?

Mixing HTML code with fpdf when generating PDF documents can lead to unexpected formatting issues or errors in the generated PDF. To avoid these pitfalls, it is recommended to use fpdf's built-in methods for creating text, tables, and other elements in the PDF document instead of relying on HTML.

<?php
require('fpdf.php');

$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output();
?>