开发者

Convert HTML to PDF - Any library for ASP.net [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. 开发者_如何学JAVA Closed 10 years ago.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜