--

Thanks for a great introduction to Puppeteer. I just wanted to add that if your need simply is to generate a PDF file of a web page, you can also do this from the command line without resorting to Javascript.

Simply run...

/path/to/Google\ Chrome --headless --print-to-pdf=./file.pdf https://www.google.com/

(Replace /path/to with the appropriate path to your Chrome or Chromium executable)

--

--

Jo Christian Oterhals
Jo Christian Oterhals

Written by Jo Christian Oterhals

Norwegian with many interests. Programming being one of them.

Responses (1)