I have been with this problem for a few days, on my website I created a button to open a PDF in iframe on another page, but the problem is that once the page is opened it does not finish loading and second is that the button to download the pdf does not work in chrome but in firefox ... This is my code:
function debugBase64(base64URL)
{
var win = window.open();
win.document.write('<iframe src="' + base64URL + '" frameborder="0" style="border:0; top:0px; left:0px; bottom:0px; right:0px; width:100%; height:100%;" allowfullscreen></iframe>');
win.window.focus();
}
and then the button to show:
$(".icon-export-alt").click(function()
{
console.log("click reporte");
debugBase64("data:application/pdf;base64, " + pdf1);
});
the file that I want to show is in base64 and I have it in a variable that is pdf1, please if you could tell me what is missing or is happening, it would be very helpful.