hajareshyam / pdf-creator-node

This package is used to generate HTML to PDF in Nodejs
MIT License
238 stars 79 forks source link

Add header only to subsequent pages. #88

Open RomDa00 opened 2 years ago

RomDa00 commented 2 years ago

Is there anyway to add a header to every page after the first one? Currently if I add a header to the options and I specify the height but say that the contents should only appear on page two it will still add the padding to the header in the first page and push down my information.

var options = {
    format: "A3",
    orientation: "portrait",
    border: "10mm",
    header: {
      height: "20mm",
      contents: {
          2: '<p align="center">{{page}} of {{pages}}</p>',
      }
  }
};
augustosnk12 commented 1 year ago

@RomDa00 did you find any solution for that?

RomDa00 commented 1 year ago

@augustosnk12 No I have not. It doesn't seem possible with this module, you'll have to use something else.

augustosnk12 commented 1 year ago

@RomDa00 is it possible with "pure" Puppeteer?