Hi,
I have a grid which lists all type of documents in a folder like (txt, png, doc, pdg, jpg, xls) above the grid there is print icon button on selecting a particular document by clicking on it and then clicking the print icon button it should open print screen with preview it happens in chrome correctly.
In IE browsers it's not behaving same as chrome for pdf and doc files first it down loads where as for txt and jpg files its opening in new tab. Now i want txt and jpg files also to down load or to show print screen. (or) I want to open print screen with preview like as chrome. Below is the code used for print in IE and chrome browsers.
function printPage(docPath) {
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
// If Internet Explorer, return version number
if (msie > 0) {
window.open(docPath);
return false;
}
else {
var div = document.getElementById("printerDiv");
div.innerHTML = '<iframe src="' + docPath + '" onload="this.contentWindow.print();"></iframe>';
}
}