How to Convert HTML to PDF with EVO HTML to PDF Converter for .NET
In this article, we will show you how to use EVO HTML to PDF Converter for .NET to convert a HTML page from an URL or a HTML string to a PDF document. You will need a licence key to use the library, which you can obtain from the official website.[^1^]
Step 1: Install the library
You can install the library using NuGet Package Manager or by downloading the ZIP package from the download page.[^1^]
If you use NuGet, you can run the following command in the Package Manager Console:
If you download the ZIP package, you need to extract it and copy the EVO HTML to PDF Converter assembly (EvoHtmlToPdf.NetCore.dll) to your project's bin folder.
Step 2: Add a reference to the library
In your project, you need to add a reference to the EVO HTML to PDF Converter assembly (EvoHtmlToPdf.NetCore.dll). You can do this by right-clicking on your project in Solution Explorer and selecting Add -> Reference -> Browse -> EvoHtmlToPdf.NetCore.dll.
Step 3: Set the licence key
Before you can use the library, you need to set the licence key that you obtained from the official website.[^1^] You can do this by calling the SetLicenseKey method of the HtmlToPdfConverter class:
// create a HTML to PDF converter object
HtmlToPdfConverter htmlToPdfConverter = new HtmlToPdfConverter();
Now you are ready to convert HTML to PDF using the ConvertUrl or ConvertHtml methods of the HtmlToPdfConverter class. The ConvertUrl method takes an URL of a web page as a parameter and returns a PdfDocument object that represents the converted PDF document. The ConvertHtml method takes a HTML string as a parameter and returns a PdfDocument object that represents the converted PDF document.
In this article, we have shown you how to use EVO HTML to PDF Converter for .NET to convert web pages, HTML strings and streams to PDF or to image formats. You can find more information about the library and its features on the official website.[^1^] You can also download a fully functional trial version with C# and VB.NET samples for ASP.NET and Windows Forms from 061ffe29dd