rubycdp / ferrum

Headless Chrome Ruby API
https://ferrum.rubycdp.com
MIT License
1.74k stars 123 forks source link

Conditionally Render Page header and footer template #415

Closed bharat619 closed 11 months ago

bharat619 commented 11 months ago

Hello, We are using this gem to generate PDF from HTML.

We specify the header and footer template

browser.pdf(
        encoding: :binary,
        format: :A4,
        margin_bottom: 1,
        margin_left: 0.4,
        margin_right: 0.4,
        print_background: true,
        display_header_footer: true,
        footer_template: footer_template,
        header_template: header_template 
      )

But we want to control the header and footer template on few pages, i.e. on some pages we do not want headers and footers. Is it possible to do that?

Is it possible to access the headers and footer with JavaScript somehow to manipulate / remove it?

route commented 11 months ago

I don't really understand your issue, you can open any page and call pdf method.

route commented 11 months ago

No answer, no issue.