function printIframe() { if (navigator.userAgent.indexOf("Firefox") != -1) { //This is not working var frame_window = window.frames["my_iframe"]; frame_window.print(); } else if (navigator.userAgent.indexOf("MSIE") != -1) { //working var x = document.getElementById("pdfDocument"); x.print(); } else if (navigator.userAgent.indexOf("Chrome") != -1) { //working document.my_iframe.focus(); document.my_iframe.print(); } else { //not working // Safari browser or other one // document.getElementById('my_iframe').focus(); // document.getElementById('my_iframe').onload = setTimeout('iframe.print()',2500); // var ifWin = document.getElementById('my_iframe').contentWindow; // ifWin.focus(); // ifWin.print(); //printpdf(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)