Follow on Google News News By Tag Industry News News By Place Country(s) Industry News
Follow on Google News | The easy method to convert HTML to PDF in ASP.NETElerium HTML to PDF .NET component, new release 2.5 has been introduced by Elerium Software.
By: Elerium Software When a developer creates an application or site, he can create a PDF document manually to understand the format specification, but it is a very long and laborious process. On the other side, the developer can use ready-made libraries for working with the PDF. One of these solutions is Elerium HTML to PDF .NET component. Elerium HTML to PDF .NET component, new release 2.5 has been introduced by Elerium Software. It has several important changes: - Improved the CSS parser of Html to PDF converter. - Added a parsing of tabs in HTML files. - Improved rendering of images in the PDF document. - Fixed issues of image alignment at PDF rendering. - Fixed issues of carrying the image over to the next line. How to convert an HTML file to a PDF document? This is very easy. First of all, a developer must install HTML to PDF .NET component to the project: 1. Add HTML to PDF .Net component to the solution. Simply put Docs.PDF.dll into /bin folder of the project. 2. Initialize the HtmlToPdf instance. When the component is connected to the project a developer can convert HTML to PDF: ASP.NET example // Initialize the string variables of input and output files string file_html = @"C:\hdoc.html"; string file_pdf = @"C:\new.pdf"; try { // Create a new instance of the HtmlToPdf class Docs.Pdf.HtmlToPdf conv = new Docs.Pdf.HtmlToPdf(); // Open the Html source conv.OpenHTML( // Convert html to pdf and save pdf to certain path and file name conv.SavePDF( } catch (Exception ex) { Response.Write( } Most often a developer need to convert dynamically generated HTML string to the PDF. It is also very easy: C# + ASP.NET example Docs.Pdf.HtmlToPdf conv = new Docs.Pdf.HtmlToPdf(); conv.BasePath = MapPath("~/"); conv.PageInfo.PageFormat = Docs.Pdf.ePageFormat.A4; conv.PageInfo.PageOrientation = Docs.Pdf.ePageOrientation.Portrait; conv.OpenHTML(@"<table width='100%'> <tr> <td width='19%'><strong>Last update:</strong></td> <td width='81%'> 23 Jun 2009 - 01:22</td> </tr> </table>"); conv.SavePDF( About Elerium Software Elerium Software develops professional solutions for use in .NET projects (C#, VB.NET, ASP.NET) that aimed to read/write/convert different office/web documents and formats. Elerium Software components are based on the unique design and fast algorithms that allow being independent from the third-party applications and libraries. For more information about the component please visit the product page: http://www.eleriumsoft.com/ End
Account Email Address Account Phone Number Disclaimer Report Abuse
|
|