How to convert HTML files to PDF files and combine several PDF files into one PDF file?

On the 64bit windows server 2008 system, we suggest you may use htmltools.exe to instead of "Doc Convertor", htmltools.exe is work better than "Doc Convertor" on 64bit system.


You can download and purchase "HTML Converter Command Line (htmltools.exe)" from following web page,

Please by following steps to combine several HTML files into one PDF file,

1. Please call htmltools.exe to convert each HTML file or Web URL to PDF file first, e.g.,

htmltools.exe -webkit D:\test1.html D:\1.pdf
htmltools.exe -webkit D:\test2.html D:\2.pdf
htmltools.exe -webkit D:\test3.html D:\3.pdf
htmltools.exe -webkit D:\test4.html D:\4.pdf

2. You can call htmltools.exe to combine these PDF files into one PDF file, e.g.

htmltools.exe -mergepdf "D:\1.pdf|D:\2.pdf|D:\3.pdf|D:\4.pdf" C:\out.pdf

3. Delete all temporary PDF files,

You can call htmltools.exe from your VB.NET code easily,
ShellandWait("D:\VeryPDF\htmltools.exe", "-webkit D:\test1.html D:\1.pdf")
ShellandWait("D:\VeryPDF\htmltools.exe", "-webkit D:\test2.html D:\2.pdf")
ShellandWait("D:\VeryPDF\htmltools.exe", "-webkit D:\test3.html D:\3.pdf")
ShellandWait("D:\VeryPDF\htmltools.exe", "-webkit D:\test4.html D:\4.pdf")

ShellandWait("D:\VeryPDF\htmltools.exe", "-mergepdf ""D:\1.pdf|D:\2.pdf|D:\3.pdf|D:\4.pdf"" C:\out.pdf")

Public Sub ShellandWait(ByVal ProcessPath As String, ByVal strParameters As String)
        Dim objProcess As System.Diagnostics.Process
                objProcess = New System.Diagnostics.Process()
                objProcess.StartInfo.FileName = ProcessPath
                objProcess.Arguments = strParameters
                objProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal

                'Wait until the process passes back an exit code

                'Free resources associated with this process
                MessageBox.Show("Could not start process " & ProcessPath, "Error")
        End Try
End Sub

If you encounter any problem with htmltools.exe application, please feel free to let us know.

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: +1 (from 1 vote)

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Verify Code   If you cannot see the CheckCode image,please refresh the page again!