In this article, I will show you how to convert html to PDF and keep the hyperlinks in html file in converted PDF file. To do this, we need to download one software to your PC. It is VeryPDF HTML Converter v2.0.
- Here is the free downloading link for you, http://www.verypdf.com/htmltools/htmltools.zip.
- Unzip it and then it can be called from MS Dos Windows. Also if you use the sever version, you can call it from VC/VB/Delphi, ASP/PHP/.NET and other languages or scripts.
- Check the usage in the readme.text file and then do the conversion according to the usage.
- As we need to convert html to PDF, please follow this example.
htmltools.exe "http://www.verypdf.com" C:\out.pdf
- Take VeryPDF official website for example. Now we can make it in the MS Dos Windows.
- Now let us check the converted effect.
But now one problem you may asked that “is a remarkable product. - it is the only one to preserve hyperlinks in my document. BUT, I just cannot get it to force page breaks to split up the original HTML document suitable for A4 printing. It prints the entire document in miniature on just one sheet no matter how I set it up. Can you advise please? Thanks
To solve the page break problem, you can set page height and width to adjust it. The parameters "-width" and "-height" set the paper size forconversion. For example: htmltools.exe -nocenter -width 612 -height 792 -emfheight 792 "http://www.verypdf.com/pdfcamp/convert-html-to-pdf.html" "C:\out.pdf" . And the unit the height is point. You can convert from inch to point easily, for example, 8.5inch = 8.5x72 = 612pt 11inch = 11x72 = 792pt. By this way, you can convert a long html file to short PDF file and keeping its original hyperlinks.
BTW, there is another software on VeryPDF which can help you convert html to PDF. For your reference, I put its official website link here http://www.verypdf.com/pdfcamp/pdfcamp.htm. When you need, maybe you can have a check and compare them. Choose the best one for you.
If you have any question about this software or file format conversion, you are welcome to contact us by the ways supported on this website.