C # html to pdf converter using wkhtmltopdf or any other free tools

What is the ideal tool to convert html to pdf in C #? I found wkhtmltopdf through stackoverflow.com. But that does not work. showing this message while converting "www.google.com" to the command line.

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

Page Load (1/2)

Rendering (2/2)

Error: Failed to save image.

Done

I also downloaded EO.pdf, but not sure how to use it through C # or the command line. I just want a simple tool and guide in C # that can convert html to pdf from url or html soruce. thank you in advance

+4
source share
3 answers

Your problem is that you are trying to use wkhtmltoimage.exe to create a PDF file. Use wkhtmltopdf.exe and everything will be fine.

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

As for your question, I really do not believe that there is an ideal tool. However, I was very pleased with wkhtmltopdf.

+7
source

I am a fan of DocRaptor . It integrates seamlessly into web applications and can use C # to convert HTML to PDF or XLS format.

Here is a link showing how to use it

+1
source

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

0
source

Source: https://habr.com/ru/post/1387763/


All Articles