marcbachmann / node-html-pdf

This repo isn't maintained anymore as phantomjs got dreprecated a long time ago. Please migrate to headless chrome/puppeteer.
MIT License
3.56k stars 543 forks source link

Fix issue with last header appearing on all pages #507

Closed manishbhatt94 closed 5 years ago

manishbhatt94 commented 5 years ago

This relates to issue: https://github.com/marcbachmann/node-html-pdf/issues/390

As noted in one of the issue comments: comment link, version v2.2.0 of this library introduced a regression from v2.1.0

Same can be confirmed from the diff comparing changes from v2.1.0 to v2.2.0

To note in the above comparison is the phantom script file: lib/scripts/pdf_a4_portrait.js, where

if (pageNum === numPages && !html) html = o.last || c.last

line is changed to

if (numPagesFinal === numPages && !html) html = o.last || c.last

This PR simply reverts this change.

manishbhatt94 commented 5 years ago

@marcbachmann could you please review this? BTW thanks for this great library!

lera commented 5 years ago

Hello @marcbachmann ! we are using this library and we really need this latest fix 😞 Could you please create a new version including it? Thank you!🙂