I need to print a .pdf file (I generate it with jasperReport and I save it on a server) when I click on a print.gif button. Now I found this solution that works for Firefox but not for IE!
function printPdf(){
var url= document.getElementById('_url').value;
newwindow=window.open();
newdocument=newwindow.document;
newdocument.write('<embed type="application/pdf" src="'+url+'"
id="pdfDocument" height="100%" width="100%" ></embed> <SCR'+'IPT
LANGUAGE="JavaScript">window.print();window.close();</SCR'+'IPT>');
}
I tried also document.close();
window.focus();
window.print();
window.close();
, but they didn't work!
I read a lot of topics, but I can't find a solution for this issue!