In my Rails application, I'm trying to generate a PDF file using PDF-Kit.
I'm trying to add a footer to the PDF. I'm getting an error whenever I try to add the helper method :footer_html but, I could generate PDF without using it.
Error on the console is,
Error: Failed loading page http:/home/rmed179lt/workspace/ror/ROOT_PROJECT/views/mlap_reports/footer.html?page=1§ion=&subsection=&frompage=1&subsubsection=&topage=1&webpage=foobar&time=8:50 PM&date=15/02/16 (sometimes it will work just to ignore this error with --ignore-load-errors) QPaintDevice: Cannot destroy paint device that is being painted
kit = PDFKit.new(html, page_size: 'Letter', :footer_html => "/mlap_reports/footer.html")
I also tried,
kit = PDFKit.new(html, page_size: 'Letter', :footer_html => "/mlap_reports/footer")
My footer is located in app/views/mlap_reports/footer.html. Any Idea how to resolve this?
Finally, just found a solution. It's a bug related to PDFKit gem, I've bypassed it by following code.(Called wkhtmltopdf directly and supplied footer as parameter).
You could simply call wkhtml directly if you've to add a footer.