简体   繁体   English

无头镀铬在 Windows 10 中不起作用

[英]headless chrome not working in windows 10

i trying to convert a sample HTML file to PDF using headless chrome and it is not working in windows 10.我尝试使用无头 chrome 将示例 HTML 文件转换为 PDF,但它在 Windows 10 中不起作用。

this is the command i am using to convert the file,这是我用来转换文件的命令,

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --headless --disable-gpu --print-to-pdf=t.pdf t.html

the content in my html file is below,我的 html 文件中的内容如下,

<html>
<head>
<title>test</title>
</head>
<body>
<p>this is the sample file</p>
</body>
</html>

I have also tried for google.com and it is not working.我也尝试过 google.com,但它不起作用。

Also, I have noticed that after running this command it is creating 6 chrome processes under CMD in task manager,另外,我注意到在运行此命令后,它在任务管理器的 CMD 下创建了 6 个 chrome 进程,

在此处输入图片说明

Can someone help me in solving this issue.有人可以帮我解决这个问题。 I have already checked the below question but none helped -我已经检查了以下问题,但没有任何帮助-

SO Link 1 SO 链接 1

SO Link 2 SO 链接 2

Super User 超级用户

how about怎么样

 start chrome --headless --disable-gpu --print-to-pdf=%cd%\t.pdf t.html

? ?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM