|
Winnovative Next HTML to PDF Converter for .NET
is a core component of the Winnovative PDF Next Library for .NET, using an advanced,
highly accurate and reliable Chromium-based rendering engine that processes modern HTML, CSS and JavaScript content in
compliance with the latest standards.
The converter targets .NET Standard 2.0 and can be used in .NET Core and .NET Framework applications that you can deploy
on Windows and Linux platforms, including Azure App Service and Functions or Docker.
The main functionality of the component is to convert HTML to PDF, HTML to image and SVG to PDF, but it 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 SVG to PDF
-
Asynchronous methods that can be used with async and await
|
|
|
|
|
Compatibility
|
|
|
-
Windows 10, 11 and Windows Server 2016 to 2025
-
Linux 64-bit distributions
-
.NET 10.0, 9.0, 8.0, 7.0, 6.0, .NET Standard 2.0
-
.NET Framework 4.6.2 to 4.8.1
|
|
-
Azure App Service and Azure Functions
-
Azure Cloud Services and Virtual Machines
-
Web, console and desktop applications
-
Docker containers for Windows and Linux
|
|
|
 |
|
Getting Started
|
|
|
|
You can quickly get started with the ASP.NET demo application available for download, or you can integrate the library into your own project.
The online documentation,
contains detailed instructions on how to run an application using Winnovative PDF Next Library for .NET on Windows and Linux machines, Azure App Service
and Azure Functions for Windows and Linux.
You can view the current capabilities of the library by checking the
online demo
application and the API reference in the online documentation.
|
|
 |
|
Download Demo Application |
|
|
|
The ZIP package available for download from the link below includes an ASP.NET demo application project with complete C# source code covering all major library features.
|
|
|
|
|
|
Running the samples in the demo application that involve HTML to PDF conversion features on Linux platforms might require installing some dependency packages. The documentation includes an entire section dedicated to building, publishing and running the demo application on multiple platforms.
|
|
 |
|
NuGet Packages
|
|
|
|
For Windows deployments add a reference to the
Winnovative.Pdf.Next.HtmlToPdf.Windows
NuGet Package and for Linux deployments add a reference to the
Winnovative.Pdf.Next.HtmlToPdf.Linux
NuGet Package.
The package for Windows is referenced by the
Winnovative.Pdf.Next.Windows
metapackage for all components and the package for Linux is referenced by the
Winnovative.Pdf.Next.Linux
metapackage for all components.
There are also multiplatform metapackages that reference both the Windows and Linux HTML to PDF packages:
Winnovative.Pdf.Next.HtmlToPdf
for the HTML to PDF functionality and
Winnovative.Pdf.Next
for the entire Winnovative PDF Next library.
|
|
 |
|
Installation
|
|
|
|
The HTML to PDF Converter component uses a platform specific runtime.
On Windows platforms, the runtime generally does not require the installation of additional dependencies.
On Linux platforms installing some dependency packages might be necessary, depending on the exact version of Linux you are using.
In online documentation in
the Getting Started and Publish guides you can find instructions about Linux dependencies installation on a variety of Linux platforms.
|
|
 |
|
Winnovative.Pdf.Next Namespace
|
|
|
|
All components of the Winnovative PDF Next for .NET library share the same
Winnovative.Pdf.Next
namespace and can be used together in the same application.
To use the library in your own code, add the using directive at the top of your C# source file, as shown below.
|
|
// add this using statement at the top of your C# file
using Winnovative.Pdf.Next;
|
|
 |
|
C# Code Samples |
|
|
|
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 Winnovative !", 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.winnovative-software.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 Winnovative !", null);
FileResult fileResult = new FileContentResult(htmlToPdfBuffer, "application/pdf");
fileResult.FileDownloadName = "HtmlToPdf.pdf";
return fileResult;
|