Home Contact
Skip Navigation Links

Convert HTML to PDF in your .NET Core Applications

EVO HTML to PDF Converter for .NET Coreoffers full support for HTML tags, CSS styles, SVG vector graphics, Canvas, Web Fonts, JavaScript, page breaks control with CSS styles, repeating HTML table header and footer in PDF pages, live URLs and internal links in PDF, automatically generated hierarchical bookmarks and table of contents, HTML in the headers and footers. The library is much more than a HTML to PDF converter. You can also use it to easily merge, edit and fill existing PDF documents.

.NET Core Logo
EVO HTML to PDF Converter
for .NET Core

EVO HTML to PDF Converter library for .NET Core can be easily integrated in .NET Core applications to convert HTML documents to PDF, raster images or SVG vector images. The library is a powerful tool helping you to instantly create nicely formatted and easily maintainable PDF reports directly from existing HTML reports.

The converter offers full support for HTML5, CSS3, JavaScript, SVG, web fonts, page breaks control with CSS and from API, automatically repeated HTML table header and footer, live URLs and internal links, automatically generated hierarchical bookmarks and table of contents, automatically generated fillable PDF forms and allows you to digitally sign and password protect the generated PDF documents.

The library was designed and tested to work reliably in multithreaded environments which makes it ideal for usage in high traffic websites and services.

EVO HTML to PDF .NET Core Client Live Demo Live Demo
Download Download
API Reference API Reference
Support Support
Download Icon Software Download

EVO HTML to PDF Converter for .NET Core is distributed in a Zip archive. You can follow the link below to download the software. The Zip archive contains the client library you can use in your .NET Core applications, the HTML to PDF Server for Windows and for Azure and a demo application.

Download HTML to PDF Converter v8.0 Client for .NET Core
The HTML to PDF converter client library for .NET Core is also available as a NuGet Logo ImageNuGet package that can referenced directly from your Visual Studio project.
Install Icon Software Installation

In order to use the EVO HTML to PDF Converter for .NET Core you first have to install the EVO HTML to PDF Server. The server was built on .NET library to extend its capabilities to other platforms and languages. The client library that you link in your .NET Core applications will connect to the server to convert HTML to PDF, to Image or to SVG.

EVO HTML to PDF Converter Server can run either in a Windows Service on a Windows machine or in an Azure Cloud. You can find detailed installation and uninstallation instructions in the Readme.txt file from the root of the downloaded package.

Code Sample Icon .NET Core Code Sample

The EVO HTML to PDF Converter for .NET Core API allows you to convert a HTML document to PDF in just a few lines a code. The programming interface is also very rich and allows you customize the generated PDF document in various ways. The code below is copied from the demo for HTML to PDF Converter that you can find the in the Demo folder of the software Zip package.

[HttpPost]
public ActionResult ConvertHtmlToPdf(IFormCollection collection)
{
    // Get the server IP and port
    String serverIP = collection["textBoxServerIP"];
    uint serverPort = uint.Parse(collection["textBoxServerPort"]);

    // Create a HTML to PDF converter object
    HtmlToPdfConverter htmlToPdfConverter = null;
    if (collection["ServerType"] == "radioButtonUseTcpService")
        htmlToPdfConverter = new HtmlToPdfConverter(serverIP, serverPort);
    else
        htmlToPdfConverter = new HtmlToPdfConverter(true, collection["textBoxWebServiceUrl"]);

    // Set optional service password
    if (collection["textBoxServicePassword"][0].Length > 0)
        htmlToPdfConverter.ServicePassword = collection["textBoxServicePassword"];

    // Set license key received after purchase to use the converter in licensed mode
    // Leave it not set to use the converter in demo mode
    htmlToPdfConverter.LicenseKey = "4W9+bn19bn5ue2B+bn1/YH98YHd3d3c=";

    // 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"][0].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"][0].Length > 0)
        htmlToPdfConverter.ConversionDelay = int.Parse(collection["conversionDelayTextBox"]);

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

    if (collection["HtmlPageSource"] == "convertUrlRadioButton")
    {

        string url = collection["urlTextBox"];

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

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

    // Send the PDF file to browser
    FileResult fileResult = new FileContentResult(outPdfBuffer, "application/pdf");
    if (collection["openInlineCheckBox"].Count == 0)
    {
        // send as attachment
        fileResult.FileDownloadName = "Getting_Started.pdf";
    }

    return fileResult;
}