Giter Club home page Giter Club logo

Comments (5)

jlandure avatar jlandure commented on August 23, 2024 7

Humm there is multiple ways to achieve that:

  1. With CSS
    https://stackoverflow.com/questions/46077392/additional-options-in-chrome-headless-print-to-pdf

  2. With DevTools protocol

https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-printToPDF
There is projects to easily test that:

  1. Cmd line?
    No way for the moment: https://bugs.chromium.org/p/chromium/issues/detail?id=603559

from alpine-chrome.

jlandure avatar jlandure commented on August 23, 2024

I've added a section in the README to explain the use with Puppeteer here 👌
And by default, with puppeteer default pdf options, there is no margins and no header/footer 👍

from alpine-chrome.

jlandure avatar jlandure commented on August 23, 2024

Hi @harobed did you solve your problems with page numbers?

from alpine-chrome.

jlandure avatar jlandure commented on August 23, 2024

Hi @harobed
Last call, I will close the issue in 3 days if you do not give any news...

from alpine-chrome.

gitaaron avatar gitaaron commented on August 23, 2024

I would recommend the second method you mentioned since the css method does not seem to work with many pages.

from alpine-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.