Wicked_pdf footer not working

I have few problems visualizing footer_pdf.

Here is my rendering method:

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

PDF rendering works fine, but there is no footer template. I tried different fields in evil settings, but without success.

+4
source share
2 answers

It's just that this problem had a problem that my wkhtmltopdf installation did not create footers on demand.

The version that I installed was installed through the Ubuntu repository, I did not install it and downloaded the pre-built version, as described here, and now it works fine:

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

+3
source

I ran into the same problem, and it was a partial, non-executable problem.

So, this answer https://stackoverflow.com/a/4646268/ really worked for me:

So, I changed my code:

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

For this:

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

All Articles