我正在尝试这个简单的脚本:
require 'prawn'
template_file_name = File.join(File.dirname(__FILE__), 'template.pdf')
pdf_file = Prawn::Document.new(:template => template_file_name)
pdf_file.text('Hello World')
pdf_file.render_file('output.pdf')
与脚本相同的目录中有一个 template.pdf 文件,但 output.pdf 仅附带 Hello Wordl
还有什么我应该关心的吗?
谢谢
最佳答案
模板仅在 prawn 0.10.1 中引入正如丹尼尔·尼尔森所述here .
关于ruby - Prawn 模板不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4792954/