ExpertPdf Anywhere v22.0.0

Cross-platform HTML to PDF for .NET

Convert web pages, HTML strings and HTML files to PDF from C# and VB.NET on Windows, Linux and macOS, in Docker containers and in the cloud. Chromium, the engine of the Chrome browser, renders HTML5, CSS3, web fonts and JavaScript, and the PDF keeps the look of the page, with selectable text, live links and embedded fonts.

The HTML to PDF converter is part of ExpertPdf Anywhere, the .NET library with every ExpertPdf tool. The engine ships in the NuGet packages: nothing to install on the server, no system packages on Linux.

NuGet · ExpertPdf.Anywhere C# & VB.NET samples
Input URL, HTML string, file or stream
Engine Chromium 154, in the package
Runs on Windows, Linux, macOS, Docker

Everything cross-platform HTML to PDF does.

How the HTML is rendered, how the pages are laid out, what the PDF document carries, and where it runs.

Rendering

Pages as Chrome prints them.

Chromium loads the page, runs its JavaScript, then the PDF is built from the rendered page.

HTML5, CSS3 and JavaScript

Flexbox and grid, web fonts, SVG, canvas and modern JavaScript frameworks; wait for the page, inject CSS and JavaScript.

URLs, strings, files and streams

To PDF bytes, a file, a stream, or a document you change before saving. The same sources to PNG, JPEG, BMP and TIFF images.

Pages behind a login

HTTP authentication, login forms, cookies, HTTP headers and POST data.

Part of a page

Convert one element chosen by a CSS selector, or leave elements out.

Layout & navigation

Documents, not screenshots.

Pages, headers and footers, bookmarks and links.

Page setup

Page size, orientation and margins, page breaks, keep-together blocks and repeated table headers.

Headers and footers

Text, images, HTML or Word documents, with page numbers.

Bookmarks and a table of contents

Built from the headings of the page, with page numbers and links; internal and web links stay live.

HTML forms

HTML forms converted to fillable PDF form fields, and the position in the PDF of any HTML element.

The PDF document

Accessible, archivable, secure.

The standards and options of the PDF the converter writes.

PDF/UA

Tagged, accessible PDF/UA-1 and PDF/UA-2 documents.

PDF/A and PDF/X

PDF/A-1a, 1b, 2a, 2b, 2u, 3a, 3b, 3u, 4, 4e and 4f, and PDF/X-1a, with associated files.

Electronic invoices

ZUGFeRD and Factur-X invoices from an HTML invoice.

Security and signatures

Passwords and permissions; add text, images, HTML and digital signatures to the converted document.

Deployment

Servers, containers and the cloud.

The engine ships with your application, for each platform.

Inside the application

The engine is loaded once and kept ready, with no process started for each conversion; or each conversion in a process of its own.

Many conversions at once

One converter per conversion, up to 8 at the same time by default; asynchronous methods with cancellation.

Docker and the cloud

Linux images with nothing installed; Azure, AWS and Google Cloud Run, each with a tested setup.

Remote engine

Conversions in the ExpertPdf engine container instead of on the application's machine, which is also how Alpine Linux converts. See remote engine.

HTML to PDF in a few lines.

Create a PdfConverter from ExpertPdf.Anywhere.HtmlToPdf, set the options and call one conversion method. The tabs convert a URL with page numbers, an HTML string to an accessible PDF/UA document, and several pages at the same time.

Program.cs · C#
using ExpertPdf.Anywhere.HtmlToPdf;

var converter = new PdfConverter();
// converter.LicenseKey = "your license key";

// A4 pages, the page laid out in a 1024 pixels wide browser window
converter.PdfDocumentOptions.PdfPageSize = PdfPageSize.A4;
converter.PdfDocumentOptions.PdfPageOrientation = PDFPageOrientation.Portrait;
converter.PageWidth = 1024;

// Page numbers in the footer
converter.PdfDocumentOptions.ShowFooter = true;
converter.PdfFooterOptions.ShowPageNumber = true;

converter.SavePdfFromUrlToFile("https://www.example.com/", "page.pdf");

Install the package of your operating system, dotnet add package ExpertPdf.Anywhere.Windows (or .Linux, .Linux.Arm64, .MacOS); it brings the ExpertPdf Anywhere library with it. The HTML to PDF overview and the features describe every option, and the online samples convert a URL, HTML code and an accessible PDF.

Cross-platform HTML to PDF questions, answered.

Common questions about platforms, deployment, standards and licensing.

Does it need Chrome or anything installed on the server?
No. The Chromium engine (Chromium 154) is in the NuGet packages and is copied next to your application when it builds and when it is published. Nothing is installed on the machine, and on Linux no system package is needed.
Which platforms and .NET versions does it run on?
Windows x64 and x86, Linux x64 and ARM64, and macOS on Apple silicon. The library runs on .NET 8, .NET 9, .NET 10 and .NET 11, and on every framework that runs .NET Standard 2.0 libraries, .NET Framework 4.6.1 and later included: ASP.NET Core and ASP.NET applications, console applications, services, desktop applications, containers and cloud functions.
Does it run in Docker and in the cloud?
Yes. Linux containers run on the standard .NET images with nothing installed in the image: no apt-get, no special docker run options. ExpertPdf Anywhere runs on Azure App Service, Functions and Container Apps, AWS Lambda, Elastic Beanstalk, ECS and EKS, and Google Cloud Run. Alpine images convert through the remote engine. See cloud deployments.
How many conversions can run at the same time?
Conversions on different threads are independent of each other: create one converter per conversion. PdfConverterConcurrencyLevel sets how many HTML conversions run at the same time in the application, 8 by default; the others wait their turn. The asynchronous methods, such as GetPdfBytesFromUrlAsync, take a cancellation token.
Does the engine run inside my application?
By default, yes: the engine is loaded into the application and kept ready between conversions, so no process is started for each one. It can also run each conversion in a short-lived process of its own (ChromiumEngineHostMode.OutOfProcess), so a failure inside the engine cannot affect the application, or in the ExpertPdf engine container (the remote engine).
Can it produce accessible PDF/UA and archivable PDF/A?
Yes. AccessibilityStandard produces tagged PDF/UA-1 and PDF/UA-2 documents, and PdfStandardSubset PDF/A-1a, 1b, 2a, 2b, 2u, 3a, 3b, 3u, 4, 4e and 4f, and PDF/X-1a. ZUGFeRD and Factur-X electronic invoices are supported too.
What happens with fonts on a Linux server?
Chromium draws the text with the fonts installed on the machine and embeds every font a page uses in the PDF. On Linux and macOS hosts with no fonts, such as container images, add the ExpertPdf.Anywhere.Fonts package.
How is it different from the classic HTML to PDF Converter?
The classic HTML to PDF Converter runs on Windows, with the Chromium, Blink and other engines. ExpertPdf Anywhere has the same PdfConverter class, in the ExpertPdf.Anywhere.HtmlToPdf namespace, and runs on Windows, Linux and macOS with Chromium. See migrating to Anywhere.
How is it licensed?
HTML to PDF is part of ExpertPdf Anywhere, with every other ExpertPdf tool, from $700. Without a license key it runs in evaluation mode: every feature works, with a "Demo Version" watermark on each page. License it on the pricing page.

Convert HTML to PDF on every platform.

Install ExpertPdf Anywhere from NuGet and try every feature in evaluation mode. License it on the pricing page when you are ready.

Targets.NET Standard 2.0 · .NET 8 · .NET 10 · Windows · Linux · macOS
Versionv22.0.0