alvarcarto / url-to-pdf-api

Web page PDF/PNG rendering done right. Self-hosted service for rendering receipts, invoices, or any content.
MIT License
7.03k stars 779 forks source link

Upgrade Puppeteer to v1.0.0 (breaking change!) #56

Closed SpaceK33z closed 6 years ago

SpaceK33z commented 6 years ago

Puppeteer v1.0.0 introduced some breaking changes (weirdly enough these are not documented in the release notes)

Puppeteer v1.0.0 release notes.

It does bring two very nice new options: pdf.headerTemplate and pdf.footerTemplate. This also fixes #22.

I updated the new and changed options in the code and also updated the documentation.

rubenstolk commented 6 years ago

@SpaceK33z I'm not able to get this running on Heroku, have you tested that?

I think the issue is that you replaced goto with setContent. I just rolled that change back and everything works fine. I also don't see any notion of why this was changed in this PR.

SpaceK33z commented 6 years ago

@rubenstolk when I was almost done with the changes I noticed this work-in-progress branch: https://github.com/alvarcarto/url-to-pdf-api/commit/44e1173d0cd017c7a233710ef7ce9afedcae5808#diff-6ebe31c15c9e4e54cbe377a385fc6bfaR68. I copied the setContent() method from there. Anyway, I'll revert the setContent change then.

kimmobrunfeldt commented 6 years ago

Thanks for the effort. Closing because master has now puppeteer@1.6.0