I am showing a PDF file that I developed with the FPDF library in PHP and clicking on the button opens a new tab , but the tab remains blank, you only see a photo that I have in the background and the typical image of loading (like a circling circle) in the middle of the page and it is not shown nothing else, but after reloading the page it loads well and shows the information.
Why could this be happening?
EDIT
The button to call to create the PDF
<td>
<?php
// PDF
if($borrador == 1){ //SI ES BORRADOR
?>
<a href="index.php?p=pdf_borrador&id=<?php echo $row['ID_SOL']; // echo $row['id_spom']; ?>" class="btn btn-primary btn-sm" data-title="View" target="_blank"><span class="glyphicon glyphicon-save-file" aria-hidden="true"></span></a>
<?php
}else if ($borrador == 0){ //SI ES SOLICITUD
?>
<a href="index.php?p=pdf_solicitud&id=<?php echo $row['ID_SOL']; // echo $row['id_spom']; ?>" class="btn btn-primary btn-sm" data-title="View" target="_blank"><span class="glyphicon glyphicon-save-file" aria-hidden="true"></span></a>
<?php
}
?>
</td>
PDF headers (first lines)
<?php
define('FPDF_FONTPATH','_fpdf/font/');
require('_fpdf/fpdf.php');
$pdf=new FPDF('P','mm',array(216,330));
$pdf->SetAutoPageBreak(true,10);
$pdf->AddPage();
$pdf->SetFillColor(194,194,194);
$pdf->SetLineWidth(0.1);
$pdf->SetFont('Arial','',7);
$pdf->Text(10,4,'titulo1');
$pdf->Text(166,4,'titulo2');
ob_end_clean();
$pdf->Output('m_pdf_xxxx.php','i');
?>
I hope you clarify the subject a bit more. Obviously it is a much more extensive PDF but I can not place everything here, I tried this on my localhost and the same thing happens.
Thankful!