使用 wkhtmltopdf 生成 pdf 时出现此错误
undefined method `pdf_from_string' for #<WickedPdf:0x7f4b82a369c8>
我的 wicked_pdf.rb
WickedPdf.config = {
:wkhtmltopdf => '/usr/local/bin/wkhtmltopdf',
:layout => "pdf.html",
:margin => { :top=> 40,
:bottom => 20,
:left=> 30,
:right => 30},
:header => {:html => { :template=> 'layouts/pdf_header.html'}},
:footer => {:html => { :template=> 'layouts/pdf_footer.html'}}
# :exe_path => '/usr/bin/wkhtmltopdf'}
在命令行上
wkhtmltopdf google.com google.pdf
工作正常。