如何在Chrome无头模式下指定PDF输出路径

时间:2017-06-21 16:02:01

标签: pdf google-chrome-headless

This page表示您现在可以使用chrome使用以下CLI命令生成网页的PDF:

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

但是,它没有说明如何指定输出路径。

如何指定输出路径?

1 个答案:

答案 0 :(得分:17)

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

来源:

enter image description here

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