7of9121098
asked on
Print a PDF document via Jscript without opening the pdf document.
I'm using I.e 7.0 and I'm trying to print a PDF document via JScript. I just want to hit the print button and the print-wiindow should show up. The below code works but only prints-out the contents of the webpage but not the PDF document. I'm I missing something?
<iframe id="iFramePdf" runat="server" src="tt877A6.pdf" style="display:none;"></if rame>
<input type="button" value="Print" onclick="javascript:printT rigger('iF ramePdf'); " />
function printTrigger(elementId) {
var getMyFrame = document.getElementById(el ementId);
// alert(elementId);
// iFramePdf.focus();
//window.print();
iFramePdf.focus();
iFramePdf.print();
//iFramePdf.contentDocumen t.print();
}
<iframe id="iFramePdf" runat="server" src="tt877A6.pdf" style="display:none;"></if
<input type="button" value="Print" onclick="javascript:printT
function printTrigger(elementId) {
var getMyFrame = document.getElementById(el
// alert(elementId);
// iFramePdf.focus();
//window.print();
iFramePdf.focus();
iFramePdf.print();
//iFramePdf.contentDocumen
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.