ruby-on-rails - 打印 Prawn 生成的pdf

标签 ruby-on-rails rubygems prawn

在 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/

相关文章:

ruby-on-rails - ActiveRecord 不会将字符串中的数组转换为数组

ruby-on-rails - 制作一个使用其关联范围的范围

ruby-on-rails - bundle 更新失败: marshal data too short

macos - 为什么 Sass 会倒在 HighSierra 上?

pdf - 使用 Prawn 在表格中插入图像时出错

ruby-on-rails - RSpec 共享示例不得共享

ruby-on-rails - 将通知存储给用户的数据库设计

ruby-on-rails - 使用 Phusion Passenger 时出错 - 无法在任何来源中找到 sqlite3-ruby-1.2.5 (Bundler::GemNotFound)

ruby-on-rails - 使用 Ruby on rails 渲染 Prawn pdf 和 rqrcode 显示 QR

Ruby:使用组方法时 Prawn PDF 内存不足