无法生成PDF!“在rails中使用wkhtmltopdf

时间:2014-10-11 10:41:20

标签: ruby-on-rails wkhtmltopdf wicked-pdf

我使用wkhtmltopdf(0.10.0 rc2)和Wicked_pdf(0.9.4)生成pdf报告。

我收到以下错误

Failed to execute:
"/usr/bin/wkhtmltopdf" -q  --footer-left "[page]" --footer-right "Powered by AMP" --footer-font-size 7    --margin-top 5 --margin-bottom 10 --margin-left 10 --margin-right 10  --page-size "A4"   "file:////tmp/["wicked_pdf", ".html"]29083-0" "/tmp/["wicked_pdf_generated_file", ".pdf"]29083-0" 
Error: PDF could not be generated!

我的控制员:

render :pdf => "#{@note_name}",:layout => '/layouts/pdf_template.html.erb', :template=>'/leasing_activity/lease_act_pdf.html.erb'

的Gemfile:

gem "wicked_pdf","0.9.4"
gem "wkhtmltopdf-binary"

初​​始化/ wicked_pdf.rb:

WickedPdf.config = {
  :exe_path => '/usr/bin/wkhtmltopdf'

}

0 个答案:

没有答案