First off my English isn't very good but I tried my to best to explain the problem.
I have a PDF in base64, is a web application and uses JFS, that PDF is showing in a iframe with data uri in the source. This is the code:
<iframe width="100%" height="300%" id="pdf" type="application/pdf"></iframe>
$(document).ready(function(){
$('#pdf').attr('src', 'data:application/pdf;base64,#Mbtest.pdf}');
});
I need to print that PDF, I tried with jQuery but I have cross domain problems, but testing different ways, I opened the data uri in a new tab:
$("#imprimirPensionado").click(function () {
datos = $('#pdf').attr('src');
//console.log(datos);
prev = window.open(datos, 'large');
});
That code shows me the PDF in the new tab, I open the dev tools in chrome, in the js console wrote: window.print(); I can print the PDF with the dialog print.
So my question is, how I can execute window.print(); when in the new tab the PDF is full charge?