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.
Asked
Active
Viewed 307 times
0
-
You can start at http://stackoverflow.com/questions/1331926/calling-wkhtmltopdf-to-generate-pdf-from-html – Gabriele Petrioli Dec 30 '13 at 02:11
-
"I put the wkhtmltopdf.exe file at the top level directory of the site." -- How would I do that? – user2206127 Dec 30 '13 at 02:18
1 Answers
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