You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this is my code but generated pdf file not display on browser , but when I replace $objPdf->Output("","i"); by $objPdf->Output("","f"); it works good and save file on server . so what is the problem here and thanks
The text was updated successfully, but these errors were encountered:
I found a solution , the issue was because of using axios so I need to add this code to have a possibility to download PDF file .
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
link.click();
});
$objPdf = new Fpdf;
$objPdf->AddPage();
$objPdf->SetFont('Arial', '', 10);
$objPdf->SetTitle("Title");
$objPdf->SetAuthor('Author');
$objPdf->Cell(50, 25, 'Hello World!');
$objPdf->AliasNbPages();
$objPdf->Output("","i");
ob_get_clean();
this is my code but generated pdf file not display on browser , but when I replace $objPdf->Output("","i"); by $objPdf->Output("","f"); it works good and save file on server . so what is the problem here and thanks
The text was updated successfully, but these errors were encountered: