Convert html webpage to PDF document under Win 7 system with wkhtmltopdf

  
                  

First download the wkhtmltopdf software and select the corresponding version according to the actual situation. For example, the author's Win7 32-bit system is the version of the first line of the download.

Installation: Click on the downloaded program, click on the highlighted button all the way, and remember the installation path, which will be used later. There will be no prompts after the installation is complete. Because wkhtmltopdf is a daemon, there is no front-end user interface.

Use: Because it is a background program, we can only use it in the run. First open the run (Where is Win7 running?). Then enter CMD to open the Windows system command prompt window. Enter the following command:

cd “C:\\Program Files (x86)\\wkhtmltopdf\\bin”

Then press Enter to confirm, and you will be switched to the above directory. If the prompt path is wrong, it may be that the version you installed is incorrect or the path is customized. You can find the correct path by indexing wkhtmltopdf.exe.

Then enter the following command in this path to convert the html page (URL) to a PDF document:

wkhtmltopdf.exe http://www.45it.com 1.pdf

There is a space between blue, red and green. The blue part is the command to start the wkhtmltopdf program. The form is unchanged. The red part is the URL of the web page you need to convert, customized according to your needs; the green part is the output pdf file name, which can be customized, such as 2.pdf, a.pdf, mtoou.pdf, etc., the output pdf file is saved in The path where the wkhtmltopdf.exe program is located. That is:

C:\\Program Files (x86)\\wkhtmltopdf\\bin

If you have customized the installation path, the installation path will prevail. In addition, the output pdf file save path can also be customized as needed.

Copyright © Windows knowledge All Rights Reserved