EvoPdf Chromium for .NET is a library that can be easily integrated into any type of .NET application to convert web pages and HTML strings into PDF documents or image formats on Windows platforms.
The HTML to PDF converter component uses a rendering engine based on Chromium, capable of rendering modern HTML, CSS and JavaScript content in compliance with current web standards.
EvoPdf Chromium for .NET can run natively on 64-bit Windows operating systems. The product runtime is compatible with Windows 10, Windows Server 2016 and later versions of the Windows 64-bit OS.
The .NET library targets the .NET Standard 2.0 and therefore it can be used in any .NET Core or .NET Framework application that is compatible with this standard.
The product can run on Windows without installing anything and without any prior configuration of the operating system. The steps necessary to use the library in your own application are detailed below.
The software is also fully compatible with Azure App Service and Azure Functions on Windows and installation instructions for these platforms can be found in separate documentation sections.
Create a new .NET project in Visual Studio and use the NuGet Package Manager from Visual Studio to add a reference to the EvoPdf.Chromium.Windows package from NuGet.
After the NuGet package has been installed, add the using EvoPdf.Chromium; directive at the top of your C# source file to include the EvoPdf.Chromium namespace and make the library API available.
// add this using statement at the top of your C# file
using EvoPdf.Chromium;
You are now ready to use the library to convert web pages and HTML code to PDF or to an image using EvoPdf Chromium for .NET on Windows.
With the code below, you can convert an HTML string to a PDF document in a memory buffer and then save the data from the buffer to a file.
// create the converter object where you want to perform the conversion
HtmlToPdfConverter converter = new HtmlToPdfConverter();
// convert an HTML string to a memory buffer
byte[] htmlToPdfBuffer = converter.ConvertHtml("<b>Hello World</b> from EVO PDF !", null);
// write the memory buffer to a PDF file
System.IO.File.WriteAllBytes("HtmlToMemory.pdf", htmlToPdfBuffer);
With the code below, you can convert a URL to a PDF document in a memory buffer and then save the the data from the buffer to a file. The URL can also be a local file path prefixed with the "file://" URI scheme.
// create the converter object where you want to perform the conversion
HtmlToPdfConverter converter = new HtmlToPdfConverter();
// convert a URL to a memory buffer
string htmlPageURL = "http://www.evopdf.com";
byte[] urlToPdfBuffer = converter.ConvertUrl(htmlPageURL);
// write the memory buffer to a PDF file
System.IO.File.WriteAllBytes("UrlToMemory.pdf", urlToPdfBuffer);
With the code below, you can convert an HTML string to a PDF document in an ASP.NET Core application, store it in a memory buffer and then send it to the browser for download.
// create the converter object where you want to perform the conversion
HtmlToPdfConverter converter = new HtmlToPdfConverter();
// convert an HTML string to a memory buffer
byte[] htmlToPdfBuffer = converter.ConvertHtml("<b>Hello World</b> from EVO PDF !", null);
FileResult fileResult = new FileContentResult(htmlToPdfBuffer, "application/pdf");
fileResult.FileDownloadName = "HtmlToPdf.pdf";
return fileResult;
With the code below, you can convert a URL to a PDF document in an ASP.NET Core application, store it in a memory buffer and then send it to the browser for download. The URL can also be a local file path prefixed with the "file://" URI scheme.
// create the converter object where you want to perform the conversion
HtmlToPdfConverter converter = new HtmlToPdfConverter();
// convert a URL to a memory buffer
string htmlPageURL = "http://www.evopdf.com";
byte[] urlToPdfBuffer = converter.ConvertUrl(htmlPageURL);
FileResult fileResult = new FileContentResult(urlToPdfBuffer, "application/pdf");
fileResult.FileDownloadName = "UrlToPdf.pdf";
return fileResult;
At this point, everything should be configured and you can now run your application. Alternatively, you can follow the same instructions in this document to build and publish the ASP.NET demo application on Windows.