Winnovative PDF Chromium for .NET is a library that can be easily integrated into any type of .NET application to convert web pages and HTML strings to PDF or images.
The HTML to PDF converter component of the library uses a rendering engine based on Chromium, which can render all modern HTML, CSS and JavaScript content in compliance with the latest standards.
The converter combines the powerful, print-friendly PDF format with the flexibility of the HTML format into a modern tool for creating nicely formatted and easily maintainable PDF reports and documents.
The main functionality of the library is to convert HTML documents to PDF and images. But the library offers much more. You can automatically generate an outline with bookmarks for the generated PDF document, set permissions, password-protect, or digitally sign the output file.
The library targets .NET Standard 2.0, so it can be used in any .NET Core or .NET Framework application compatible with this standard.
The product can run natively on Windows and Linux 64-bit operating systems. There is a separate package for each platform, which includes the specific native runtime libraries alongside the shared .NET library.
The software is also fully compatible with Azure App Service and Azure Functions from Microsoft, on both Windows and Linux.
It is also compatible with Docker containers running on Windows and Linux, with example Dockerfiles available in dedicated sections of the documentation.
The documentation provides more details about compatibility and installation instructions for each supported platform.
The product is distributed as NuGet packages you can reference from NuGet.org. There are separate NuGet packages for Windows and Linux. The package for Windows is Winnovative.Pdf.Chromium.Windows and the package for Linux is Winnovative.Pdf.Chromium.Linux.
It takes only a few lines of code to convert a web page from a given URL or an HTML string to a PDF document:
At the top of your C# source file add the using Winnovative.Pdf.Chromium; statement to make the Winnovative PDF Chromium HTML to PDF API available in your .NET application.
// add this using statement at the top of your C# file
using Winnovative.Pdf.Chromium;
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 in your code where you want to run conversion
HtmlToPdfConverter converter = new HtmlToPdfConverter();
// convert an HTML string to a memory buffer
byte[] htmlToPdfBuffer = converter.ConvertHtml("<b>Hello World</b> from Winnovative PDF !", null);
// write the data from 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 date 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.winnovative-software.com";
byte[] urlToPdfBuffer = converter.ConvertUrl(htmlPageURL);
// write the data from the memory buffer to a PDF file
System.IO.File.WriteAllBytes("UrlToMemory.pdf", urlToPdfBuffer);
The documentation sections provide detailed instructions for getting started with Winnovative PDF Chromium for .NET on various platforms, such as Windows and Linux machines, as well as Azure App Service and Azure Functions, or Docker containers for both Windows and Linux.