CobaltPDF 1.3.0

Prefix Reserved
dotnet add package CobaltPDF --version 1.3.0
                    
NuGet\Install-Package CobaltPDF -Version 1.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CobaltPDF" Version="1.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CobaltPDF" Version="1.3.0" />
                    
Directory.Packages.props
<PackageReference Include="CobaltPDF" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CobaltPDF --version 1.3.0
                    
#r "nuget: CobaltPDF, 1.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CobaltPDF@1.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CobaltPDF&version=1.3.0
                    
Install as a Cake Addin
#tool nuget:?package=CobaltPDF&version=1.3.0
                    
Install as a Cake Tool

CobaltPDF

Pixel-perfect PDFs from HTML and URLs in 3 lines of C#. Powered by a managed Chromium browser pool with <75 ms warm renders.

NuGet .NET License

dotnet add package CobaltPDF
using CobaltPdf;

await new CobaltEngine()
    .RenderUrlAsPdfAsync("https://example.com")
    .SaveAsAsync("output.pdf");

That's it. Chromium is bundled automatically — nothing else to install.


Go further

var pdf = await new CobaltEngine()
    .WithPrintBackground()
    .WithPaperFormat("A4")
    .WithMargins(new MarginOptions(20, 15, 20, 15))
    .WithHeader("<div style='font-size:10px;text-align:center;width:100%'>My Report</div>")
    .WithFooter("<div style='font-size:10px;text-align:center;width:100%'>Page <span class='pageNumber'></span> of <span class='totalPages'></span></div>")
    .WithWatermark(WatermarkOptions.WithText("DRAFT", WatermarkStyle.SoftGray))
    .WithEncryption(new PdfEncryptionOptions
    {
        UserPassword  = "viewer-pass",
        OwnerPassword = "admin-secret",
        AllowPrinting = true,
        AllowCopying  = false,
    })
    .WithMetadata(m =>
    {
        m.Title  = "Q4 Financial Report";
        m.Author = "Finance Team";
    })
    .AddCookie("session", "abc123")
    .WithWaitStrategy(WaitOptions.DefaultNetworkIdle)
    .RenderUrlAsPdfAsync("https://example.com/report");

pdf.SaveAs("report.pdf");

Every option chains. Every method has a sensible default. Use only what you need.


Features

Fluent API Chain any combination of options in a single expression
Headers, footers & watermarks HTML templates with pageNumber/totalPages tokens and built-in watermark presets
AES encryption User + owner passwords with print/copy/modify permissions
Wait strategies Network idle, CSS selector, JS expression, fixed delay, or cobaltNotifyRender() signal
Cookies & storage Inject cookies, localStorage, and sessionStorage before navigation
Custom JavaScript Execute JS before capture to manipulate the DOM or set application state
Custom fonts Load .ttf, .otf, .woff, .woff2 from a local directory
Lazy loading Scroll N viewport-heights to trigger IntersectionObserver content
Metadata Embed title, author, subject, and keywords in the PDF
DI support services.AddCobaltPdf() with singleton lifecycle for ASP.NET Core
Cloud-ready Built-in presets for Docker, Azure, AWS ECS/Fargate, and Lambda
Microservice mode Lightweight CobaltPDF.Requests package for JSON-based rendering without Chromium

ASP.NET Core

// Program.cs
CobaltEngine.SetLicense(builder.Configuration["CobaltPdf:LicenseKey"]!);
builder.Services.AddCobaltPdf(CloudEnvironment.ConfigureForDocker);
// Controller — inject CobaltEngine as a singleton
public class ReportController(CobaltEngine renderer) : ControllerBase
{
    [HttpGet("export")]
    public async Task<IActionResult> Export(CancellationToken ct)
    {
        var pdf = await renderer
            .WithPrintBackground()
            .RenderUrlAsPdfAsync("https://app.example.com/report", ct);

        return File(pdf.BinaryData, "application/pdf", "report.pdf");
    }
}

Cloud presets: ConfigureForDocker | ConfigureForAzure | ConfigureForAwsEcs | ConfigureForLowMemory | ConfigureForLinux


Requirements

.NET 6.0 or later
OS Windows x64, Linux x64

Multi-targets net6.0 and net8.0 — NuGet selects the best build for your project automatically.



License

CobaltPDF is commercial software. Without a licence key, a trial watermark is applied to all PDFs.

CobaltEngine.SetLicense("YOUR-LICENSE-KEY");

View pricing


© 2026 Modus Squared Ltd. All rights reserved.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.3.0 29 3/1/2026
1.2.2 42 2/27/2026

v1.3.0
     - Added multi-targeting: the package now supports both .NET 6.0 and .NET 8.0+, broadening compatibility with projects on .NET 6, 7, 8, 9, and 10.

     v1.2.2
     - Fixed Chromium default header/footer appearing when only one template is provided. Setting a footer no longer adds an unwanted date header, and vice versa.
     - WithCustomJS now waits for the page to be fully loaded before executing, so dynamically-injected elements (e.g. cookie consent buttons) are available.
     - Client-side redirects (e.g. bbc.com → bbc.co.uk) are now detected before cookies, custom JS, and wait strategies run.
     - Fixed WithLazyLoadPages not working when combined with WithCustomJS or WithWaitStrategy.

     v1.2.0
     - Added transitive MSBuild props to auto-configure RuntimeIdentifiers (win-x64, linux-x64) for consuming projects, fixing Chromium.Path resolution in Docker and cloud deployments.
     - No manual .csproj changes needed for Docker/Azure/AWS deployments.

     v1.1.0
     - Consolidated all public types into the CobaltPdf namespace (single using statement).
     - Added WithPrintBackground(), WithScale(), WithPageRanges(), WithPageSize() to the fluent API.
     - Extracted WatermarkOptions, PdfEncryptionOptions, MetadataOptions to top-level classes.

     v1.0.1
     - Added WithPaperFormat() and WithMargins() to the fluent API.
     - Added CancellationToken support to all render methods.
     - Added SaveAsAsync() and Task<PdfDocument> fluent chaining extensions.
     - Added CloudEnvironment presets for Linux, Docker, Azure, and AWS.
     - Improved browser pool with linked CancellationTokenSource for lease timeouts.