|
|
Winnovative HTML to PDF Converter for .NET
|
|
Winnovative HTML to PDF Converter library for .NET can be easily integrated in your .NET and .NET Core applications,
including ASP.NET web sites, desktop applications, Azure Cloud services to convert HTML pages and HTML strings to PDF documents,
raster images or SVG vector images.
The HTML to PDF Converter for .NET The library does not rely on external tools or
services and does not require installation or server configuration changes, supporting
simple copy deployment.
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.
There are separate libraries and downloadable ZIP packages for .NET Framework and for .NET Core platforms.
The library for .NET Framework is compatible with .NET 2.0 and .NET 4.0 and the later runtimes.
The library for .NET Core was built for .NET Standard 2.0 and is compatible with .NET Core 2.0, .NET Core 3.1, .NET Core 6.0 and later.
The libraries for .NET and .NET Core are compatible with Windows platforms. In .NET applications for Linux, macOS, Windows, Azure App Service,
Xamarin, UWP and other platforms you can use the
Cross-Platform PDF Library for .NET
which includes the HTML to PDF, Word to PDF, Excel to PDF, PDF to Text, PDF to Image, PDF to HTML and PDF Images Extractor components
from Winnovative PDF Toolkit PRO in a single library under an unique namespace.
The HTML to PDF Converter is not based on any external tools and no special settings
are necessary on the server in order to get it working.
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.
The licensing model is simple and flexible. A purchased license never expires, is royalties free and it includes
free technical support and software update for the first year from purchase date.
|
|
|
|
|
|
|
Compatibility |
|
|
Winnovative HTML to PDF Converter for .NET is compatible with any platform which supports .NET Standard 2.0 and above or .NET Framework 4.0 and above, including:
- .NET Core 8, 7, 6, 5, .NET Standard 2.0 (and above)
- .NET Framework 4.8.1, 4.7.2, 4.6.1, 4.0 (and above)
- Windows 32-bit (x86) and 64-bit (x64)
- Azure Cloud Services and Azure Virtual Machines
- Web, Console and Desktop applications
|
|
For Linux, macOS, Windows, Azure App Service,
Xamarin, UWP and other platforms you can use the
Cross-Platform PDF Library for .NET
which includes the HTML to PDF, Word to PDF, Excel to PDF, PDF to Text, PDF to Image, PDF to HTML and PDF Images Extractor components
from Winnovative PDF Toolkit PRO in a single library under an unique namespace.
|
|
|
|
Software Download |
|
|
Winnovative HTML to PDF Converter for .NET is distributed as Zip archive and the software does not need installation.
You can simply extract the archive into a folder and reference the .NET assembly in your project.
You can see the latest new features and chages in Release Notes.
When you download the software you implicitly agree with the terms and conditions from this
End User License Agreement. Please read carefully this agreement before downloading the software on your computer.
|
|
|
|
|
|
On Windows 7 and later, after you have extracted the files from the archive, make
sure the product binaries and documentation files (the .dll
, .dat and .chm files) were not blocked by Windows.
Open the file Properties in Windows Explorer and if there is an 'Unblock' button click on
it to unblock the file.
|
|
The general version of the HTML to PDF Converter Library for .NET taht you can download from the link above works well both on 32-bit and 64-bit environments.
The 64-bit environments offers more memory for the executing processes and the version below is optimized to take advantage of this opportunity when converting very large HTML documents:
|
|
|
|
|
|
The version optimized for 64-bit systems works only on 64-bit systems and it cannot be used on 32-bit systems.
|
|
Winnovative HTML to PDF Converter
NuGet package can be downloaded and managed
directly from your Visual Studio project. NuGet is a Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects that use the .NET Framework.
|
|
|
|
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.NetCore 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
|
|
|
|