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
SelectPdf is a battle-tested PDF library for .NET — convert HTML to PDF or image, extract text, merge, split and sign, all in your own process. 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.
Perpetual, per-developer. Royalty-free OEM options.
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.
The real feature set of the SelectPdf SDK for .NET — the same surface documented on the product reference.
Convert any web page or raw HTML string to PDF.
Convert any web page or raw HTML string to an image.
Extract text from any PDF document.
Convert PDF pages to images.
Generate PDFs from scratch or load and modify existing documents.
Reorganise documents at the page level.
Protect and sign documents.
Brand and annotate every page.
Fill PDF form fields programmatically.
Standards-compliant output.
Control pagination and running chrome.
Fine-tune the document and the conversion.
dotnet add to a saved PDF.Two examples: the smallest possible document, and a real URL→PDF with options. Copy them into a fresh console app — they compile and run.
// 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();
' 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()
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;
PdfDocument doc = converter.ConvertUrl(
"https://yourapp.com/invoice/4821"
);
// Header on every page.
doc.Header.Height = 40;
doc.Header.Add(new PdfHtmlSection(
0, 0, "<b>Invoice 4821</b>", "https://yourapp.com"));
doc.Save("invoice-4821.pdf");
doc.Close();
Imports SelectPdf
Module InvoicePdf
Sub Main()
Dim converter As New HtmlToPdf()
converter.Options.PdfPageSize = PdfPageSize.A4
converter.Options.WebPageWidth = 1200
converter.Options.JavaScriptEnabled = True
Dim doc As PdfDocument = converter.ConvertUrl(
"https://yourapp.com/invoice/4821")
doc.Header.Height = 40
doc.Header.Add(New PdfHtmlSection(
0, 0, "<b>Invoice 4821</b>", "https://yourapp.com"))
doc.Save("invoice-4821.pdf")
doc.Close()
End Sub
End Module
No sidecar service, no daemon. The native rendering engine is bundled with the NuGet and runs inside your app's process on Windows.
The .NET library runs in your process on Windows (x86 and x64), including Azure Web Apps. Need Linux, macOS, a non-.NET stack or zero install? 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.
The library and the Online API share this engine. Paste a URL — we render it through the watermarked demo and hand back a real PDF, no signup, no key.
More in the .NET library docs and the API reference — the rest is one email away.