Hi All,
I am new to java script. I am opening a pdf file using the java script window.open() function. After open it in new window i print the new window page using java script print function. It works fine for Firefox but in internet explorer it is not showing the print dialog.
I am using this code to open the window.
function openpdf(filename) {
try {
var childwindow = window.open(filename, null);
if (childwindow != null) {
//debugger;
//Checks to see if browser is IE
//if (navigator.appName.indexOf(‘Microsoft’) != -1) {
if (CheckIsIE()) {
try {
childwindow.focus();
//alert(childwindow);
if (!childwindow.closed) {childwindow.print(); }
}
catch (e) {
alert(e);
}
}
else if (navigator.appName.indexOf(‘Netscape’) != -1) {
alert(‘FireFox’);
childwindow.focus();
childwindow.setTimeout(‘print();’, 5000);
}
}
}
catch (e) {
}
}
I am trying self.print(), window.print() and print();
Thnx in advance??