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
On a Windows computer, open an HTML web page in Internet Explorer, Google Chrome, or Firefox. On a Mac, open an HTML web page in Firefox. Click the “Convert to PDF” button in the Adobe PDF toolbar to start the PDF conversion. Enter a file name and save your new PDF file in a desired location.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With