如何在Chrome Headless模式下指定PDF输出路径 [英] How do I Specify PDF Output Path in Chrome Headless Mode
本文介绍了如何在Chrome Headless模式下指定PDF输出路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
此页面显示您现在可以使用chrome使用以下CLI命令生成网页的PDF:
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.
如何指定输出路径?
推荐答案
chrome --headless --disable-gpu --print-to-pdf="C:/temp/pdftest.pdf" https://www.google.com/
来源:
https://cs. chrome.org/chromium/src/headless/app/headless_shell.cc?type=cs&l=63
这篇关于如何在Chrome Headless模式下指定PDF输出路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文