Hello,
Below is a small test harness. See if that helps.
<!DOCTYPE html>
<html>
<head>
<title>Test PDF Print</title>
<script type="text/javascript">
var t;
function startPrint() {
t = window.setTimeout(printPdf, 100, "JavaScript");
}
function printPdf() {
window.clearTimeout(t);
var f = document.frames ? document.frames['pdfFrame'] : document.getElementById('pdfFrame');
var iw = f.contentWindow || f;
iw.focus();
iw.print();
return false;
}
</script>
</head>
<body onload="startPrint()">
<iframe id="pdfFrame" name="pdfFrame" src="docs/events.txt" width="100%" height="160"></iframe>
</body>
</html>
Note : The browser must have a PDF plugin installed and shlould be able to open pdf document inside, else it won't work
Regards,