I have a PDF file and I am trying to print it via Javascript. I have tried this embed trick: Silent print a embedded PDF however, the print function never becomes available
There is a way to render the whole pdf in a browser (instead of embedding an external application), which gives you full access to browser APIs in regard to the pdf.
This is Mozilla's pdf implementation in JavaScript: https://github.com/mozilla/pdf.js/
And this is the showcase: http://mozilla.github.io/pdf.js/web/viewer.html (notice the print button on upper right).
Check out the viewer code here for the details on how it works: https://github.com/mozilla/pdf.js/blob/master/web/viewer.js
On the minus side — it's going to be way harder, than just embedding.
On the plus side, it will actually work.