HTML to PDF for .NET. Chromium precision or WebKit efficiency.

Generate pixel-perfect PDFs from any URL or HTML in C# — headers, watermarks, encryption and more, in a few lines of code. Pick Chromium for maximum fidelity and speed, or WebKit for a lighter, self-contained Linux footprint — one fluent API, one license.

dotnet add package CobaltPdf
dotnet add package CobaltPdf.WebKit
.NET 8, 9 & 10 ready
Engines bundled — no installs
One key, both libraries
Unlimited free evaluation*

* Free evaluation mode runs without a license key for as long as you need. Output is watermarked until a license is activated.

Program.cs
using CobaltPdf;

// Render a URL to PDF
await new CobaltEngine()
    .RenderUrlAsPdfAsync("https://example.com")
    .SaveAsAsync("website.pdf");

// Render an HTML string to PDF
await new CobaltEngine()
    .RenderHtmlAsPdfAsync("<h1>Hello, World!</h1>")
    .SaveAsAsync("hello.pdf");

// Render a local HTML file to PDF
await new CobaltEngine()
    .RenderHtmlFileAsPdfAsync("invoice.html")
    .SaveAsAsync("invoice.pdf");
using CobaltPdf.WebKit;

// Render a URL to PDF
await new CobaltEngine()
    .RenderUrlAsPdfAsync("https://example.com")
    .SaveAsAsync("website.pdf");

// Render an HTML string to PDF
await new CobaltEngine()
    .RenderHtmlAsPdfAsync("<h1>Hello, World!</h1>")
    .SaveAsAsync("hello.pdf");

// Render a local HTML file to PDF
await new CobaltEngine()
    .RenderHtmlFileAsPdfAsync("invoice.html")
    .SaveAsAsync("invoice.pdf");
Idle memory (RSS)*
~240 MB
Warm render time*
~0.9 s
Install
dotnet add package CobaltPdf
* Warm-render benchmark — methodology below.
Built on proven technology
Chromium
WebKit
.NET 8+
NuGet
ASP.NET Core
Docker / Linux
Azure / AWS
2
Engines: Chromium & WebKit
~40%
Lower idle memory with WebKit*
1
Fluent C# API & license for both
Concurrent renders supported
Two libraries · One license

Pick the engine that
fits the job.

CobaltPDF and CobaltPDF.WebKit are two separate libraries that share the same fluent API, the same options, and the same license key. Use one, the other, or both side by side.

Chromium · Flagship

CobaltPDF

Chromium engine · the original CobaltPDF library

The full Chromium rendering stack. Every modern CSS feature, every JavaScript API — pixel-perfect to what you see in Chrome.

100%
Chrome rendering fidelity
Win + Linux
Native production targets
  • Full HTML5 / CSS3 / Flexbox / Grid / web fonts
  • Modern JavaScript — React, Vue, Angular, SPAs
  • Warm browser pool for high-concurrency workloads
  • Windows, Linux, Docker, Azure & AWS in production
Best for
Branded reports, dashboards, marketing collateral, JavaScript-heavy pages — and any deployment where rendering fidelity or native Windows production is non-negotiable.
dotnet add package CobaltPdf
WebKit · Lightweight New

CobaltPDF.WebKit

WebKit engine · standalone library, activated by your CobaltPDF license

A lean WebKit-based renderer with the same fluent API and a lighter, self-contained Linux footprint. Built for Linux containers and high-volume pipelines.

~40%
Lower idle memory than Chromium*
~3 MB
Self-contained deploy package*
  • Modern HTML5 & CSS3 — Flexbox, Grid, transforms
  • Identical fluent API — a drop-in code swap
  • Self-provisioning on managed Linux (App Service / Functions) — no apt, no system setup
  • The modern replacement for wkhtmltopdf

Linux-native engine. Runs in production on Linux x64/arm64 — Azure App Service, AKS, ECS/Fargate, any Ubuntu or Alpine container. Develop on Windows via WSL2 or Docker Desktop.

Best for
Invoices, receipts, statements, and steady pipelines on memory-constrained Linux containers — where idle workers sitting on RAM between renders are what's hurting the bill.
dotnet add package CobaltPdf.WebKit

* Idle heap (RSS) after warm-up, both engines measured identically on the same Linux host rendering the same document: ~130 MB (WebKit) vs ~240 MB (Chromium). Chromium renders faster; WebKit uses less idle memory and releases it between renders. The ~3 MB figure is the WebKit NuGet package — its render bundle self-provisions on first use. See the WebKit edition docs for methodology.

The WebKit advantage

Same document.
A lighter idle footprint.

CobaltPDF.WebKit is engineered for density. Measured identically on the same Linux host, the WebKit engine idles at roughly 40% less memory than Chromium and releases it between renders — so a memory-constrained host can hold more idle workers. The trade-off is render speed: Chromium is faster.

  • Releases memory back to the host between renders
  • Built-in memory metrics on every render
  • Same fluent code — just swap the using statement
  • Same pooling, AES-256 encryption, watermarks & metadata
Idle memory (RSS) · same document, measured identically*
CobaltPDF (Chromium) ~240 MB
CobaltPDF.WebKit ~130 MB
Same fluent API, same documents — roughly 40% lower idle memory on Linux hosts.
~40% less idle RAM
* Idle heap (RSS) after warm-up; both engines measured identically on the same Linux host rendering the same document. Chromium renders faster.
Developer Experience

A fluent API that
reads like prose.

Every option chains. Every method has a sensible default. No XML config, no boilerplate, no ceremony — just clean, readable code that renders exactly what you mean, in either library.

Program.cs
var pdf = await new CobaltEngine()
    .WithPaperFormat("A4")
    .WithMargins(new MarginOptions(15, MarginUnit.Millimeters))
    .WithHeader("<b>Q3 Report</b>")
    .WithFooter("Page <span class='pageNumber'/>")
    .WithEncryption(new PdfEncryptionOptions { UserPassword = "user123", OwnerPassword = "owner456" })
    .WithMetadata(m => {
        m.Title  = "Q3 Financial Report";
        m.Author = "Finance Team";
    })
    .RenderUrlAsPdfAsync(reportUrl);

await blobStorage.UploadAsync(pdf.BinaryData);
Performance

No cold-start.
Just fast.

Spawning a new browser process for every PDF is expensive — often costing over a second before rendering even begins. Both CobaltPDF libraries keep a pool of warm renderer instances ready to go, so every request skips the cold-start tax entirely.

  • Configurable pool with min/max renderer count
  • Renderers recycled after N renders — no memory leaks
  • Thread-safe: concurrent renders from one instance
  • Optional PreWarmAsync() to eliminate first-request latency
The per-request lifecycle
Naive (new browser per request)
Browser startup & teardown
Render
CobaltPDF (pooled, warm) No startup cost
Render
How we compare

Why developers choose CobaltPDF

A side-by-side look at what matters in production.

Feature CobaltPDF PuppeteerSharp wkhtmltopdf iTextSharp
Modern CSS support
Choice of engine (Chromium or lightweight WebKit)
Browser pool (no cold-start)
Fluent .NET API Partial Partial
Engine bundled via NuGet
Cookie & auth injection Limited
PDF encryption (AES-256) Limited
Split, extract & merge pages
Cloud environment presets
Microservice support
Actively maintained ✗ archived

Start rendering PDFs
in minutes.

Both libraries run free, unlimited, in evaluation mode — watermarked output until you activate. One key unlocks both.