Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open Source HTML to PDF Renderer with Full CSS Support [closed]

I asked about getting iTextSharp to render a PDF from HTML and a CSS sheet before here but it seems like that may not be possible... So I guess I will have to try something else.

Is there an open source .NET/C# library out there that can take HTML and CSS as input and render it correctly?

I must reiterate... the library MUST be free and preferably something with a fairly liberal license. I'm working with basically no budget here.

like image 961
Adam Haile Avatar asked Jan 10 '09 05:01

Adam Haile


2 Answers

This command line tool is the business! https://wkhtmltopdf.org/

It uses webkit rendering engine(used in safari and KDE), I tested it on some complex sites and it was by far better than any other tool.

like image 69
isaac Avatar answered Oct 17 '22 17:10

isaac


I've always used it on the command line and not as a library, but HTMLDOC gives me excellent results, and it handles at least some CSS (I couldn't easily see how much).

Here's a sample command line

htmldoc --webpage -t pdf --size letter --fontsize 10pt index.html > index.pdf
like image 17
Norman Ramsey Avatar answered Oct 17 '22 16:10

Norman Ramsey