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

HTML to PDF.
Any stack. Any scale.

SelectPdf is a battle-tested HTML to PDF toolkit shipping in two shapes: a .NET Library you embed — a perpetual HTML to PDF converter for .NET Framework, .NET Core and .NET 5–10 with the latest Chromium engine available (free trial, plus a Community Edition) — and an HTML to PDF API you call from any language. Pick the one that matches your runtime — your invoices look the same either way.

01 / EMBED

.NET Library

The PDF library for .NET. Runs self-hosted, no per-page fees.

  • Pure C# — .NET Framework, .NET Core, .NET 5–10, ASP.NET & ASP.NET MVC
  • HTML→PDF, PDF→Text, merge, split, sign
  • Perpetual per-developer license, royalty-free OEM options
$ dotnet add package Select.HtmlToPdf
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
$ curl https://selectpdf.com/api2/convert/
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 browser engine with full HTML5, CSS3 and JavaScript and control over page size, margins, headers, footers and page numbering. The same 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.

§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;

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"
)
LIVE DEMO · NO KEY REQUIRED

Free HTML to PDF converter demo.
Paste a URL, 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

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.

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

Latest from the SelectPdf blog — HTML to PDF guides.

All posts →
?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 22M+ 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.
The .NET library runs on Windows. For Linux, macOS or any non-.NET language, use the SelectPdf Online API — 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.