Large memory usage to generate footer/header in all pdf page #3251

wedercm opened this Issue Dec 14, 2016 · 0 comments


None yet

1 participant

wedercm commented Dec 14, 2016 edited

Hi, I work in a rails application that needs to geneate a pdf document with footer/header in all pages. I'm using wkhtmltopdf gem with WickedPdf gem. My problem occurs when I try to genarete with 60 pages, and application, and application uses about 700MB of memory, but when I try to genarete pdf document without footer/header there is no problem with memory. Follows below my Wickedpdf with some wkhtmltopdf configuration.

WickedPdf.config = (WickedPdf.config || {}).merge({
  :layout      => "print",
  :disposition => "inline",
  :margin      => { top: 25, bottom: 15, left: 7, right: 7 },
  :dpi         => "300",
  :header      => { spacing: 20, html: {template: 'layouts/print/header.pdf.erb'} },
  :footer      => { spacing: 5, html: {template: 'layouts/print/footer.pdf.erb'} }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment