Search code examples
c#asp.netwkhtmltopdf

wkhtmltopdf - convert html code to pdf directly in C#


I know this tool looks up on a url and converts the repsponse to pdf. How do I convert a

<html> content.. </html> 

into a pdf?

I was looking at the help files on wkhtml2pdf and looks like it provides an option of stdin but I can't really figure out how to emulate stdin.

Also if you know a tool which does a better job, please suggest me some.

Thanks a lot!


Solution

  • wkhtmltopdf is a free tool, but it's not written in .NET and it could be kind of hard to integrate into your asp.net application.

    you can take a look at iTextSharp, which is free, but cannot handle any kind of html, or you can take a look at commercial tools to convert html to pdf, like ExpertPDF or ABCpdf, that can handle any html/css.