Creating PDF documents programmatically in a traditional way by adding text and images at fixed positions in PDF pages is a time consuming and inflexible approach which takes a lot of effort to create a good looking document. The best alternative for this approach is to design your document as a HTML page and convert that HTML page to a PDF document preserving all the styles and layout from the original HTML page.
You can use the EVO HTML to PDF Converter Library for .NET to instantly create styled, good looking and complex PDF documents right from existing HTML pages and reports. The converter combines the powerful printer friendly PDF format with the flexibility of the HTML format into a great tool for creating nicely formatted and easily maintainable PDF reports and documents.
The most important features of the EVO HTML to PDF conversion are:
- The library does not rely on external tools or services and does not require installation or server configuration changes, supporting simple copy deployment.
- It has been designed and tested to work reliably in multithreaded environments and in high traffic websites.
- The rendering is extremely accurate and the resulted PDF preserves all the graphics, images, texts, fonts and layout of the original HTML document, no matter how complex would be.
- The converter includes advanced automations for creating table of contents and hierarchical bookmarks based on HTML document structure and for transforming HTML forms into fillable PDF forms.
- With EVO HTML to PDF Converter not only you can create great new PDF documents but you can also edit, merge, split and fill existing PDF documents. The converter can be bundled with the other PDF tools for .NET in EVO PDF Toolkit to offer you additional capabilities to view PDF documents or to extract the text and images from existing PDF documents.
All the software features are detailed on HTML to PDF Converter for .NET webpage.
C# Code Sample for ASP.NET
The C# sample code below shows how you can convert HTML pages or HTML strings to PDF in just a few lines of code. An instance of the HtmlToPdfConverter class is created and used to convert HTML to PDF. The result of conversion is a byte which is sent as response to browser.
You can also see the HTML to PDF Converter for .NET Online Demo for all converter features with complete C# code.
Sample source code in C# and VB.NET for ASP.NET, MVC an Windows Forms can also be found in the software package you can download from website.