How to print PDF which is present in iframe?
I want to print pdf present in iframe.
I am able to print with browsers IE and Chrome, but it is giving problems with FireFox, Safari and Opera.
I have tried as follows:
function printIframe() {
if (navigator.userAgent.indexOf("Firefox") != -1) {
var frame_window = window.frames["my_iframe"];
frame_window.print();
}
else if (navigator.userAgent.indexOf("MSIE") != -1) {
var x = document.getElementById("pdfDocument");
x.print();
}
else if (navigator.userAgent.indexOf("Chrome") != -1) {
document.my_iframe.focus();
document.my_iframe.print();
}
else {
}
}
Please guide me for this.
Thanks.