This making a PDF file according to the query of MySql and PHP with FPDF, everything is fine and the pdf file is created without problem, in fact I put a background image to make it look better and it looks very good, the problem comes when a second page is created, the background image is not put and it is blank, I share the code so you can see it and you can help me to see the background on the second page
In fact, as you will see, try to put it in a Header but it does not work for me, in advance thanks for the help
<?php
require('fpdf/WriteHTML.php');
require('conexion.php');
//Rece-On6zpy
// Rece-fyR9Bc
$sql = mysqli_query($con, "SELECT * FROM recetas WHERE codigo='Rece-
On6zpy'");
$row = mysqli_fetch_assoc($sql);
class PDF extends FPDF
{
// Cabecera de página
function Header()
{
$this->Image('images/4.jpg', 0, 0, 250, 300);
// Movernos a la derecha
$this->Cell(80);
// Título
$this->Cell(30,10,'Title',1,0,'C');
// Salto de línea
$this->Ln(20);
}
function Footer(){
// Posición: a 1,5 cm del final
$this->SetY(-15);
// Arial italic 8
$this->SetFont('Arial','I',8);
// Número de página
$this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
}
}
$pdf = new PDF_HTML();
$pdf->AddPage('','','Letter');
//$pdf->Image('images/4.jpg', 0, 0, 250, 300);
$pdf->Image('images/logo3.png',50,10, 30,30);
$pdf->Image('images/logo3.png',130,10, 30,30);
$ruta ="photos_recetas_master/". $row['foto'];
$pdf->Image($ruta, 150, 55, 40, 40);
$pdf->Ln(30);
$pdf->Cell(150, 10, '', 0);
$pdf->SetFont('Arial', '', 10);
$pdf->Cell(40, 10, 'Fecha: '.date('d-m-Y').'', 0);
$pdf->Ln(5);
$pdf->SetFont('Arial', 'B', 11);
$pdf->Cell(70, 8, '', 0);
$pdf->Cell(100, 8, 'RECETA DE ARKACHEF.COM', 0);
$pdf->Ln(10);
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(45, 8, 'Nombre de la receta :', 0);
$pdf->SetFont('Arial', '', 10);
$pdf->Cell(150, 8, $row['nombre'], 0);
$pdf->Ln();
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(45, 8, 'Rinde para :', 0);
$pdf->SetFont('Arial', '', 10);
$pdf->Cell(25, 8, $row['num_personas'].' personas', 0);
$pdf->Ln();
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(45, 8, 'Tipo de comida :', 0);
$pdf->SetFont('Arial', '', 10);
$pdf->Cell(30, 8, $row['tipo_comida'], 0);
$pdf->Ln();
$pdf->SetFont('Arial', 'B', 10);
$str = utf8_decode('Clasificación');
$pdf->Cell(45, 8, $str.' de comida :', 0);
$pdf->SetFont('Arial', '', 10);
$pdf->Cell(37, 8, $row['clasi_gastro'], 0);
$pdf->Ln();
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(23, 8, 'Ingredientes', 0);
$pdf->SetFont('Arial', '', 10);
$str2= html_entity_decode($row['ingredientes']);
$str2= ltrim($str2," ");
$pdf-> WriteHTML(utf8_decode($str2),0);
$pdf->SetFont('Arial', 'B', 10);
$pdf->Ln();
$str = utf8_decode('Preparación');
$pdf->Cell(45, 8, $str, 0);
$pdf->SetFont('Arial', '', 10);
$str3= html_entity_decode($row['preparacion']);
$pdf->WriteHTML(utf8_decode($str3),1);
$pdf->Ln();
$pdf->SetFont('Arial', 'B', 10);
$pdf->Cell(23, 8, 'Comentarios', 0);
$pdf->Ln();
$pdf->SetFont('Arial', '', 10);
$str4= html_entity_decode($row['comentarios']);
$pdf->WriteHTML(utf8_decode($str4),1);
$pdf->Output();
?>