EvoPdf Next – HTML to PDF Converter for .NET
Quick start · HTML to PDF in .NET

Convert HTML to PDF in .NET in three lines of C#

EvoPdf Next renders HTML, CSS and JavaScript to PDF with a Chromium-based engine packaged as a .NET library. It runs on Windows, Linux and macOS, in web, console and desktop applications, in Docker containers and in Azure, AWS and Google Cloud. It produces PDF/UA and PDF/A documents directly from your HTML. Add the package, paste the code and you have a PDF.

Version 14.86.1. Evaluate without registration; the demo output is watermarked until you set a license key. Perpetual licenses from 450 USD. Every license covers any number of developers.

Everything about the HTML to PDF converter · C# guide, step by step · Documentation · Samples on GitHub

ConsoleCLI
dotnet add package EvoPdf.Next.HtmlToPdf.Windows

Windows package shown. EvoPdf.Next.HtmlToPdf.Linux and EvoPdf.Next.HtmlToPdf.MacOS work the same way.

Program.csC#
using EvoPdf.Next;

// a web page, by URL
var converter = new HtmlToPdfConverter();
byte[] pdf = converter.ConvertUrl("https://www.evopdf.com");
File.WriteAllBytes("page.pdf", pdf);

// an HTML string, with its base URL
converter = new HtmlToPdfConverter();
pdf = converter.ConvertHtml("<b>Hello</b>",
    "https://www.evopdf.com");
File.WriteAllBytes("string.pdf", pdf);
That's all the code you need to turn a fully styled web page into a PDF. Convert your own HTML in the online demo →
  • Windows 10 / 11 / Server 2016–2025, x64 and ARM64
  • Linux 64-bit, x64 and ARM64
  • macOS 12+ on Apple Silicon
  • .NET 6 → 10, .NET Standard 2.0
  • .NET Framework 4.6.2 – 4.8.1
  • Azure, AWS and Google Cloud · Docker and Kubernetes
Shipping since 2010 · 15+ years in production at
Microsoft Intel Siemens Boeing VISA HP Philips FedEx Stack Exchange PwC Deloitte JP Morgan
See more customers →
What you get

Chromium rendering, PDF/UA and PDF/A output

Rendered by an integrated Chromium engine

HTML5, CSS3, JavaScript, web fonts and SVG render exactly as they do in the browser, with screen or print media, JavaScript executed and asynchronous content awaited. The engine is a Chromium rendering engine shipped inside the package and integrated with the library, not a Chrome executable driven over a debugging port.

PDF/UA and PDF/A from the HTML

Tagged, accessible PDF/UA documents and archival PDF/A documents generated from the HTML structure and checked with validators. Headers and footers written in HTML, page numbers, bookmarks and tables of contents built from the headings. Generate a PDF/UA document from your HTML in the online demo →

Built for servers

Conversions run in parallel, each document in its own private browser. One setting controls how many run at once and the memory per conversion is known. Thousands of conversions in a row end with the same footprint as the first hundred, with the disk quiet under any load. It asks little of the host, so it converts inside a Windows Azure App Service worker and on machines with no outbound internet access.

One API on every platform

The same code on Windows, Linux and macOS, x64 and ARM64, from .NET Framework 4.6.2 to .NET 10. In a web application it is the same three lines: an ASP.NET Core controller, a Razor Page handler or a Minimal API endpoint returns the byte array as a file. Deployment guides for Azure, AWS, Google Cloud, Docker and Kubernetes, with Dockerfiles ready to build.

ASP.NET Core and ASP.NET MVC

Export an MVC view or a Razor page to PDF

The view the user sees, as a PDF

An action converts the URL of any view of the application and returns the PDF as a file. The cookies of the request travel with the conversion, so a view behind a login renders with the data of the signed-in user. The same code works in an MVC controller, a Razor Page handler, a Minimal API endpoint and a Blazor Server application. On .NET Framework 4.6.2 and later it works in ASP.NET MVC and Web Forms; for a view that needs the session, render it to a string and call ConvertHtml.

To convert HTML the application already has in memory, for example a view rendered to a string, call ConvertHtml with the HTML and a base URL for its images and style sheets. Convert the current page in the online demo →

public IActionResult InvoicePdf(int id)
{
    // the Razor view of the invoice, by its URL
    string url = Url.Action("Invoice", "Orders",
        new { id }, Request.Scheme);

    var converter = new HtmlToPdfConverter();

    // the session of the user, for views behind a login
    // Request.Cookies holds decoded values, so encode them again
    var cookies = converter.HttpRequestCookies;
    foreach (var cookie in Request.Cookies)
        cookies.Add(cookie.Key, Uri.EscapeDataString(cookie.Value));

    byte[] pdf = converter.ConvertUrl(url);
    return File(pdf, "application/pdf", "invoice.pdf");
}
Beyond the conversion

Electronic invoices, digital signatures and the cloud

Electronic invoices from the same HTML

The converter embeds a ZUGFeRD, Factur-X, XRechnung or Order-X XML in the PDF/A-3 document it generates, with the metadata the standard prescribes, from the MINIMUM to the EXTENDED and XRECHNUNG profiles. With PDF/UA-1 the invoice is also accessible. Try it in the demo →

PAdES digital signatures

Sign the generated PDF with a PFX file, with a certificate whose key stays in the Windows store, on a smartcard or a token, or through a hardware security module or a cloud key service. B-B needs no external service, B-T a timestamp server, B-LT and B-LTA add the validation data. Signature fields are created where your HTML marks them, one per signer, each signed later by name. Documentation →

Runs where your application runs

Azure App Service, Functions, Container Apps and AKS; AWS Elastic Beanstalk, Lambda, ECS on Fargate and EKS; Google Cloud Run and GKE; Docker on Linux and Windows. Each has a step-by-step guide with the Dockerfile, the commands and the resources to allocate, and the regular packages run on all of them.

More in the same package

Word, Excel, RTF and Markdown to PDF, PDF to text and to images, a PDF editor that merges, stamps, signs and protects existing documents and HTML to PNG, JPEG or WebP, all under the EvoPdf.Next namespace with one license key. All components →

Licensing

Perpetual licenses, with a year of updates and support

The HTML to PDF license covers the converter, Next and Classic. After purchase you receive a license key by email. Set it in your code and the demo stamps disappear.

Deployment License

450 USD HTML to PDF
650 USD EVO PDF Toolkit, all components
One application on one server, for any number of developers
  • For your own application, not for applications you distribute to customers
  • Updates and standard support for the first year
Buy Deployment License

Company License

1200 USD HTML to PDF
1400 USD EVO PDF Toolkit, all components
Unlimited developers, applications and servers
  • Redistribute inside your own applications to your customers, at no extra cost
  • Updates and priority support for the first year
Buy Company License
Next steps

Convert your own HTML in the online demo

The online demo is the ASP.NET application you download, running on our servers, with the source code of every demo in the documentation. The product page describes every feature of the converter, the packages for each platform and the deployment options.

Replacing another converter? wkhtmltopdf option by option or EvoPdf Classic to Next.