Thursday, January 8, 2015

How To Use wkhtmltopdf Tool For Windows To Convert HTML to PDF

1. Download wkhtmltopdf from here -

2. Install it on your Windows machine into C:\Program Files\

3. Open command line prompt

4. Write the command - 'cd progra~1/wkhtmltopdf/bin'. Now you are into the bin directory of wkhtmltopdf.

5. Now write the actual command to convert a HTML file into PDF

$wkhtmltopdf /.pdf

Please note here that it would not allow the typical windows path like c:\windows.. etc. It will accept path with your IP address or your path like below example.

wkhtmltopdf \\JohnDow\Users\Public\abc.pdf

Alternatively you can also use forward slashes to access your local drive path from network like below.

wkhtmltopdf //

You can find out your local IP address by firing 'ipconfig' command.

Hope it helps!