简体   繁体   中英

Rails 3/JavaScript: Print PDFs to default printer

I have an app that generates PDFs and I want it to be able to print the PDF to the client default printer. How can I accomplish that?

Thanks

Edit: Javascript link could also work.

You could embed javascript in your pdf. http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/Acro6JSGuide.pdf

So when you generate the PDF, use this.print() when the document is opened.

Rails only sends the PDF to the browser, and the browser/user handles printing. You really can't control what printer it gets sent to...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM