如何设置 pdftk 或 iText 以便与 Heroku 上的 Rails 3 一起使用?
我正在尝试找到一种方法将 FDF 文件内容注入可填充的 PDF 文件(由客户提供,不应该使用 Prawn 或 PDFKit 进行“重新绘制”),并且我认为我必须使用 iText(与 JRuby) ) 或 pdftk.
这两个库在我的 Ubuntu 本地计算机上都没有问题,但我想知道如何让它们在 Heroku 上工作。有没有人尝试过让 iText(JRuby) 或 PDFTK 在 Heroku 上工作?
感谢您的帮助!
I'm trying to find a way to inject FDF file content into a fillable PDF file (provided by customer and not supposed to be 're-drawn' using Prawn or PDFKit), and I think I have to use either iText(with JRuby) or pdftk.
Both of these libs work with no problem on my Ubuntu local machine, but I am wondering how I would get either them to work on Heroku. Has anyone tried to get iText(JRuby) or PDFTK to work on Heroku ?
Thanks for your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在 Heroku 上使用
pdftk
– 它是预安装的。您可以通过从 Ruby 应用程序中将其作为命令行程序来使用它。对于大多数
pdftk
命令,您将使用Tempfile
。将参数中的Tempfile#path
插入到pdftk
中。在某些情况下,您将能够使用
stdin
和stdout
而不是Tempfile
通过管道传入和传出数据。You can use
pdftk
on Heroku – it's pre-installed. You use it by shelling out to it as a command-line program from within your Ruby app.For most
pdftk
commands, you will useTempfile
s. Interpolate theTempfile#path
s in the arguments topdftk
.In some cases, you will be able to pipe data in and out using
stdin
andstdout
rather thanTempfile
s.