-->

wicked_pdf页脚不工作(wicked_pdf footer not working)

2019-09-21 22:09发布

我有与wicked_pdf页脚呈现小问题。

这里是我的渲染方法:

def invoice
    render pdf: "#{@order.number}.pdf",
           footer: { html: { template: "admin/orders/invoice_footer.html" } },
           margin: { bottom: 25 }
end

PDF渲染的作品不错,但没有页脚模板。 我试着在邪恶的设置不同的利润率,但没有成功。

Answer 1:

只是有同样的问题,这个问题似乎是我的wkhtmltopdf安装并没有产生页脚的要求。

我的版本是通过Ubuntu的仓库安装,我未安装此下载和这里描述的预建版本,现在它工作正常:

https://github.com/mileszs/wicked_pdf/wiki/Getting-Started-Installing-wkhtmltopdf



Answer 2:

我也遇到了同样的问题,这是与部分不被渲染的问题。

所以这个答案https://stackoverflow.com/a/19323701/784318没有工作对我来说:

所以我改变了我的代码如下:

options = {
    header: {html: {template: 'shared/_header', layout: nil}},
}

为此:

options = {
    header: {content: render_to_string('shared/_header', layout: nil)},
}


文章来源: wicked_pdf footer not working
标签: wicked-pdf