I wish to print a PDF at client side when a user clicks a particular link. However, the PDF should not open and print should be fired. It may not be silent printing, a OS popup asking the printer to use can come. My PDF Reader shall be Adobe Reader. I found a lot of links to try to however found they are dependent on Browser being used. I tried this code piece to successfully print in Chrome but i think chrome has its own PDF Renderer.
<script>function iprint(ptarget){
ptarget.focus();
ptarget.print();
}
</script><body>
<iframe name="theiframe" id="theiframe" width="500" height="200" src="http://192.168.108.105:8081/PDfTest/Excel.pdf" style="display:none">
</iframe>
<input type="button" value="print iframe" onclick="iprint(theiframe);" />
</body>
Also tried this code piece , but this opens the PDF and then prints:
<html>
<script language="javascript">
timerID = setTimeout("exPDF.print();", 1000);
</script>
<body>
<object id="exPDF" type="application/pdf" data="111.pdf" width="100%" height="500"/>
</body>
</html>
Would appreciate any help.