我正在尝试使用 chrome headless print to pdf 选项在 ubuntu 中打印一些 pdf 文件,这是我的命令行:
google-chrome --headless --disable-gpu --print-to-pdf http://www.google.com
现在,如果我像这样运行它,它会完美运行并生成文件。
但是 当我在 --print-to-pdf 之后添加文件名时:
google-chrome --headless --disable-gpu --print-to-pdf gen.pdf http://www.google.com
发生错误:
[1213/020159.194304:ERROR:headless_shell.cc(605)] Open multiple tabs is only supported when remote debugging is enabled.
有什么解决办法吗?谢谢。
最佳答案
你错过了 =
--print-to-pdf
之间和 gen.pdf
.
这应该有效:google-chrome --headless --disable-gpu --print-to-pdf=gen.pdf http://www.google.com
类似问题问 here
关于google-chrome - Ubuntu 中的 Chrome headless (headless),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47790308/