How to Create PDF of Webpage Using Google Chrome Headless


You must be using Google Chrome 59 or a later version. With Google Chrome version 59, it’s only available for MAC OS and Linux users. Windows users still have to wait for some time.

Capture Screenshot:

Use the following command to capture a screenshot of the given web page. The output file will be created in the current directory with the name screenshot.png. You can also specifiy the dimension of screenshot using –window-size option like below. You can also specify output filename with location as –screenshot=file1.png to create specific name. Reference: