【发布时间】:2014-08-25 18:14:37
【问题描述】:
我正在使用 wicked_pdf 生成 PDF,并且我想在每个页面中包含一个带有图像的页脚。
我生成了一个文件footer.pdf.erb,插入到页面底部,但是,当呈现 PDF 时,图像出现在顶部并且页面内容消失了。
我使用的版本是 wicked_pdf gem 的 0.10.2 和 wkhtmltopdf 的 0.12.1。
footer.pdf.erb
<html>
<head>
</head>
<body>
<%=wicked_pdf_image_tag('image_path', :width => "97", :height => "25")%>
</body>
</html>
controller.rb
format.pdf do
render :pdf => "pdf",
:footer => {:html => {:layout => 'layouts/pdfs/footer.pdf.erb'}}
end
:footer 通话可以吗?或者还有其他方法可以在 PDF 的页脚中插入图像?
【问题讨论】:
标签: image footer wkhtmltopdf wicked-pdf