Git Product home page Git Product logo

Comments (13)

westy92 avatar westy92 commented on May 18, 2024 2

Turns out that landed in 65.0.3294.0. I'm making some progress!

from html-pdf-chrome.

mingyugao avatar mingyugao commented on May 18, 2024 1

I tried setting custom header and footer template parameters using this, but it didn't work. Really would love this feature!

from html-pdf-chrome.

westy92 avatar westy92 commented on May 18, 2024 1

Primarily waiting for Chrome 65 to be promoted to the stable channel.
It looks like that could be as soon as March 6th. https://www.chromium.org/developers/calendar

You can follow my progress here: https://github.com/westy92/html-pdf-chrome/tree/custom-header-footer

from html-pdf-chrome.

westy92 avatar westy92 commented on May 18, 2024 1

@os1r1s110 @Exiliot @mingyugao Chrome 65 became stable today, so I cleaned up my branch. Any thoughts on my PR are welcome! Thank you.

from html-pdf-chrome.

lvmajor avatar lvmajor commented on May 18, 2024 1

@westy92 Seems pretty good to me for header/footer template as supported by the dev tools! :)

from html-pdf-chrome.

westy92 avatar westy92 commented on May 18, 2024 1

Released in v0.5.0. You're welcome!

from html-pdf-chrome.

westy92 avatar westy92 commented on May 18, 2024

This library may help significantly: https://github.com/byuarchdi/print-headers-and-footers

from html-pdf-chrome.

Exiliot avatar Exiliot commented on May 18, 2024

@westy92 The bug, which this library is aimed to fix, is already fixed in Chrome:
image
It seems that the requested feature is more related to this one bug.

from html-pdf-chrome.

westy92 avatar westy92 commented on May 18, 2024

@mingyugao, I think using those new parameters may be our best bet! I started some work here but was unable to get it to work. I made sure to use Chrome 64 but still had issues like the others here: puppeteer/puppeteer#373.

from html-pdf-chrome.

westy92 avatar westy92 commented on May 18, 2024

I believe this is the relevant Chrome source: https://cs.chromium.org/chromium/src/components/printing/resources/print_preview_page.html?q=headerTemplate&sq=package:chromium&dr=C&l=69

from html-pdf-chrome.

lvmajor avatar lvmajor commented on May 18, 2024

What would be missing for it to be usable? Only updating the typings definitions or something else?

from html-pdf-chrome.

westy92 avatar westy92 commented on May 18, 2024

I plan to do a release in a few hours. Thank you all for your patience!

from html-pdf-chrome.

lvmajor avatar lvmajor commented on May 18, 2024

Thank you for publishing it, it's really nice to work with.

Puppeteer works really well too but don't have a trivial option to run a single instance and reuse it as you do with this package : )

from html-pdf-chrome.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.