HTML to PDF.
Built for .NET.

Convert any URL or HTML string to a pixel-perfect PDF.
Chromium rendering, browser pooling for speed, and a clean fluent API — all in one NuGet package.

dotnet add package CobaltPdf
.NET 6, 7, 8, 9 & 10 ready
Chromium bundled — no installs
Windows & Linux
Unlimited free trial*

* Free trial runs without a licence key for as long as you need. Output is watermarked until a licence is activated.

Program.cs
// 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");
Built on proven technology
Chromium
.NET 6+
NuGet
ASP.NET Core
Docker / Linux
Azure / AWS
10+
Built-in PDF features
<75ms
Avg. warm-pool render
1
NuGet package, nothing else
Concurrent renders supported
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. CobaltPDF keeps a pool of warm Chromium instances ready to go, slashing render times to under 100ms.

  • Configurable pool with min/max browser count
  • Browsers recycled after N renders — no memory leaks
  • Thread-safe: concurrent renders from one instance
  • Optional PreWarmAsync() to eliminate first-request latency
Avg. render time per document
Naive (new browser per request) ~1,200ms
PuppeteerSharp (no pool) ~900ms
CobaltPDF (pooled, warm) ~75ms
Everything you need

A complete PDF toolkit.
Ready out of the box.

Everything you need to generate, secure, and customise PDFs — in a single NuGet package.

Chrome Rendering

Full HTML5, CSS3, Flexbox, Grid, custom web fonts, and JavaScript — rendered pixel-perfectly as it appears in Chrome. @media print rules honoured.

Headers & Footers

Dynamic HTML headers and footers with page number tokens, dates, and fully custom templates.

Cookies & Auth

Inject cookies, localStorage, sessionStorage, and HTTP headers — render authenticated pages effortlessly.

Encryption

AES 128-bit with user/owner passwords and permission controls (print, copy, modify).

PDF Metadata

Embed title, author, subject, keywords, and creator directly into the document properties.

Custom JavaScript

Execute JS before capture — trigger lazy loaders, manipulate the DOM, or set application state.

Wait Strategies

Network idle, CSS selector, JS expression, fixed delay, or manual cobaltNotifyRender().

Cloud-Ready Presets

One-line setup for Docker, Azure App Service, AWS ECS/Fargate, Lambda, and bare-metal Linux — no manual Chromium flags.

Microservice Mode

Deploy as a standalone HTTP service with CobaltPDF.Requests — call it from any stack.

Watermarks

Inject HTML watermarks — full opacity control, positioning, and per-page targeting.

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.

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);
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
Browser pool (no cold-start)
Fluent .NET API Partial Partial
Chromium bundled via NuGet
Cookie & auth injection Limited
PDF encryption
Cloud environment presets
Microservice support

Start rendering PDFs
in minutes.

Free trial available. Chromium bundled. No configuration required.