I just want to show the pdf have body and footer. Body shown successfully, but footer don't display anymore. it logged render both footer and body. I used wicked_pdf 2.6.3 and wkhtmltopdf 0.12.6
pdf_file = WickedPdf.new.pdf_from_string(
ActionController::Base.new.render_to_string(
layout: 'layouts/v1/stocks/delivery_notes/delivery_note_document',
template: 'pdfs/stocks/delivery_notes/body_temp',
),
footer: {
content: ActionController::Base.new.render_to_string(
layout: 'layouts/v1/stocks/delivery_notes/footer',
template: 'pdfs/stocks/delivery_notes/footer_temp',
),
}
)
I tried multple times to add footer. but dont show
If You are about to add
wicked_pdfgem in your project I would suggest not to go with it. as it is no longer maintained and has issues while rendering Javascript / Images .Check out this discussion related to wicked_pdf usage. https://discuss.rubyonrails.org/t/successor-to-wkhtmltopdf-wicked-pdf/84251
If you still want to go with this wicked_pdf gem update your code as follows.
For full guide check this.
https://github.com/mileszs/wicked_pdf#advanced-usage-with-all-available-options