印刷大虾生成pdf [英] Printing prawn generated pdf

查看:108
本文介绍了印刷大虾生成pdf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用prawn gem获得ruby-on-rails网页,是否可以将打印请求发送到打印机设备来打印我使用prawn生成的pdf页面?

Using prawn gem for ruby-on-rails webpage, is it possible to send print request to printer device to print pdf page I've generated using prawn?

推荐答案

看起来您希望使用虾印

# 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"

这篇关于印刷大虾生成pdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆