4

What is the perfect tool for converting html to pdf in C# ?? I have found wkhtmltopdf through stackoverflow.com . But its not working . showing this message in time of converting "www.google.com" in command line.

C:\Program Files\wkhtmltopdf>wkhtmltoimage.exe www.google.com go.pdf

Loading page (1/2)

Rendering (2/2)

Error: Could not save image

Done

I have also downloaded EO.pdf , but not sure how to use it through C# or command line. Just want a simple tool and guideline in C# which can convert html to pdf from url or html soruce . thanks in advance

radu florescu
  • 4,315
  • 10
  • 60
  • 92
Quazi Marufur Rahman
  • 2,603
  • 5
  • 33
  • 51

3 Answers3

7

Your issue is that you are attempting to use wkhtmltoimage.exe to generate a PDF. Use wkhtmltopdf.exe instead and you should be fine.

C:\Program Files\wkhtmltopdf>wkhtmltopdf.exe www.google.com go.pdf

As far as your question, I don't really believe that there is a perfect tool. I have been very satisfied with wkhtmltopdf however.

Phil Klein
  • 7,344
  • 3
  • 30
  • 33
1

I'm a fan of DocRaptor. It's easy to integrate into web apps and can use C# to convert HTML to PDF or XLS format.

Here's a link showing how to use it

illbzo1
  • 480
  • 3
  • 13
0

How about iText? http://itextpdf.com/

TheUnexpected
  • 3,077
  • 6
  • 32
  • 62