在 ruby-on-rails 网页中使用 prawn gem,是否可以向打印机设备发送打印请求来打印我使用 prawn 生成的 pdf 页面?
最佳答案
看起来您想使用prawn-print 。
# Open print dialog, but don't autoprint.
pdf = Prawn::Document.new
pdf.text "I installed Adobe Reader and all I got was this lousy printout."
pdf.print
# Autoprint it on the default printer, when opened.
pdf = Prawn::Document.new
pdf.text "Help! I am trapped in a PDF factory!"
pdf.autoprint
# Autoprint it on a printer where the name includes "LaserJet".
pdf = Prawn::Document.new
pdf.text "Help! I am trapped in a PDF factory!"
pdf.autoprint "LaserJet"
关于ruby-on-rails - 打印 Prawn 生成的pdf,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9770388/