HTML to PDF · .NET Library & REST API 23M+ NuGet downloads · since 2014

Convert HTML to PDF.
Online, in .NET or by API.

Free, no signup · watermarked demo, up to 5 pages · more options ↓

Use the free online HTML to PDF converter above, or build it into your app. SelectPdf is a battle-tested HTML to PDF toolkit in two shapes. Embed the .NET library: SelectPdf.Universal, our new flagship, runs on Windows, Linux and macOS on Apple Silicon, and the classic library still covers .NET Framework 2.0 and later. Or call the HTML to PDF API from any language. Every option renders with the latest Chromium engine, giving pixel-perfect PDFs with full HTML5, CSS3 and JavaScript support. One perpetual license covers both libraries, with a free trial and a Community Edition.

01 / EMBED ●

.NET Library

Our new flagship, SelectPdf.Universal. Self-hosted, no per-page fees.

  • SelectPdf.Universal — Windows, Linux & macOS on Apple Silicon, .NET 8 / 10 and .NET Standard 2.0
  • Classic library for Windows — .NET Framework 2.0 through .NET 10
  • HTML & Word → PDF, PDF→Text, merge, sign, redact
  • One perpetual license covers both libraries
# flagship · cross-platform · .NET 8 / 10 · .NET Standard 2.0
$ dotnet add package SelectPdf.Universal
$ dotnet add package SelectPdf.Universal.Native.linux-x64

# classic · Windows · .NET Framework 2.0+
$ dotnet add package Select.Pdf
02 / CALL ●

Online API

One endpoint. Any language. Free trial, no credit card.

  • REST · cURL, JS, Python, PHP, Go, Ruby
  • Headless Chromium under the hood
  • Free trial, no credit card · plans $19–$449/mo
  • Nothing to deploy — no servers, no engine to ship
$ curl https://selectpdf.com/api2/convert/ \
  -d "key=YOUR_KEY" \
  -d "url=https://example.com" \
  -o out.pdf
⌘LIVE DEMO · NO KEY REQUIRED

Free HTML to PDF converter demo.
Paste a URL or HTML, watch it convert.

Real conversion through our watermarked demo — no signup, no key. We render the page, return a real PDF, and tell you exactly how long it took.

Web page options
Widthpx
Heightpx
Min loadsec
Max loadsec
Page margins
Toppt
Rightpt
Bottompt
Leftpt
Demo limits: rendered with Chromium, output capped at 5 pages, watermarked, load time clamped. The result panel shows what was clamped — remove every limit with a free API key.
· ms · p · WATERMARKED DEMO
§Quickstart

HTML to PDF in three lines. One PDF.

Same engine. Same output. Same options. The .NET Library and the Online API are bit-for-bit equivalent — pick whichever matches your runtime.

Invoice.cs
using SelectPdf.Universal; // classic Windows library: using SelectPdf;

var converter = new HtmlToPdf();
converter.Options.PdfPageSize = PdfPageSize.A4;
converter.Options.MarginLeft = 20;

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

doc.Save("invoice-4821.pdf");
doc.Close();
convert.sh
curl -X POST https://selectpdf.com/api2/convert/ \
  -d "key=$SELECTPDF_KEY" \
  -d "url=https://yourapp.com/invoice/4821" \
  -d "page_size=A4" \
  --output invoice-4821.pdf
convert.js
const selectpdf = require("selectpdf");

const client = new selectpdf.HtmlToPdfClient(
  process.env.SELECTPDF_KEY
);
client.setPageSize("A4");

client.convertUrlToFile(
  "https://yourapp.com/invoice/4821",
  "invoice-4821.pdf",
  function (err, fileName) {
    if (err) return console.error(err);
    console.log("Saved", fileName);
  }
);
convert.py
import selectpdf

client = selectpdf.HtmlToPdfClient("YOUR_API_KEY")
client.setPageSize(selectpdf.PageSize.A4)

client.convertUrlToFile(
    "https://yourapp.com/invoice/4821",
    "invoice-4821.pdf",
)

print("Pages:", client.getNumberOfPages())
convert.php
<?php
require("SelectPdf.Api.php");

$client = new SelectPdf\Api\HtmlToPdfClient("YOUR_API_KEY");
$client->setPageSize(SelectPdf\Api\PageSize::A4);

$client->convertUrlToFile(
    "https://yourapp.com/invoice/4821",
    "invoice-4821.pdf"
);
convert.rb
require "selectpdf"

client = SelectPdf::HtmlToPdfClient.new("YOUR_API_KEY")
client.page_size = SelectPdf::PageSize::A4

client.convert_url_to_file(
  "https://yourapp.com/invoice/4821",
  "invoice-4821.pdf"
)
↳WHAT IT DOES

The HTML to PDF converter developers ship with.

SelectPdf converts HTML to PDF from .NET and from any language over REST. Point the HTML to PDF converter at a URL or pass a raw HTML string and it returns a pixel-accurate PDF, rendered by a real Chromium browser engine with full HTML5, CSS3 and JavaScript and control over page size, margins, headers, footers and page numbering. The same Chromium engine powers both the self-hosted .NET library and the online HTML to PDF API, so a layout you convert today renders identically whichever you pick. Start free — the .NET trial and the Community Edition need no card, and a free Online API key includes 200 conversions to convert HTML to PDF online before you choose a plan.

What people ship
with HTML to PDF.

A short list of the things developers reach for SelectPdf to build. Same engine handles all of them — pick the runtime, write the template, ship.

01

Invoicing

Generate every invoice your billing system emits — from a templated HTML page to a PDF attached to the customer's receipt.

Common in → billing systems, ERPs, accounting tools
02

Reports

Convert dashboards, charts and tables into archive-ready PDFs. Keep page breaks where they belong, headers on every page.

Common in → BI dashboards, analytics exports, internal tools
03

Contracts

Render legal documents from form data, then sign them. The .NET Library handles PDF/A, accessible (tagged) PDF and digital signatures on your own server.

Common in → e-signature flows, HR onboarding
04

Tickets & passes

Boarding passes, event tickets, gift cards. Embed barcodes and QR codes natively. Render at 300dpi for print, smaller for mobile.

Common in → event ticketing, travel & boarding passes

.NET PDF Library or HTML to PDF API?

Side-by-side
01 / EMBED
.NET Library
02 / CALL
Online API
Where it runs
.NET LibraryInside your .NET process
Online APIOur infrastructure
Languages
.NET LibraryC#, F#, VB.NET
Online APIAny (REST)
Network required
.NET LibraryNo
Online APIYes
Pricing model
.NET LibraryPer-developer, perpetual (from $499)
Online APIPer-conversion, metered ($19–$449/mo)
Free tier
.NET LibraryFree trial (watermarked)
Online APIFree trial, no credit card
Best for
.NET LibraryCompliance, on-prem, high volume
Online APIPolyglot stacks, quick start, spiky load
★TRUSTED BY

Trusted for HTML to PDF since 2014 — teams that ship a lot of PDFs.

23M+
NUGET DOWNLOADS
2014
SHIPPING SINCE
v26.4
CURRENT RELEASE
4
RENDER ENGINES
✎FROM THE BLOG

Latest from the SelectPdf blog — HTML to PDF guides.

All posts →
JUL 7, 2026

HTML to PDF in C#: The Complete Guide

This is a complete, hands-on guide to converting HTML to PDF in C# with the SelectPdf library for .NET. It works up from a three-line conversion to a production-ready wor…

Read →
?FAQ

HTML to PDF, answered.

SelectPdf is an HTML-to-PDF toolkit for developers, available as a perpetual self-hosted .NET library and as a cloud REST API you call from any language. It has shipped since 2014 with 23M+ NuGet downloads.
Yes. The .NET library has a free, no-limit trial (every page watermarked) and a separate free Community Edition capped at five pages; the Online API has a free trial plus a keyless watermarked demo. Paid options are a perpetual library license from $499 or metered API plans from $19–$449/month.
The SelectPdf .NET library supports .NET Framework 2.0+/4.0+, .NET Core and .NET 5–10, including ASP.NET and ASP.NET MVC.
Yes — on Windows and, with SelectPdf.Universal, on Linux (x64 and ARM64) and macOS on Apple Silicon, including Docker; the same library API on all three. Working in another language, or want nothing to deploy? The SelectPdf Online API is the same engine over REST, callable from cURL, JavaScript, Python, PHP and Ruby.
Use the .NET library for local conversion with no network call, perpetual per-developer licensing, or on-prem and compliance control. Use the Online API for polyglot stacks, a quick start with no install, or spiky load. Both use the same engine and produce identical output.
SelectPdf supports the latest headless Chromium engine, along with the Blink, WebKit and WebKit Restricted engines. Current HTML, CSS and JavaScript convert the same way they display in a browser. In the .NET library the Chromium engine ships as a NuGet package — no separate browser to install.
Install the Select.HtmlToPdf NuGet package, create an HtmlToPdf converter, call ConvertUrl or ConvertHtmlString, then save the PdfDocument — about three lines of C#. The same conversion is one REST call with the Online API.
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, while the Blink engine requires .NET Framework 4.6.1 or later (.NET Core and .NET 5–10).
Yes. The homepage demo converts a public URL to PDF in your browser with no signup, and a free Online API key includes 200 conversions to convert HTML to PDF online with no credit card. For unlimited local use, the .NET Community Edition is free for documents up to five pages.