Tuesday, 11 April 2017

Phantomjs:How to remove header footer only for the first page?

I'm using phantomjs to render pdf with header and footer. Adding header and footer is implemented in all pages. Is there any way to remove header/footer from 1st page alone?

 header: {
height: "1cm",
contents: phantom.callback(function(pageNum, numPages) {
  return "<h1>Header <span style='float:right'>" + pageNum + " / " + numPages + "</span></h1>";
})},  footer: {
height: "1cm",
contents: phantom.callback(function(pageNum, numPages) {
  return "<h1>Footer <span style='float:right'>" + pageNum + " / " + numPages + "</span></h1>";
})}



via Guru

No comments:

Post a Comment