EVO HTML to PDF Library for .NET
================================

EVO HTML to PDF Library for .NET (Classic) can be used in .NET Framework, .NET Core and .NET Standard applications to convert HTML to PDF, images and SVG.

The library can also be used to create new PDF documents, to edit, merge, split and fill existing PDF documents.

This package is compatible with .NET Framework, .NET Core and .NET Standard 2.0 on Windows platforms.

You can find documentation and code samples at: https://www.evopdf.com/evopdf-html-to-pdf-dotnet

For applications that need to run on both Windows and Linux platforms, the EvoPdf.Next.HtmlToPdf package provides a newer and highly accurate rendering engine designed for modern HTML, CSS and JavaScript content.

The full EvoPdf.Next package allows you to create, edit and merge PDF documents, convert HTML to PDF or images, convert Word, Excel, RTF and Markdown to PDF, convert PDF to text or images.

Main Features
=============

* Create PDF documents from HTML with advanced support for CSS3, SVG, Web Fonts and JavaScript
* Automatically create PDF links, forms, bookmarks and table of contents from HTML tags
* Place the content from multiple HTML documents at any position in PDF pages, headers or footers
* Create JPEG, PNG and Bitmap raster images from HTML documents
* Create high-quality SVG vector images from HTML documents
* Create PDF documents with text, graphics, images, headers and footers
* Create PDF documents with security features and digital signatures
* Create interactive PDF documents with forms, internal links, text notes and JavaScript actions
* Edit, stamp, merge and split PDF documents

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
* .NET Standard 2.0
* Windows platforms
* Azure Cloud Services and Azure Virtual Machines
* Web, Console and Desktop applications

Getting Started
===============

You can quickly start with the demo applications from the Samples folder of this package or you can integrate the library into your own project.

Reference the Library in .NET Framework Projects
------------------------------------------------

In your .NET Framework project add a reference to the evohtmltopdf.dll assembly from the Lib/net40 folder of this package or to the EvoPdf.HtmlToPdf NuGet package.

Reference the Library in .NET Core Projects
-------------------------------------------

In your .NET Core project add a reference to the EvoPdf.HtmlToPdf NuGet package.

Alternatively you can reference the EvoHtmlToPdf_NetCore.dll library directly from the Lib/netstandard2.0 folder of this package, but in this case you also have to manually reference the dependencies of the EvoPdf.HtmlToPdf package for .NET Standard 2.0.

After the reference to the library was added to your project you are now ready to start writing code to convert HTML to PDF in your .NET application.
You can copy the C# code lines from the section below to create a PDF document from a web page or from an HTML string and save the resulting PDF to a memory buffer for further processing, to a PDF file or send it to the browser for download in ASP.NET applications.

C# Code Samples
---------------

At the top of your C# source file add the 'using EvoPdf;' statement to make available the EVO HTML to PDF API for your .NET application.

    // add this using statement at the top of your C# file
    using EvoPdf;

To convert an HTML string or a 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 EVO PDF !", null, "HtmlToFile.pdf");
    
    // convert HTML page from URL to a PDF file
    string htmlPageURL = "https://www.evopdf.com";
    converter.ConvertUrlToFile(htmlPageURL, "UrlToFile.pdf");

To convert an HTML string or a 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 an HTML string to a memory buffer
    byte[] htmlToPdfBuffer = converter.ConvertHtml("<b>Hello World</b> from EVO PDF !", null);
    
    // write the memory buffer to a PDF file
    System.IO.File.WriteAllBytes("HtmlToMemory.pdf", htmlToPdfBuffer);
    
    // convert a URL to a memory buffer
    string htmlPageURL = "https://www.evopdf.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 MVC application for .NET Framework an HTML string or a 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 an HTML string to a memory buffer
    byte[] htmlToPdfBuffer = converter.ConvertHtml("<b>Hello World</b> from EVO PDF !", null);
    
    FileResult fileResult = new FileContentResult(htmlToPdfBuffer, "application/pdf");
    fileResult.FileDownloadName = "HtmlToPdf.pdf";
    return fileResult;

To convert in your ASP.NET Web Forms application for .NET Framework an 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 an HTML string to a memory buffer
    byte[] htmlToPdfBuffer = converter.ConvertHtml("<b>Hello World</b> from EVO PDF !", 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();

To convert in your ASP.NET Core application an HTML string or a URL to a PDF document in a memory buffer and then send it for download to the 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 an HTML string to a memory buffer
    byte[] htmlToPdfBuffer = converter.ConvertHtml("<b>Hello World</b> from EVO PDF !", null);

    FileResult fileResult = new FileContentResult(htmlToPdfBuffer, "application/pdf");
    fileResult.FileDownloadName = "HtmlToPdf.pdf";
    return fileResult;

Free Trial
==========

The evaluation package for .NET contains the product binaries and demo web, desktop and console projects with full C# code for .NET Framework and .NET Core.

You can evaluate the library for free as long as it is needed to ensure that the solution fits your application needs.

Licensing
=========

The EVO PDF Software licenses are perpetual which means they never expire for a version of the product and include free maintenance for the first year. You can find more details about licensing on https://www.evopdf.com/buy page of the website.

Support
=======

For technical and sales questions or for general inquiries about our software and company you can contact us using the email addresses from https://www.evopdf.com/contact page of the website.

