3

i trying to convert a sample HTML file to PDF using headless chrome and it is not working in 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>
<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.

Also, I have noticed that after running this command it is creating 6 chrome processes under CMD in task manager,

enter image description here

Can someone help me in solving this issue. I have already checked the below question but none helped -

SO Link 1

SO Link 2

Super User

ArigatoManga
  • 594
  • 5
  • 23
  • To me it looks like you are trying to write output in Program Files. Maybe permissions? – Kevin Brown Feb 15 '19 at 17:27
  • You could have a look at ABCpdf which uses a customised headless Chrome engine. It also enables some funky javascript extensions: https://www.websupergoo.com/abcpdf-html-to-pdf-conversion.aspx – Peter G Feb 18 '19 at 10:41
  • https://stackoverflow.com/questions/59047134/chrome-driver-headless-option-is-not-working-for-link you may find solution in this link – Mobin Al Hassan Dec 01 '19 at 09:21

1 Answers1

0

how about

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

?

rofrol
  • 14,438
  • 7
  • 79
  • 77