Welcome to YLOAN.COM
yloan.com » Innovation » Winnovative HTML to PDF Converter - An Easy Way to Create and Maintain PDF Reports
Education Self Improvement Addictions Anger-Management Attraction Coaching Creativity Goal-Setting Grief-Loss Innovation Leadership Motivation Organizing Positive-Attitude engagement luxury attractive personalized interview movers preparing tiles overcome nursing experts myths mattress scholarship confidence emergency english happiness

Winnovative HTML to PDF Converter - An Easy Way to Create and Maintain PDF Reports

Author: Winnovative Software

Author: Winnovative Software

Winnovative HTML to PDF Converter - An Easy Way to Create and Maintain PDF Reports The PDF (Portable Document Format) became over the years the de facto standard for printable documents mainly because the PDF can represent the document in a manner independent of the application software, hardware or operating system, the document content can be easily distributed as a single file and the text fonts used by the document can be embedded such that those fonts don't have to be installed on the machine where the document is dislayed or sent to the printer.

Creating PDF documents programatically is not an easy job even when using a good library for adding elements like texts, images and shapes to a document created from scratch. Maintaining and changing the document is even harder because each element was added to an absolute position on a PDF page and inserting a new element or changing an element usually implies a reflow of the whole document. This quickly becomes a pain for anyone in charge with maintaining the PDF document.

The HTML format on the other side is the standard for the information published on the Web, is easy to learn, design and maintain and many companies already have documents and reports available in this format. The HTML documents are written in a flow layout letting the web browsers to render the content which makes the insertion, deletion and changing of the elements an easy job. There are many tools for designing static HTML documents and many server frameworks for dinamically generating HTML pages based on a higher level description (ASP.NET framework from Microsoft is a very good example for this).

The drawback of the documents in the HTML format is that they are not suitable for an easy distribution because they refer external resources like images and CSS file. Also because the traditional measuring unit of the elements in a HTML document is the pixel, the aspect of the rendered content is dependent of the resolution of the printing device. Even more, not all the web browsers respect the HTML standard and the aspect of the rendered content can slightly differ function of the web browser. For example the printout of the same HTML document on the same machine from IE and Firefox web browser will not look the same.


The HTML to PDF Converter for .NET from Winnovative Software combines the powerfull printing capabilities of the PDF format with the flexibility of the HTML to format to create a great tool for creating nicely formatted and easy to maintain PDF reports and documents.

The HTML to PDF Converter for .NET is a library that can be used in any type of .NET application, either ASP.NET web sites or Windows Forms and WPF applications, to convert URLs, HTML strings and streams to PDF or to image. The library is compatible with .NET 2.0, .NET 3.5 and .NET 4.0. The converter offers full support for HTML tags and CSS, page breaks control with CSS styles, repeating HTML table header on each PDF page, live URLs and internal links in PDF, bookmarks, HTML in the headers and footers.

The HTML to PDF Converter is not using a printer driver and no special settings are necessary on the server in order to get it working. The same assembly works both in 32-bit and 64-bit environments and xcopy deployment on the server is supported.

With only a few lines of code you can convert web pages and HTML strings to PDF. Below is all the code you need to convert a web page to pdf and send the resulted PDF document as result to the browser: private void ConvertURLToPDF() { // create the converter PdfConverter pdfConverter = new PdfConverter(); // set converter properties pdfConverter.PdfDocumentOptions.PdfPageSize = PdfPageSize.A4; pdfConverter.PdfDocumentOptions.PdfCompressionLevel = PdfCompressionLevel.Normal; pdfConverter.PdfDocumentOptions.PdfPageOrientation = PDFPageOrientation.Portrait; // create the PDF document as a bytes array byte[] pdfBytes = pdfConverter.GetPdfBytesFromUrl(urlToConvert); // send the PDF document as a response to the browser for download System.Web.HttpResponse response = System.Web.HttpContext.Current.Response; response.Clear(); response.AddHeader("Content-Type", "binary/octet-stream"); response.AddHeader("Content-Disposition", "attachment; filename=ConversionResult.pdf; size=" + pdfBytes.Length.ToString()); response.Flush(); response.BinaryWrite(pdfBytes); response.Flush(); response.End(); } First a PdfConverter object is created and a few basic properties like PDF page size and orientation are set. Then the GetPdfBytesFromUrl() method is called to produce the PDF document in memory as an array of bytes. Finally The PDF document bytes are sent to the browser.About the Author:
print
www.yloan.com guest:  register | login | search IP(18.221.248.199) Noord-Holland / Amsterdam Processed in 0.009719 second(s), 7 queries , Gzip enabled , discuz 5.5 through PHP 8.3.9 , debug code: 17 , 4936, 262,
Winnovative HTML to PDF Converter - An Easy Way to Create and Maintain PDF Reports Amsterdam