Headless Chrome to print pdf

前端 未结 7 1443
渐次进展
渐次进展 2020-12-30 15:33

I am trying to use Headless feature of the Chrome to convert a html to pdf. However, i am not getting output at all. Console doesn\'t show any error as well. I am running be

7条回答
  •  无人及你
    2020-12-30 15:33

    I was missing "=" after print-to-pdf command.

    The correct command is:

    chrome --headless --disable-gpu --print-to-pdf="C:/temp/name.pdf" https://www.google.com/
    

    Now it is working.

提交回复
热议问题