I'd need to create a pdf version of my HTML pages using .NET 4.0. Is there any good free tool I can use?
I've seen some commercial tools but not any good free ones; ITextSharp doesn't seem to be performing well or able to handle table formats, etc.
I'd need to create a pdf version of my HTML pages using .NET 4.0. Is there any good free tool I can use?
I've seen some commercial tools but not any good free ones; ITextSharp doesn't seem to be performing well or able to handle table formats, etc.
We did extensive research (and testing) on this for a project in September 2011 and concluded that there were no tools that were both good (i.e. consistent, reliable rendering) and free.
http://code.google.com/p/wkhtmltopdf/ It's a console utility that'll do it for you.
Maybe you could try Amyuni WebkitPDF. It is free for personal and commercial use and it provides bindings for C# and C++.
Here is a screen capture of this page using this library:
Usual disclaimer applies
Aspose.Words Cloud SDK for .NET is a commercial product but its free trial plan provides 150 free monthly API calls. Maybe it suits your requirement. Its conversion is reliable and consistent.
// Get App Key and App SID from https://dashboard.aspose.cloud/
WordsApi wordsApi = new WordsApi(MyAppSid, MyAppKey);
var request = new ConvertDocumentRequest(
document: File.OpenRead("C:/Temp/Test.html"),
format: "pdf"
);
var result = wordsApi.ConvertDocument(request);
var fileStream = System.IO.File.Create("C:/Temp/Test.pdf");
result.CopyTo(fileStream);
fileStream.Close();
P.S: I'm developer evangelist at Aspose.