Open kinmt1234 opened 4 years ago
Is your footer content the full HTML including DOCTYPE and all that jazz?
It cannot just be partial HTML. It must be a valid standalone HTML document.
It could also be there, but obscured by the page margins or padding. Set a background color and/or a fixed height, and/or set your bottom margin and padding to 0 to see if its there, but covered up.
attachments["attachment.pdf"] = WickedPdf.new.pdf_from_string(
render_to_string(pdf: 'boleta',
template: 'boleta.pdf.slim',
layout: "layout_pdf.html",
encoding: "UTF-8",
page_size: "A4",
margin: { top: 25.4, bottom: 25.4, left: 25.4, right: 25.4 }),
footer: { content: render_to_string('shared/_footer_pdf.pdf.slim',
layout: "layout_pdf.html") })
Got it working this way, notice that footer is the second parameter for pdf_from_string, and not one of render_to_string. Also I believe the layout with html tags is required as pointed by @ruckus
Issue description
First of all, awesome gem. Thanks for your hard work. I have an issue to display the footer when it is in the attachment. Somehow my footer is not appearing.
Expected or desired behavior
Any ideas of how to make footer appear?
System specifications
ruby '2.6.4' wicked_pdf (1.4.0) wkhtmltopdf 0.12.5 (with patched qt) Rails 5.2.2