◆.NET Library · v26.5 24M+ NuGet downloads · since 2014

PDF Library for C# and .NET.
Create, convert, merge and sign.

SelectPdf is a battle-tested PDF library for .NET — convert HTML to PDF or image with pixel-perfect rendering from the latest Chromium engine, extract text, merge, split and sign. A perpetual per-developer license, royalty-free OEM options, a free trial and a Community Edition. Targets .NET Framework 2.0+/4.0+, .NET Core and .NET 5–10. For Linux, macOS and Docker, SelectPdf.Universal runs the same API under the same license.

New: SelectPdf.Universal is our flagship. An API you already know, on Windows, Linux and macOS on Apple Silicon, plus Word to PDF, redaction and signature validation. This page covers the classic Windows library, which continues to be maintained; one license covers both. See the cross-platform library →

01 / LICENSED ●

Commercial library

Perpetual, per-developer. Royalty-free OEM options.

  • HTML→PDF, HTML→image, PDF→text, PDF→image, merge, sign
  • .NET Framework 2.0+/4.0+, .NET Core, .NET 5–10
  • Perpetual per-developer license, royalty-free OEM options
  • Linux & macOS: SelectPdf.Universal, same API, same license
# full PDF toolkit:
$ dotnet add package Select.Pdf
 
# free community edition HTML to PDF converter only:
$ dotnet add package Select.HtmlToPdf
 
# Linux · Docker (macOS: SelectPdf.Universal.MacOS):
$ dotnet add package SelectPdf.Universal.Linux
.NET 5–10 .NET Framework 2.0+/4.0+ .NET Core
02 / FREE ●

Community Edition

Free. Generates PDFs up to 5 pages.

Functionally the full converter — the only limitation is that it generates PDF documents up to five pages. The commercial library removes that limit; swap in a license key and your existing code keeps working. C# & VB.NET samples for Windows Forms and ASP.NET are included. Cross-platform: SelectPdf.HtmlToPdf.Universal.

§CAPABILITIES

What the .NET PDF library does.

The real feature set of the SelectPdf SDK for .NET — the same surface documented on the product reference.

01 · HTML→PDF+
HTML to PDF

Convert any web page or raw HTML string to PDF.

  • HTML5/CSS3, web fonts, @media screen & print
  • Convert a section, or exclude elements
  • HTTP headers, cookies, POST, auth, proxy
02 · HTML→Image+
HTML to image

Convert any web page or raw HTML string to an image.

  • Same rendering engine as HTML to PDF
  • Full HTML5/CSS3 & web fonts
  • Web page or raw HTML input
03 · PDF→Text+
PDF to text

Extract text from any PDF document.

  • Extract text at specific coordinates
  • Search for text in a PDF
  • Per-page extraction
04 · PDF→Image+
PDF to image

Convert PDF pages to images.

  • Render any page to an image
  • Previews, thumbnails, pipelines
  • From the same .NET library
05 · Create+
Generate & edit PDFs

Generate PDFs from scratch or load and modify existing documents.

  • Text, image, HTML, shapes, links, bookmarks
  • Document properties & viewer preferences
  • Page size, orientation, margins
06 · Pages+
Merge, split & extract

Reorganise documents at the page level.

  • Merge PDF documents
  • Split PDF documents
  • Extract pages from existing PDFs
07 · Secure+
Security & signatures

Protect and sign documents.

  • RC4 or AES encryption, up to 256-bit keys
  • User password & permissions
  • Digital signatures
08 · Stamp+
Watermarks & templates

Brand and annotate every page.

  • Watermarks and stamps
  • PDF templates repeated on all pages
  • Page numbering
09 · Forms+
Form filling

Fill PDF form fields programmatically.

  • Form filling
  • On generated or loaded PDFs
  • Combine with security settings
10 · Archive+
Accessible & archival PDF

Standards-compliant output.

  • Tagged PDF / PDF/UA-1 — accessible
  • PDF/A-3 (b, u, a), PDF/A & PDF/X
  • Modify color space, compress
11 · Chrome+
Headers, footers & breaks

Control pagination and running chrome.

  • Custom HTML headers and footers
  • Different headers/footers for specific pages
  • Auto & manual page breaks, repeat table headers
12 · Control+
Properties & control

Fine-tune the document and the conversion.

  • Document properties & viewer preferences
  • PDF open actions (open to page, run JS)
  • Multithreading support

New in the cross-platform edition: tables of contents with page numbers, fillable forms from HTML forms, signing with USB tokens and HSMs, Word to PDF, redaction and signature validation ship in SelectPdf.Universal, alongside PDF/A-4, PDF/UA-2 and AES-GCM. It also runs on Alpine Linux, through the engine container. See the cross-platform PDF library →

§Quickstart · .NET

Convert HTML to PDF in C# — dotnet add to a saved PDF.

Two examples: the smallest possible document, and a real URL→PDF with options, plus the same URL→PDF on SelectPdf.Universal for Linux, macOS and Docker. Copy them into a fresh console app — they compile and run.

HelloPdf.cs
// create a new PDF document
SelectPdf.PdfDocument doc = new SelectPdf.PdfDocument();
// add a new page
SelectPdf.PdfPage page = doc.AddPage();

// create a font
SelectPdf.PdfFont font = doc.AddFont(SelectPdf.PdfStandardFont.Helvetica);
font.Size = 20;

// create a text element
SelectPdf.PdfTextElement text = new SelectPdf.PdfTextElement(50, 50, "Hello world!", font);
page.Add(text);

// save the pdf
doc.Save("test.pdf");
doc.Close();
HelloPdf.vb
' create a new PDF document
Dim doc As New SelectPdf.PdfDocument()
' add a new page
Dim page As SelectPdf.PdfPage = doc.AddPage()

' create a font
Dim font As SelectPdf.PdfFont = doc.AddFont(SelectPdf.PdfStandardFont.Helvetica)
font.Size = 20

' create a text element
Dim text As New SelectPdf.PdfTextElement(50, 50, "Hello world!", font)
page.Add(text)

' save the pdf
doc.Save("test.pdf")
doc.Close()
InvoicePdf.cs
using SelectPdf;

// Render a live URL — JS, web fonts, print CSS, the works.
var converter = new HtmlToPdf();
converter.Options.PdfPageSize       = PdfPageSize.A4;
converter.Options.WebPageWidth      = 1200;
converter.Options.JavaScriptEnabled = true;
converter.Options.MinPageLoadTime   = 1;
converter.Options.MaxPageLoadTime   = 60;

// HTML header on every page.
converter.Options.DisplayHeader = true;
converter.Header.Height = 40;
converter.Header.Add(new PdfHtmlSection(
    "<b>Invoice 4821</b>", "https://yourapp.com"));

PdfDocument doc = converter.ConvertUrl(
    "https://yourapp.com/invoice/4821");

doc.Save("invoice-4821.pdf");
doc.Close();
InvoicePdf.vb
Imports SelectPdf

Module InvoicePdf
    Sub Main()
        Dim converter As New HtmlToPdf()
        converter.Options.PdfPageSize       = PdfPageSize.A4
        converter.Options.WebPageWidth      = 1200
        converter.Options.JavaScriptEnabled = True

        ' HTML header on every page
        converter.Options.DisplayHeader = True
        converter.Header.Height = 40
        converter.Header.Add(New PdfHtmlSection(
            "<b>Invoice 4821</b>", "https://yourapp.com"))

        Dim doc As PdfDocument = converter.ConvertUrl(
            "https://yourapp.com/invoice/4821")

        doc.Save("invoice-4821.pdf")
        doc.Close()
    End Sub
End Module
InvoicePdf.cs · SelectPdf.Universal
// On Linux, macOS or Docker, only the namespace changes.
using SelectPdf.Universal;

var converter = new HtmlToPdf();
converter.Options.PdfPageSize       = PdfPageSize.A4;
converter.Options.WebPageWidth      = 1200;
converter.Options.JavaScriptEnabled = true;
converter.Options.MinPageLoadTime   = 1;
converter.Options.MaxPageLoadTime   = 60;

// HTML header on every page.
converter.Options.DisplayHeader = true;
converter.Header.Height = 40;
converter.Header.Add(new PdfHtmlSection(
    "<b>Invoice 4821</b>", "https://yourapp.com"));

PdfDocument doc = converter.ConvertUrl(
    "https://yourapp.com/invoice/4821");

doc.Save("invoice-4821.pdf");
doc.Close();
Invoice PDF generated from an HTML page by the SelectPdf .NET PDF library
Real PDF — generated from HTML by SelectPdf
⌗HOW IT WORKS

HTML in, pixel‑perfect PDF out.

The latest Chromium engine renders your HTML5, CSS3 and JavaScript the way a browser does; the library then saves, secures and signs the PDF.

┌─ SELECTPDF LIBRARY FOR .NET
Input HTML / URL / raw string ConvertUrl("…")
Input Existing PDF (bytes or path) PdfDocument.Load(…)
Input Form data, certificates FillForm · Sign
◆ SELECTPDF ENGINE Pixel-perfect rendering
  • · Latest Chromium — HTML5, CSS3, JavaScript
  • · Reads & writes PDF
  • · Four engines: Chromium, Blink, WebKit, WebKit Restricted
  • · Windows · x86 & x64 · Azure Web Apps
  • · Linux & macOS: SelectPdf.Universal
Select.HtmlToPdf · Select.Pdf
Output PDF document doc.Save(…)
Output PDF/A-3 · PDF/UA · PDF/X · signed Security & standards
Output Image (web page or PDF page) HTML→image · PDF→image
⚖COMPLIANCE & SECURITY

Accessible, archival & signed PDF.

Accessibility Tagged PDF / PDF/UA-1 Logical structure tree, reading order and alt text; validated with veraPDF. Chromium & Blink engines.
Standards PDF/A-3 · PDF/A · PDF/X PDF/A-3 at levels b, u and a for long-term archiving, plus PDF/X for graphics exchange.
Encryption RC4 / AES ≤256-bit RC4 or AES encryption, up to 256-bit keys.
Access Passwords & permissions User password and document permissions.
Signatures Digital signatures Sign generated or existing documents.
Runtime Royalty-free (OEM) Perpetual, per-developer; royalty-free OEM options for unlimited deployments.
Hosting Windows · Azure Windows x86 and x64 (AnyCPU or x64); Azure Web Apps fully supported — and Linux, macOS and Docker with SelectPdf.Universal.
Forms AcroForm filling Fill form fields on generated or loaded PDFs; combine with passwords and permissions.
Branding Watermarks & page numbers Watermarks, stamps and templates repeated on every page; automatic page numbering.
§ELECTRONIC INVOICES

ZUGFeRD & Factur-X invoices in C# and VB.NET.

One file a person can read and a machine can parse — the invoice XML travels inside the PDF, and invoice software finds it without being told.

A hybrid electronic invoice is a normal PDF with the structured invoice XML embedded as an associated file and the document metadata marked so accounting systems recognise it. AddZugferdInvoice does both in one call: it embeds the XML, names it as the standards require, and writes the ZUGFeRD and Factur-X metadata. The same call works in SelectPdf.Universal.

The carrier has to be a PDF/A-3 document — that is what the invoice standards mandate — so set the standard on the conversion first. Choosing PdfA3A additionally makes the visible invoice accessible, which the standards recommend.

Prefer not to host anything? The same hybrid invoice is available over REST from the HTML to PDF API.

Invoice.cs
using SelectPdf;

// the carrier must be PDF/A-3
HtmlToPdf converter = new HtmlToPdf();
converter.Options.PdfStandard = PdfStandard.PdfA3B;
PdfDocument doc = converter.ConvertUrl(
    "https://example.com/invoice");

// embed the XML and mark the metadata
using (FileStream xml = File.OpenRead("factur-x.xml"))
{
    doc.AddZugferdInvoice(xml, ZugferdProfile.En16931,
        PdfAttachmentRelationship.Alternative);
}

doc.Save("invoice.pdf");
doc.Close();
Carrier PDF/A-3 — 3B, 3U or 3A Required by the invoice standards. PDF/A-3A also makes the visible invoice accessible.
Profiles Minimum → XRechnung Minimum, Basic WL, Basic, EN 16931, Extended and XRechnung.
Metadata Factur-X 1.0 Written by default; ZUGFeRD 2.0 metadata is available for recipients that still require it.
File name Named for you factur-x.xml, or xrechnung.xml for the XRechnung profile — the standards fix these names and recipients look them up by name.
Relationship Alternative · Data · Source Alternative when the XML and the page carry the same content — mandatory in Germany for Basic, EN 16931, Extended and XRechnung. Data when the page carries more, Source when the page came from the XML.
Edition Commercial library Electronic invoices are part of the licensed library; the free Community Edition converts HTML to PDF.
↔DEPLOYMENT

.NET PDF Library or HTML to PDF API?

The .NET library ships in two editions: the classic packages for Windows (x86 and x64), including Azure Web Apps, and SelectPdf.Universal for Windows, Linux (x64/ARM64) and macOS on Apple Silicon — our new flagship; one perpetual license covers both. Not on .NET, or want nothing to deploy? The HTML to PDF API is the same engine over REST — and the same engine the free Community Edition uses. Library pricing is perpetual, from $499. Only converting web pages or HTML? See the focused HTML to PDF converter, or why it's the best HTML to PDF converter for .NET.

⌘FREE CONVERTER · NO KEY REQUIRED

Convert HTML to PDF live.

The library and the Online API share this engine. Paste a URL or HTML code — we convert it and hand back a real PDF: free, no signup, no key, no watermark.

Web page options
Widthpx
Heightpx
Min loadsec
Max loadsec
Page margins
Toppt
Rightpt
Bottompt
Leftpt
Rendered with Chromium. Load time is capped at 30 seconds, and conversions are limited per hour. For your own code, use the .NET library trial or a free API key.
· ms · p · NO WATERMARK
?FAQ

PDF library for .NET, answered.

More in the .NET library docs and the API reference — the rest is one email away.

The SelectPdf .NET library runs on Windows (x86 and x64), including Azure Web Apps, and — as SelectPdf.Universal — on Linux (x64 and ARM64) and macOS on Apple Silicon, including Docker and Azure App Service on both Windows and Linux. One perpetual license covers both editions. From a non-.NET stack, use the SelectPdf Online API — the same conversion over REST.
The Select.HtmlToPdf and Select.Pdf packages bundle the default WebKit rendering engine with no external dependencies — no COM, no GAC install, no Adobe runtime and no Office automation. The Chromium and Blink engines ship as companion packages, such as Select.Pdf.Chromium.Windows. SelectPdf.Universal installs with one package per platform (SelectPdf.Universal.Windows, .Linux, .Linux.Arm64 or .MacOS), which brings the Chromium engine and everything it needs.
The .NET library supports .NET Framework 2.0+ / 4.0+, .NET Core, and .NET 5 through .NET 10. SelectPdf.Universal targets .NET 8 and .NET 10, and .NET Standard 2.0, which makes it usable from .NET Framework 4.6.1 and later.
A perpetual, per-developer license — royalty-free OEM options available for unlimited deployments. Maintenance-plan and renewal options are available — see pricing.
Yes. The free Community Edition is functionally the full HTML to PDF converter, capped at five pages per PDF. To evaluate the full commercial library with no limits, the trial is free too — it only stamps a watermark on every page.
Yes. The .NET HTML to PDF converter and the Online API share the same rendering engine and produce the same output — pick the deployment shape that fits your stack.
Yes. JavaScript can be enabled or disabled and the conversion can be started manually from JavaScript, and pages behind authentication or a proxy server are supported.
Yes. Custom HTML headers and footers (different per page if needed), automatic and manual page breaks, and repeating HTML table headers on each page are all supported.
SelectPdf ships four rendering engines — WebKit, WebKit Restricted, Blink and Chromium. WebKit, WebKit Restricted and Chromium run on every supported framework from .NET Framework 2.0 onward. The Blink engine requires .NET Framework 4.6.1 or later (.NET Core and .NET 5–10).
Yes. SelectPdf is a full HTML to PDF converter for .NET — it converts a URL, an HTML string or a local HTML file to PDF, with full CSS and JavaScript support, custom headers and footers, and automatic or manual page breaks, all from C# or VB.NET.
Yes. SelectPdf generates tagged, accessible PDF (PDF/UA-1) and PDF/A-3 at levels b, u and a — from HTML or built programmatically — with a full logical structure tree, reading order and alternate text. Output is validated with veraPDF. Accessible and PDF/A-3 output uses the Chromium or Blink engine and is a feature of the commercial library.
Yes. SelectPdf.Universal keeps 82% of the classic public API unchanged apart from the namespace, and the same perpetual license covers both editions. Moving over means new packages, the SelectPdf.Universal namespace and the library's own drawing types in place of System.Drawing.