Prerequisites
Runtime
| Requirement | Minimum version |
|---|---|
| .NET | 8.0 or later |
| Operating system | Windows x64 or Linux x64 |
NuGet Package
Install CobaltPdf from NuGet:
dotnet add package CobaltPdf
Chromium is bundled as a NuGet dependency and does not need to be installed separately. The correct binary for your platform (chromium.win-x64 or chromium.linux-x64) is selected automatically at build time. See Chromium Setup for a full explanation of how this works and what to do if Chromium is not found.
Linux / Docker
On Linux, CobaltPdf automatically adds --no-sandbox, --disable-gpu, and --disable-dev-shm-usage to every browser launch — you do not need to configure them manually.
Use a CloudEnvironment preset to apply sensible pool sizing for your target environment:
using CobaltPdf.Configuration;
CobaltEngine.Configure(CloudEnvironment.ConfigureForDocker);
See Configuration for the full list of presets and their flags.
A minimal Dockerfile for an ASP.NET Core app:
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
# Chromium system dependencies
RUN apt-get update && apt-get install -y \
libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 \
libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 \
libxfixes3 libxrandr2 libgbm1 libasound2 \
--no-install-recommends && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "MyApp.dll"]
Tip
The exact list of required packages may vary by base image. The official Playwright Docker documentation lists the full dependency set.
.NET Framework / .NET Standard
CobaltPdf targets .NET 8 only. It does not support .NET Framework or .NET Standard.