Winnovative Software Logo

 HTML to PDF Converter - Excel Library - ASP.NET Charts - RTF to PDF Converter
 PDF Merge and Split - PDF Security - PDF Viewers - PDF to Text - Images Extractor

 
Skip Navigation Links
 
.NET Logo

Winnovative HTML to PDF Converter for .NET and .NET Core

The Winnovative HTML to PDF Converter library for .NET and .NET Core can be integrated in any .NET and .NET Core application including ASP.NET, ASP.NET Core and MVC web sites, Windows Forms and WPF applications, Azure Cloud Services, to convert URLs, HTML strings and streams to a PDF document, to a raster image or to a SVG vector image.

You can use the HTML to PDF Converter for .NET as a general purpose tool for converting web pages and HTML code to PDF and images or you can use it as part of our .NET Reporting Toolkit to easily create PDF reports directly from ASP.NET pages and to benefit from the great power of ASP.NET controls.

The converter offers full support for HTML tags, HTML5 with CSS3, SVG and Web Fonts, page breaks control, media type rules, repeating HTML table header and footer, hierarchical bookmarks, tables of contents, fillable PDF forms, HTML with page numbering in header and footer.

The HTML to PDF Converter is not based on any external tools and no special settings are necessary on the server in order to get it working. There are separate libraries for .NET Framework and for .NET Core. The library for .NET Framework is compatible with .NET 2.0 and .NET 4.0 and the later runtimes. The library for .NET Core was built for .NET Standard 2.0 and is compatible with .NET Core2.0, with .NET Core 3.1, with .NET Core 6.0 and later.

The library was designed and tested to work reliably in multithreaded environments and to completely release all the resources used during conversion after each conversion. This makes it suitable for usage in high traffic ASP.NET websites and services running a long period of time without interruption.

The software package you can download from website contains demo applications for ASP.NET ASP.NET Core, MVC, Windows Forms and Azure Cloud Services with full source code both in C# and VB.NET.

The licensing model is simple and you can purchase a license online. A purchased license never expires, is royalties free and it includes free technical support and software update for 1 year from purchase date.
HTML to PDF Converter for .NET Box
Download Icon Software Download
Winnovative HTML to PDF Converter for .NET is distributed as Zip archive and the software does not need installation. You can simply extract the archive into a folder and reference the .NET assembly in your project. You can see the latest new features and chages in Release Notes. When you download the software you implicitly agree with the terms and conditions from this End User License Agreement. Please read carefully this agreement before downloading the software on your computer.
Download HTML to PDF Converter v16.0 for .NET
Download HTML to PDF Converter v16.0 for .NET Core
On Windows 7 and later, after you have extracted the files from the archive, make sure the product binaries and documentation files (the .dll , .dat and .chm files) were not blocked by Windows. Open the file Properties in Windows Explorer and if there is an 'Unblock' button click on it to unblock the file.
The general version of the HTML to PDF Converter Library for .NET taht you can download from the link above works well both on 32-bit and 64-bit environments. The 64-bit environments offers more memory for the executing processes and the version below is optimized to take advantage of this opportunity when converting very large HTML documents:
Download HTML to PDF Converter for .NET - Optimized for 64-bit
Download HTML to PDF Converter for .NET Core - Optimized for 64-bit
The version optimized for 64-bit systems works only on 64-bit systems and it cannot be used on 32-bit systems.
Winnovative HTML to PDF Converter NuGet Logo ImageNuGet package can be downloaded and managed directly from your Visual Studio project. NuGet is a Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects that use the .NET Framework.
More Winnovative HTML to PDF Converter Features

HTML to PDF Converter Features

Easy integration, no installation or setup is required on server
Designed and tested for multithreaded environments
Does not require IE WebBrowser or any third party tools
Compatible with .NET Framework and .NET Core Runtime
Compatible with Windows Azure Cloud applications
Can be deployed on the server by simple xcopy deployment
Works both in 32-bit and 64-bit environments
Convert web pages, HTML strings to PDF files or in memory
Convert web pages, HTML strings to raster image formats
Convert web pages, HTML strings to SVG vector images
Support for HTML5 features like CSS3, SVG and Web Fonts
Convert HTML with SVG and Web Fonts to PDF
Different styles for screen and print using @media rules
Merge multiple web pages into the single PDF document
Convert only a selected part of the HTML document
Generate PDF/A and PDF/X compliant documents
Generate CMYK and Gray Scale PDF documents
Full support for Unicode and right to left languages
Set PDF page size to a standard (A4, etc.) or a custom size
Set PDF page orientation and PDF document margins
Set JPEG compression level for images in PDF document
Add HTML content and page numbers in header and footer
Add page numbering in header and footer HTML
Control header and footer visibility in each PDF page
Add header and footer to existing PDF documents
Auto resize header and footer to adapt to content
Control page breaks in PDF using standard CSS styles
Control page breaks in PDF using API
'Keep Together' feature with page-break-inside:avoid
Avoid page breaks inside HTML elements using API
Option to avoid cutting off images between PDF pages
Add content in PDF pages background during conversion
Add content over PDF page main content during conversion
Repeat the HTML table header and footer in PDF pages
Place and resize the HTML content anywhere in a PDF page
Shrink or stretch the HTML content to fit the PDF page
Automatically resize the PDF page to fit the HTML content
Convert HTTP links from HTML to HTTP links in PDF
Convert internal links from HTML to internal links in PDF
Auto create a bookmarks hierarchy from heading tags
Select in HTML the elements to bookmark
Select in API the elements to bookmark
Auto create a table of contents from heading tags
Define in HTML the elements to include in table of contents
Auto create a live PDF form from a HTML form
Define in HTML the elements to become fields in PDF form
Get the location in PDF for a set of selected HTML elements
Embed true type fonts into the rendered PDF for portability
Append or prepend external PDF files to conversion result
Password protect and set permissions of the PDF document
Add a digital signature to generated PDF document
Set the PDF document properties like title, subject, etc.
Enable or disable JavaScript during conversion
HTTP authentication support (IIS Windows Authentication)
Use current user credentials for NTLM authentication
Support for access through a HTTP or SOCKS Proxy
Access the HTML page with GET or POST HTTP methods
Add HTTP headers when the HTML page is requested
Add cookies when the HTML page is requested
Execute a JavaScript when the PDF document is opened
Go to a page when the PDF document is opened
Open the print dialog when the PDF document is opened
Set the zoom level when the PDF document is opened
Support for Flash and other extensions
Add file links and attachments to generated PDF document
Add text notes to generated PDF document
Add watermarks and stamps to generated PDF document
Add graphic elements to generated PDF document
Add image elements to generated PDF document
Add text elements to generated PDF document
Edit existing PDF document
Merge multiple PDF documents in a single PDF document
Split a PDF document in multiple PDF documents
Fill PDF forms and save the filled PDF document
C# and VB.NET samples for ASP.NET, Windows Forms
Sample code for ASP.NET MVC with Razor engine
Sample code for a Windows Azure Cloud Service
Full documentation for all the product features


Winnovative HTML to PDF Converter C# Code Sample for ASP.NET

Code Sample for ASP.NET

With Winnovative HTML to PDF Converter for .NET you can convert a HTML document to PDF in just a few lines of code. The API is also rich and flexible to allow you customize the resulted PDF document in various ways. The code below is copied from the Getting Started demo for HTML to PDF Converter that you can find the in the Samples folder of the software Zip archive.
protected void convertToPdfButton_Click(object sender, EventArgs e)
{
    // Create a HTML to PDF converter object with default settings
    HtmlToPdfConverter htmlToPdfConverter = new HtmlToPdfConverter();

    // Set HTML Viewer width in pixels which is the equivalent in converter of the browser window width
    htmlToPdfConverter.HtmlViewerWidth = int.Parse(htmlViewerWidthTextBox.Text);

    // Set HTML viewer height in pixels to convert the top part of a HTML page 
    // Leave it not set to convert the entire HTML
    if (htmlViewerHeightTextBox.Text.Length > 0)
        htmlToPdfConverter.HtmlViewerHeight = int.Parse(htmlViewerHeightTextBox.Text);

    // Set PDF page size which can be a predefined size like A4 or a custom size in points 
    // Leave it not set to have a default A4 PDF page
    htmlToPdfConverter.PdfDocumentOptions.PdfPageSize = SelectedPdfPageSize();

    // Set PDF page orientation to Portrait or Landscape
    // Leave it not set to have a default Portrait orientation for PDF page
    htmlToPdfConverter.PdfDocumentOptions.PdfPageOrientation = SelectedPdfPageOrientation();

    // Set the maximum time in seconds to wait for HTML page to be loaded 
    // Leave it not set for a default 60 seconds maximum wait time
    htmlToPdfConverter.NavigationTimeout = int.Parse(navigationTimeoutTextBox.Text);

    // Set an adddional delay in seconds to wait for JavaScript or AJAX calls after page load completed
    // Set this property to 0 if you don't need to wait for such asynchcronous operations to finish
    if (conversionDelayTextBox.Text.Length > 0)
        htmlToPdfConverter.ConversionDelay = int.Parse(conversionDelayTextBox.Text);

    // The buffer to receive the generated PDF document
    byte[] outPdfBuffer = null;

    if (convertUrlRadioButton.Checked)
    {
        string url = urlTextBox.Text;

        // Convert the HTML page given by an URL to a PDF document in a memory buffer
        outPdfBuffer = htmlToPdfConverter.ConvertUrl(url);
    }
    else
    {
        string htmlString = htmlStringTextBox.Text;
        string baseUrl = baseUrlTextBox.Text;

        // Convert a HTML string with a base URL to a PDF document in a memory buffer
        outPdfBuffer = htmlToPdfConverter.ConvertHtml(htmlString, baseUrl);
    }

    // Send the PDF as response to browser

    // Set response content type
    Response.AddHeader("Content-Type", "application/pdf");

    // Instruct the browser to open the PDF file as an attachment or inline
    Response.AddHeader("Content-Disposition", String.Format("{0}; filename=Getting_Started.pdf; size={1}",
        openInlineCheckBox.Checked ? "inline" : "attachment", outPdfBuffer.Length.ToString()));

    // Write the PDF document buffer to HTTP response
    Response.BinaryWrite(outPdfBuffer);

    // End the HTTP response and stop the current page processing
    Response.End();
}


Winnovative HTML to PDF Converter C# Code Sample for MVC

Code Sample for MVC

Winnovative HTML to PDF Converter for .NET can be used in any type of .NET application, including ASP.NET MVC websites. The code below is copied from the Getting Started demo for MVC that you can find in the Samples\Other\Mvc folder of the software Zip archive.
[HttpPost]
public ActionResult ConvertHtmlToPdf(FormCollection collection)
{
    // Create a HTML to PDF converter object with default settings
    HtmlToPdfConverter htmlToPdfConverter = new HtmlToPdfConverter();

    // Set HTML Viewer width in pixels which is the equivalent in converter of the browser window width
    htmlToPdfConverter.HtmlViewerWidth = int.Parse(collection["htmlViewerWidthTextBox"]);

    // Set HTML viewer height in pixels to convert the top part of a HTML page 
    // Leave it not set to convert the entire HTML
    if (collection["htmlViewerHeightTextBox"].Length > 0)
        htmlToPdfConverter.HtmlViewerHeight = int.Parse(collection["htmlViewerHeightTextBox"]);

    // Set PDF page size which can be a predefined size like A4 or a custom size in points 
    // Leave it not set to have a default A4 PDF page
    htmlToPdfConverter.PdfDocumentOptions.PdfPageSize = SelectedPdfPageSize(collection["pdfPageSizeDropDownList"]);

    // Set PDF page orientation to Portrait or Landscape
    // Leave it not set to have a default Portrait orientation for PDF page
    htmlToPdfConverter.PdfDocumentOptions.PdfPageOrientation = SelectedPdfPageOrientation(collection["pdfPageOrientationDropDownList"]);

    // Set the maximum time in seconds to wait for HTML page to be loaded 
    // Leave it not set for a default 60 seconds maximum wait time
    htmlToPdfConverter.NavigationTimeout = int.Parse(collection["navigationTimeoutTextBox"]);

    // Set an adddional delay in seconds to wait for JavaScript or AJAX calls after page load completed
    // Set this property to 0 if you don't need to wait for such asynchcronous operations to finish
    if (collection["conversionDelayTextBox"].Length > 0)
        htmlToPdfConverter.ConversionDelay = int.Parse(collection["conversionDelayTextBox"]);

    string url = collection["urlTextBox"];

    // Convert the HTML page given by an URL to a PDF document in a memory buffer
    byte[] outPdfBuffer = htmlToPdfConverter.ConvertUrl(url);

    // Send the PDF file to browser
    FileResult fileResult = new FileContentResult(outPdfBuffer, "application/pdf");
    fileResult.FileDownloadName = "Getting_Started.pdf";

    return fileResult;
}