18

This page shows that you can now use chrome to generate a PDF of a webpage using the following CLI command:

chrome --headless --disable-gpu --print-to-pdf https://www.chromestatus.com/

However, it does not state how to specify the output path.

How do you specify the output path?

Cody G
  • 8,368
  • 2
  • 35
  • 50

1 Answers1

31
chrome --headless --disable-gpu --print-to-pdf="C:/temp/pdftest.pdf" https://www.google.com/

source:

enter image description here

https://cs.chromium.org/chromium/src/headless/app/headless_shell.cc?type=cs&l=63

Cody G
  • 8,368
  • 2
  • 35
  • 50