EvoPdf Chromium Library for .NET
EvoPdf Chromium for .NET is a library that can be easily integrated into any type of .NET application to convert HTML to PDF, HTML to Image and Word to PDF. It can be used in .NET applications targeting .NET Standard, .NET Core and .NET Framework on Windows, Linux and Azure platforms.
The HTML to PDF converter component of the library uses a rendering engine based on Chromium, which can render all cutting-edge, modern HTML, CSS and JavaScript content in conformance with the latest standards and technologies currently available.
|
|
|
|
|
EvoPdf Chromium HTML to PDF
|
for .NET |
|
|
|
EvoPdf Chromium HTML to PDF for .NET integrates a new rendering engine enabling the conversion of all modern HTML, CSS and JavaScript content in conformance with the latest standards and technologies currently available.
The library can run on various Windows and Linux platforms and is compatible with Azure App Service and Azure Functions for both Windows and Linux.
The product is bundled and distributed as two separate NuGet packages for Windows and Linux including the same .NET Standard 2.0 library and different native runtimes. Targeting .NET Standard 2.0, makes the packages compatible with a large spectrum of .NET Core and .NET Framework versions.
The main functionality of the library is to convert HTML to PDF, HTML to image and Word (DOCX) to PDF. However, the library offers much more. You can automatically generate a PDF document outline and table of contents, set permissions, password-protect or digitally sign the generated PDF document.
|
|
|
|
|
|
|
 |
|
Main Features |
|
|
- Convert HTML with CSS, Web Fonts and JavaScript to PDF
- Support modern web standards and technologies
- Add page numbering in PDF headers and footers from HTML
- Repeat HTML table headers and footers in PDF pages
- Control PDF page breaks with CSS in HTML
- Create outlines and tables of contents from heading tags
- Convert specific HTML regions
- Retrieve HTML element positions in the PDF
|
|
- Create tagged PDFs for accessibility
- Trigger conversion automatically or manually
- Render for screen or print media types
- Set PDF security, viewer settings and signatures
- Set HTTP headers and cookies
- Use GET and POST requests
- Convert HTML to JPEG, PNG and WEBP images
- Convert Word DOCX to PDF
|
|
|
 |
|
Compatibility |
|
|
- Windows 10, Windows Server 2016 64-bit and above
- Linux 64-bit Distributions
- .NET Core 9.0, 8.0, 7.0, 6.0, 5.0, .NET Standard 2.0
- .NET Framework 4.6.2 to 4.8.1
|
|
- Azure App Service and Azure Functions
- Azure Windows Cloud Services and Virtual Machines
- Web, Console and Desktop applications
- Docker Containers for Windows and Linux
|
|
|
 |
|
NuGet Packages for Windows and Linux |
|
|
EvoPdf Chromium for .NET binaries are bundled and distributed in NuGet packages and there are separate NuGet packages for Windows and Linux platforms.
They include the same .NET Standard 2.0 library, but different native runtimes.
The NuGet package for Windows is EvoPdf.Chromium.Windows
and the NuGet package for Linux is EvoPdf.Chromium.Linux.
The demo application for ASP.NET you can download from the section below references these packages.
|
|
 |
|
ASP.NET C# Demo Application |
|
|
The ZIP package you can download from the link below includes a Visual Studio project for the ASP.NET Core demo application with C# sample code for all major library features.
The two folders for Windows and Linux include the same application, the only difference is the NuGet package referenced by each of them.
|
|
|
|
On Windows, you can run the demo application from this package without any special setup.
On Linux, before running the demo application, you should first follow the steps from
online documentation
to setup the Linux machine.
|
|
 |
|
Getting Started |
|
|
You can quickly start with the ASP.NET demo application available for download, or you can integrate the library in your own project.
In the online documentation
you can find detailed instructions about running an application using EvoPdf Chromium Library for .NET on Windows and Linux machines, in Azure App Service and Azure Functions for Windows and Linux.
In general, the application deployment on Windows platforms does not require any setup while deployment on Linux platforms requires the additional configuration described in documentation.
|
|
 |
|
C# Code Samples |
|
At the top of your C# source file add the using EvoPdf.Chromium; statement to make available the EvoPdf Chromium API for your .NET application.
|
|
// add this using statement at the top of your C# file
using EvoPdf.Chromium;
|
|
To convert a HTML string to a PDF document in a memory buffer and then save the data from buffer into a file you can use the C# code below.
|
|
// create the converter object in your code where you want to run conversion
HtmlToPdfConverter converter = new HtmlToPdfConverter();
// convert a 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);
|
|
To convert an URL to a PDF document in a memory buffer and then save the data from buffer into a file you can use the C# code below.
|
|
// create the converter object in your code where you want to run conversion
HtmlToPdfConverter converter = new HtmlToPdfConverter();
// convert an 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);
|
|
To convert in your ASP.NET Core application a HTML string or an URL to a PDF document in a memory buffer and then send it for download to browser you can use the C# code below.
|
|
// create the converter object in your code where you want to run conversion
HtmlToPdfConverter converter = new HtmlToPdfConverter();
// convert a 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;
|
To convert in your ASP.NET Core application a Word file to a PDF document in a memory buffer and then send it for download to browser you can use the C# code below.
|
|
// create the Word to PDF converter object
WordToPdfConverter converter = new WordToPdfConverter();
// convert a Word file to a memory buffer
byte[] wordToPdfBuffer = converter.ConvertToPdf("path/to/your/document.docx");
// return PDF file as a downloadable response
FileResult fileResult = new FileContentResult(wordToPdfBuffer, "application/pdf");
fileResult.FileDownloadName = "WordToPdf.pdf";
return fileResult;
|
|