 |
|
Winnovative Classic HTML to PDF Converter for .NET
|
|
Winnovative Classic HTML to PDF Converter for .NET can be used to convert HTML to PDF, images and SVG
in applications targeting .NET Framework, .NET Core and .NET Standard.
The Classic HTML to PDF Converter is built on a proven rendering engine that has demonstrated efficiency, reliability and stability
over many years of real-world use with a small footprint and low resource requirements.
It is well suited for environments where minimal space and compute usage are essential, even if it does not fully
support the very latest CSS or JavaScript features when compared to the
Winnovative PDF Next
converter.
The converter offers full support for HTML tags, CSS styles, SVG vector graphics, page breaks
control with CSS styles, automatically repeated HTML table header on each PDF page, live URLs and internal
links in PDF, automatically generated bookmarks, HTML in the headers and footers, Unicode and right to left
text, PDF merge, split and edit.
The library was designed and tested to work reliably in multithreaded environments
and to completely release all used resources after each conversion.
This makes it suitable for usage in high traffic websites and services running
a long period of time without interruption.
There are separate libraries for the .NET Framework and for modern .NET platforms running on Windows x64.
The library for the .NET Framework is compatible with .NET 2.0, .NET 4.0 and later runtimes.
The library for .NET was built for .NET Standard 2.0 and is compatible with platforms such as .NET 6, .NET 8 and .NET 10.
For applications that need to run on both Windows and Linux platforms, the
Winnovative Next HTML to PDF Converter for .NET
provides a newer and highly accurate rendering engine designed for modern HTML, CSS and JavaScript content.
The full
Winnovative PDF Next Library for .NET
can be used on Windows, Linux, Azure and Docker platforms to create, edit and merge PDF documents, convert HTML to PDF or images,
convert Word, Excel, RTF and Markdown to PDF, extract text and images from PDFs, search text in PDFs and convert PDF pages to images.
|
|
|
|
|
 |
|
Compatibility |
|
|
|
The compatibility list includes the following .NET versions, platforms and application types:
- .NET Framework 2.0, 3.5, 4.0 and above
- .NET 10, 9, 8, 7, 6 and .NET Standard 2.0
- Windows x64 platforms
- Azure Cloud Services and Azure Virtual Machines
- Web, Console and Desktop applications
|
|
| The new Winnovative PDF Next Library
can be used to convert HTML to PDF on both Windows and Linux platforms, including Azure App Service and Docker containers.
It also allows you to convert Word, Excel, RTF and Markdown to PDF, extract text and images from PDFs,
search text in PDFs and convert PDF pages to images.
|
|
 |
|
Software Download |
|
|
The evaluation package for Winnovative HTML to PDF Converter can be downloaded as a zip archive containing the
product libraries and sample projects compatible with .NET Framework 2.0, 3.5, 4.0 and above, .NET 10, 9, 8, 7, 6 and .NET Standard 2.0
on Windows x64 platforms.
|
|
|
|
|
Winnovative HTML to PDF converter library is also available as a
NuGet package
that can be referenced in your .NET projects.
|
|
 |
|
Getting Started |
|
|
|
You can quickly start with the demo applications from the Samples folder of the downloaded package or you can integrate the library in your own project.
To start with your own project, first add a reference to library.
In projects targeting the .NET Framework platform you can reference directly the WnvHtmlToPdf.dll assembly from root folder of the ZIP package for .NET Framework or alternatively the
Winnovative.HtmlToPdf
NuGet packages.
In projects targeting the .NET Core platform you can reference the
Winnovative.HtmlToPdf NuGet package
or alternatively the WnvHtmlToPdf_NetCore.dll from the Bin folder of the ZIP package for .NET core, but in this case you also have to manually reference the Winnovative.HtmlToPdf.NetCore package dependencies.
After the reference to library was added to your project you are now ready to start writing code to convert HTML to PDF in your .NET application
|
|
 |
|
C# Code Samples |
|
|
|
Copy the C# code lines from the section below to use the HTML to PDF Converter component to create a PDF document from a web page or from a HTML string and save
the resulted PDF to a memory buffer for further processing, to a PDF file or send it to browser for download in ASP.NET applications.
|
|
At the top of your C# source file add the using Winnovative; statement to make available the Winnovative HTML to PDF Converter API for your .NET application.
|
|
// add this using statement at the top of your C# file
using Winnovative;
|
|
|
To convert a HTML string or an URL to a PDF 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 the HTML string to a PDF file
converter.ConvertHtmlToFile("<b>Hello World</b> from Winnovative !", null, "HtmlToFile.pdf");
// convert HTML page from URL to a PDF file
string htmlPageURL = "http://www.winnovative-software.com";
converter.ConvertUrlToFile(htmlPageURL, "UrlToFile.pdf");
|
|
|
To convert a HTML string or an URL to a PDF document in a memory buffer and then save it to 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);
// 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 and ASP.NET MVC applications 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;
|
|
|
To convert in your ASP.NET Web Forms application a HTML string 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);
HttpResponse httpResponse = HttpContext.Current.Response;
httpResponse.AddHeader("Content-Type", "application/pdf");
httpResponse.AddHeader("Content-Disposition",
String.Format("attachment; filename=HtmlToPdf.pdf; size={0}",
htmlToPdfBuffer.Length.ToString()));
httpResponse.BinaryWrite(htmlToPdfBuffer);
httpResponse.End();
|
|
|
|
HTML to PDF Converter Features
|
|
|
|
|