CobaltPDF isn't just a wrapper around Chromium — it's a managed rendering platform for high-throughput .NET applications with a fluent API that gets out of your way.
CobaltPDF drives a real headless Chromium process — the same engine powering Google Chrome. Every PDF is an exact replica of what a user sees in their browser, including every modern CSS feature.
@media print CSS rules honoured automaticallyvar renderer = new CobaltEngine();
var pdf = await renderer
.WithMediaType(CssMediaType.Print)
.WithPaperFormat("A4")
.RenderUrlAsPdfAsync("https://app.example.com/invoice/42");
pdf.SaveAs("invoice.pdf");
Spawning a Chromium process costs 1–2 seconds. CobaltPDF keeps a managed pool of warm browser instances and leases them per-render, eliminating that cost on every request.
MinSize and MaxSize browser countPreWarmAsync() eliminates first-request latencyBrowser Pool — 4 workers
Each render gets its own private browser context. Cookies, storage, and session state from one request are completely invisible to concurrent renders.
cookies, localStorage, sessionStorage per renderCobaltEngine instance safe as a DI singletonasync/await — no thread blocking, no deadlocksParallel renders — isolated contexts
Chain options and call a single terminal method. The engine resets after each render — no new instances, no configuration objects, no boilerplate.
CancellationToken support on every methodservices.AddCobaltPdf()[HttpGet("report")]
public async Task<IActionResult> GetReport(
CancellationToken ct)
{
var pdf = await _renderer
.WithLandscape()
.WithPaperFormat("A3")
.WithHttpHeader("Authorization", $"Bearer {_token}")
.AddCookie("session", User.SessionId)
.WithHeader(headerHtml)
.WithFooter(footerHtml)
.RenderUrlAsPdfAsync(reportUrl, ct);
return File(pdf.BinaryData, "application/pdf");
}
A complete PDF generation toolkit — no extensions or add-ons required.
Dynamic HTML templates with page number, total pages, and date tokens on every page.
Overlay text or HTML watermarks on every page with configurable opacity, rotation, and position.
Password-protect output with user and owner passwords. Control print, copy, and modification permissions.
Inject cookies, localStorage, and sessionStorage before the page loads — render authenticated pages cleanly.
Set User-Agent, Authorization, Accept-Language, and any other request header per render.
Execute JS before capture. Signal readiness with cobaltNotifyRender() for full SPA control.
networkIdle, DOM selector, JS expression, custom signal, or fixed delay — complete control over capture timing.
Load fonts from disk before rendering so PDFs display correctly on servers without those fonts installed.
Auto-scroll before capture to trigger lazy-loaded images and content, then render the complete page.
Embed document title, author, subject, keywords, and creator properties directly in the PDF.
A4, A3, Letter, Legal, Tabloid — or custom sizes. Per-side margin control with CSS length values.
Companion package for microservices — send PDF jobs from lightweight .NET clients without Chromium on the client.
wkhtmltopdf and PuppeteerSharp are common choices. Here's how they stack up.
| ⚡ CobaltPDF | PuppeteerSharp | wkhtmltopdf | |
|---|---|---|---|
| Real Chromium engine | ✓ | ✓ | ✗ old WebKit |
| Browser pooling (no cold-start per request) | ✓ built-in | ✗ manual | ✗ |
| Fluent .NET API | ✓ | Partial | ✗ |
| Thread-safe singleton | ✓ | ✗ | ✗ |
| Cookie & storage injection | ✓ | Manual | ✗ |
| Custom HTTP headers per render | ✓ | Manual | ✗ |
| Cloud environment presets | ✓ | ✗ | ✗ |
| Wait strategies (signal, selector, JS) | ✓ | Manual | ✗ |
| Modern CSS (Grid, Flexbox, variables) | ✓ | ✓ | ✗ |
| Chromium bundled via NuGet (no CLI install) | ✓ | CLI download | System install |
Free trial available — no time limit, no credit card required.