Studiosity / grover

A Ruby gem to transform HTML into PDFs, PNGs or JPEGs using Google Puppeteer/Chromium
MIT License
945 stars 109 forks source link

Any gotchas to rendering headers and footers? #223

Closed akaspick closed 9 months ago

akaspick commented 9 months ago

The following renders my page as a PDF just fine with a default header and footer.

Grover.new(html, display_url: 'http://test:3000/', display_header_footer: true).to_pdf

But if I specify a header and footer template, I start getting timeouts Grover::JavaScript::TimeoutError.

Grover.new(
  html, display_url: 'http://test:3000/', display_header_footer: true,
  header_template: "<span></span>",
  footer_template: "<span></span>"
).to_pdf

I'd like to eventually include actual headers and footers, but my base case won't even render.

Am I overlooking something?

akaspick commented 9 months ago

Just reinstalled all my npm packages and the timeouts are happening less frequently (still occurring though), but now with a bit markup in the templates, still nothing showing up. I'll close and investigate further.