Convert HTML to PDF - Any library for ASP.net [closed]
Is there any .net library which would convert a HTML output to PDF --- in an asp.net application.
Doesn't matter if it is free or not
Based on my own experience I'd suggest ABCpdf library (it's not free, but you can get a trial license). Check out their documentation section for how to add HTML output to the PDF document.
Quick example:
string html = "<html>....</html>";
WebSupergoo.ABCpdf7.Doc doc = new WebSupergoo.ABCpdf7.Doc();
doc.Rect.Left = 10;
doc.Rect.Bottom = 50;
doc.Rect.Top = 750;
doc.Rect.Right = 600;
doc.SetInfo(0, "License", "[your license code || trial license"]);
doc.Page = doc.AddPage();
int pageID = doc.AddImageHtml(html, true, 1024, true);
while (doc.Chainable(pageID))
{
doc.Page = doc.AddPage();
pageID = doc.AddImageToChain(pageID);
}
for(int i = 1; i < doc.PageCount; i++)
{
doc.PageNumber = i;
doc.Flatten();
}
doc.Save("myfile.pdf");
Hope this will help you.
If you don't care the price, Aspose and Price are the best of its likes. Excellent fonts rendering, standard support.
1) Try wkhtmtopdf. It is the best tool I have found so far.
2) Winnovative offer a .Net PDF library that supports HTML input. They offer an unlimited free trial. Depending on how you wish to deploy your project, this might be sufficient.
Try DocRaptor.com. It converts html to pdf or html to xls using PrinceXML, and it works in any language.
Here is one that has been specifically designed for server based (asp.net) environments.
Provides perfect conversion fidelity, not some solution that only does 10% of the common HTML elements.
I worked on it, so the usual disclaimers apply.
精彩评论