lpr is a command-line command and is not valid Javascript syntax.
If you embed the pdf in your webpage and reference the object id, you should be able to do it.
e.g. in your HTML:
Code:
<object id = "examplePDF" type="application/pdf" data="example.pdf" width="500" height="500">
in your javascript
:
Code:
<script>
var pdf = document.getElementById("examplePDF");
pdf.print():
</script>
Another way:-
Code:
<iframe src="document.pdf" id="PDFtoPrint"></iframe>
<input type="button" value="Print" onclick="document.getElementById('PDFtoPrint').focus(); document.getElementById('PDFtoPrint').contentWindow.print();">
All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.