I am trying to print a pdf file on the client side using javascript. My javascript code is as below
function doit() {
var win = document.getElementById("pdf");
var frm = document.getElementById("pdf").contentWindow;
frm.print();
win.print();
}
The problem is that frm is always null and win does not have a function of print
My pdf element is as below
<iframe id="pdf" name="pdf" src="C:\My_P.pdf"></iframe>
I am calling the function from c# as below
ClientScript.RegisterStartupScript(this.GetType(), "Print", "doit();", true);
Really struggling. Please help