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

Dynamic footers issue #251

Open Agostero opened 3 months ago

Agostero commented 3 months ago

We are rendering PDFs for different clients and each client has a custom footer. If the footer has many lines it will overlap with the body of the pdf. Is there any way around this?

image

abrom commented 3 months ago

You're going to want to set a custom bottom page margin. This can either be done globally or per request:

    margin: {
      bottom: '10cm' // Or px etc..
    },
Petercopter commented 3 months ago

@Agostero Depending on what you need, this might be interesting https://github.com/pagedjs/pagedjs

It will allow you to handle the page layout and adjust footers and whatnot. We use it with great success.