This is the best i had ever used till now
[
from google]
Here is some code(vb.net)
‘url of the page to be printed
fileToPrintURL = “www.somesite.com/pagename”
‘this will be the name of the file “.pdf” generated one
Dim filename As String = "Page" + TimeOfDay.Ticks.ToString() + ".pdf"
‘shared folder with write permissions and file name to be generated at which place
Dim filenameWithSharedPAth As String = Common.PDFSharedFolder + filename
‘create an object of process
Dim process As New Process
‘set some initails
process.StartInfo.UseShellExecute = False
process.StartInfo.CreateNoWindow = True
‘now the path of the exe downloaded from the link above
process.StartInfo.FileName = Server.MapPath("~/bin/PrintPDF/") + "wkhtmltopdf.exe"
‘and some arguments (based on req) as I need to pass it from authentication so user name and password
process.StartInfo.Arguments = "--username " + username + " --password " + password + " """ + fileToPrintURL + """ " + """" + filenameWithSharedPAth + """"
‘again some setting
process.StartInfo.RedirectStandardOutput = True
process.StartInfo.RedirectStandardError = True
‘start the process
process.Start()
‘end the process
process.WaitForExit()