0

How do you install wkhtmltopdf in ASP.net MVC 3? Where do you even begin?? I have tried to read documentation on google, but it hardly makes any sense at all.

tereško
  • 58,060
  • 25
  • 98
  • 150
user2206127
  • 47
  • 1
  • 6

1 Answers1

0

Copy wkhtmltopdf folder containing dlls and exe to your web directory, you can also copy it to bin folder. Then use following code

Dim p As Process
     Dim psi As New ProcessStartInfo()



psi.UseShellExecute = False
psi.FileName = """" + Server.MapPath("~/wkhtmltopdf/wkhtmltopdf.exe") + """"
psi.CreateNoWindow = True
psi.RedirectStandardInput = True
psi.RedirectStandardOutput = True
psi.RedirectStandardError = True
psi.Arguments = " """ & <url> & """  """ & <Output path> & """ "
Try
   p.WaitForExit(15000)
Finally
   p.Close()
   p.Dispose()
End Try
makwana.a
  • 191
  • 6
  • you can add this code in your controller in action like Function WritePDF() As ActionResult End Function – makwana.a Dec 31 '13 at 05:18