Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use wkhtmltopdf.exe in ASP.net [duplicate]

After 10 hours and trying 4 other HTML to PDF tools I'm about ready to explode.

wkhtmltopdf sounds like an excellent solution...the problem is that I can't execute a process with enough permissions from asp.net so...

Process.Start("wkhtmltopdf.exe","http://www.google.com google.pdf"); 

starts but doesn't do anything.

Is there an easy way to either:

-a) allow asp.net to start processes (that can actually do something) or
-b) compile/wrap/whatever wkhtmltopdf.exe into somthing I can use from C# like this: WkHtmlToPdf.Save("http://www.google.com", "google.pdf");

like image 855
David Murdoch Avatar asked May 07 '10 22:05

David Murdoch


1 Answers

You could also use Pechkin

.NET Wrapper for WkHtmlToPdf DLL, library that uses Webkit engine to convert HTML pages to PDF.

Nuget packages:

Pechkin.Synchronized

Pechkin

like image 85
Răzvan Flavius Panda Avatar answered Sep 22 '22 02:09

Răzvan Flavius Panda