I want to show a pdf generated from an invoice in a modal, and I want to do this so that the user can send it by email if they want it, and do it as soon as it is issued. The fact is that it is a system in a webhosting in the cloud, so I do not download each invoice. I want to show it when broadcasting it to print it and/or send it by email/whatsapp or download it.
Currently I use fpdf but I see symbols on the screen.
So how could this be achieved:
I currently have this code:
$('.modal-body').load('/views/modules/facta/imprimeA.php?
id='+data,function(){
$('#myModalPDF').modal({show:true});
});
I go to a php file with the invoice id, and get the data.
I appreciate your help.
I'm going to edit the question.
$('.modal-body').load('contentPDF.php?id='+data,function(){
$('#myModalPDF').modal({show:true});
});
<iframe src="/views/modules/facta/imprimeA.php?id="+<?php $_GET['id'];
?>+" style="border: none;">
</iframe>
And it actually worked. But it looks small AND the options that I mentioned before are not seen:
If you have the PDF file online and it is available to the whole internet (without authentication in your storage), you can use a
iframe
defining the source with the help of Google Drive, you will have the document controls as if it were Google Drive and it is very practical. In addition to a button to open it from a new tab with more options such as printing.In your HTML you should only have
iframe
the following, where it$file
contains the path where you have the PDF file: