【发布时间】:2014-11-19 14:07:32
【问题描述】:
我正在使用 wkhtmltopdf(0.10.0 rc2) 和 wicked_pdf(0.9.9) 来生成 pdf 报告。 运行时出现以下错误。
RuntimeError (Error: Failed to execute:
["/usr/bin/wkhtmltopdf", "-q", "--page-size", "A4", "--margin-top", "5", "--margin-bottom", "10", "--margin-left", "5", "--margin-right", "5", "file:////tmp/[\"wicked_pdf\", \".html\"]21873-0", "/tmp/[\"wicked_pdf_generated_file\", \".pdf\"]21873-0"]
Error: PDF could not be generated!
Command Error: Error: Failed loading page file:////tmp/["wicked_pdf", ".html"]21873-0 (sometimes it will work just to ignore this error with --load-error-handling ignore)
)
我的控制器是:
render :pdf => "#{@note_name}",:layout => '/layouts/pdf_template.html.erb', :template=>'pdf/financial/maintenance_exp/maintenance_exp_pdf.html.erb'
任何帮助将不胜感激。
仅供参考:当我这样做时 :show_as_html=>真 它没有抛出任何错误。它在浏览器中呈现 html。
【问题讨论】:
标签: ruby-on-rails wkhtmltopdf wicked-pdf