在Debian上运行时,某些站点上的无头chrome打印为pdf会挂起

时间:2019-06-06 08:45:58

标签: google-chrome pdf debian

我正在尝试使用Headless chrome在debian 9上打印为pdf。

在某些站点上,它挂起并且永远不会返回错误。 在Windows 10上尝试执行相同操作时,它会起作用。

示例网站:https://www.ynet.co.il/home/0,7340,L-8,00.html

打开日志记录不会显示任何相关信息。 我假设它与字体有关,但是由于它挂起并且没有返回错误,所以我不确定该如何进行。 有一些了解它为什么挂起的东西吗?

在debian上进行设置:

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
dpkg -i google-chrome-stable_current_amd64.deb; apt-get -fy install 

在debian上创建pdf:

/usr/bin/google-chrome --headless --no-sandbox --disable-gpu --displayHeaderFooter=false --print-to-pdf=result.pdf https://www.ynet.co.il/home/0,7340,L-8,00.html

在Windows上创建pdf(需要安装google chrome并相应地更改其路径):

"c:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --headless --no-sandbox --disable-gpu --displayHeaderFooter=false --print-to-pdf=result.pdf https://www.ynet.co.il/home/0,7340,L-8,00.html

0 个答案:

没有答案