RedPdf 1.0.0-preview.2

This is a prerelease version of RedPdf.
dotnet add package RedPdf --version 1.0.0-preview.2
                    
NuGet\Install-Package RedPdf -Version 1.0.0-preview.2
                    
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="RedPdf" Version="1.0.0-preview.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RedPdf" Version="1.0.0-preview.2" />
                    
Directory.Packages.props
<PackageReference Include="RedPdf" />
                    
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 RedPdf --version 1.0.0-preview.2
                    
#r "nuget: RedPdf, 1.0.0-preview.2"
                    
#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 RedPdf@1.0.0-preview.2
                    
#: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=RedPdf&version=1.0.0-preview.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=RedPdf&version=1.0.0-preview.2&prerelease
                    
Install as a Cake Tool

RedPDF

A cross-platform commercial .NET PDF library. HTML → PDF via an embedded Chromium engine, plus PDF manipulation — on Windows, Linux and macOS.

The free Community tier covers rendering and manipulation. Paid licenses unlock digital signatures (with RFC 3161 trusted timestamps), veraPDF-validated PDF/A output and serverless deployment presets — enforced by offline-verified, cryptographically signed license keys.

New here? The Getting Started guide goes from dotnet add package to a signed, archived PDF in five short steps. Evaluating alternatives? See RedPDF vs IronPDF — an honest, code-level comparison of the top-10 evaluation use cases.

Quick start

// Free Community features — no license needed
await using var renderer = await HtmlToPdfRenderer.CreateAsync();
byte[] invoice = await renderer.RenderHtmlAsync("<h1>Invoice</h1>", new PdfRenderOptions
{
    FooterHtml = "<div style='font-size:8px;text-align:center;width:100%;'>" +
                 "Page <span class='pageNumber'></span> of <span class='totalPages'></span></div>",
});

byte[] merged  = PdfOperations.Merge(invoice, otherPdf);
byte[] stamped = PdfOperations.AddTextWatermark(merged, "CONFIDENTIAL");

byte[] thumbnail = PdfRasterizer.ToPng(stamped, pageNumber: 1, new RasterizeOptions { Dpi = 150 });

// Licensed features — activate once at startup
License.Activate("REDPDF.…");

byte[] signed = PdfSigner.Sign(merged, certificate, new SignOptions
{
    Reason = "Contract approval",
    TimestampAuthorityUrl = "http://timestamp.digicert.com", // RFC 3161 token (PAdES B-T)
});

byte[] archival = PdfAConverter.Convert(merged, new PdfAOptions
{
    Conformance = PdfAConformance.PdfA3b,   // validated PASS by veraPDF
    DocumentTitle = "Invoice",
});

// Serverless hosts (licensed): configures Chromium the way the Azure sandbox requires
var fx = await HtmlToPdfRenderer.CreateAsync(new RendererOptions
{
    Environment = DeploymentEnvironment.AzureFunctions,
});

The first render on a machine downloads a pinned Chromium build (~150 MB) into a per-user cache; every run after that starts instantly. Two ways to skip the download entirely:

dotnet add package RedPdf.Chromium.win-x64   # also: linux-x64, osx-x64, osx-arm64

referencing the Chromium package for your platform embeds the browser in your build output (redpdf-chromium/<rid>/), where the renderer finds it automatically — no network, no first-run delay; this is the way to go for air-gapped hosts, Docker images, CI and serverless plans (install the same version as the RedPdf package). Alternatively, point RendererOptions.ChromiumExecutablePath (or the REDPDF_CHROMIUM_PATH environment variable) at any existing Chrome/Chromium install; REDPDF_CHROMIUM_ARGS appends extra Chromium switches without a code change. RID-specific publishes (dotnet publish -r linux-x64) only carry the matching browser.

Create one renderer and share it — the renderer is built for production load. Each render runs in its own tab; concurrent renders are capped (RendererOptions.MaxConcurrentRenders, default: processor count), every render is bounded end to end by Timeout (a hung page throws TimeoutException instead of wedging a worker), all render methods accept a CancellationToken, and a crashed or OOM-killed Chromium is relaunched automatically on the next render. Working deployment samples: samples/RedPdf.DockerSample and samples/RedPdf.AzureFunctionsSample — both are built and smoke-tested (a real render) on every CI run.

Ubuntu 23.10+ note: stock Ubuntu restricts unprivileged user namespaces via AppArmor, which blocks Chromium's sandbox (No usable sandbox!). Either re-enable them (sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0) or use the licensed DeploymentEnvironment.LinuxContainer preset, which configures Chromium for sandboxless hosts.

Feature matrix

Capability Community (free) Professional Enterprise
HTML / URL → PDF (Chromium-accurate)
Embedded Chromium NuGet packages (no runtime download)
Headers, footers, page numbers, margins
Authed URLs (cookies/headers), wait-for-selector, viewport
Merge / split / watermark
Password protection & permissions (AES-256)
Text extraction
Stamp text / images / page numbers onto PDFs
Images → PDF (PNG, JPEG)
HTML / URL → image (PNG, JPEG screenshots)
Markdown → PDF
Image extraction
Form create / fill / read / flatten (AcroForms)
Bookmarks (nested) & file attachments
PDF → PNG rasterization (PDFium)
Digital signatures (PKCS#7 detached)
RFC 3161 trusted timestamps (PAdES B-T)
PDF/A-2b / PDF/A-3b (veraPDF-validated)
Azure Functions / container presets

Editions are conventions; each key carries an explicit feature list, so you can sell any combination (--features DigitalSignatures,PdfACompliance,Serverless).

Free 30-day trial: trial keys unlock every paid feature, time-boxed by the key itself (issue --licensee "Name" --trial). When the trial lapses, licensed calls throw LicenseException; the Community features keep working forever.

How licensing works

Keys are ECDSA P-256–signed JSON payloads, verified fully offline against the public key embedded in License.cs — no activation server, no telemetry:

REDPDF.<base64url payload>.<base64url signature>
payload = { licensee, edition, issued, expires (null = perpetual), features[] }

Vendor-side tooling lives in tools/RedPdf.LicenseTool (never ship this project):

dotnet run --project tools/RedPdf.LicenseTool -- gen-keys            # once; paste public key into License.cs
dotnet run --project tools/RedPdf.LicenseTool -- issue \
    --licensee "Acme Corp" --edition Professional \
    --features DigitalSignatures,PdfACompliance --expires 2027-07-08
dotnet run --project tools/RedPdf.LicenseTool -- inspect REDPDF.…

The generated keys/private-key.pem is git-ignored. Keep it in a secrets manager; anyone holding it can mint licenses.

PDF/A conformance

PdfAConverter output passes veraPDF (the industry reference validator) for both PDF/A-2b and PDF/A-3b. It works by attaching an sRGB output intent (a bundled CC0 profile), setting PDF 1.7, and splicing the PDF/A identification XMP in as a spec-compliant incremental update — necessary because PDFsharp regenerates document metadata on every save. Conformance is enforced by regression tests that run the real validator, locally (when verapdf is on PATH) and in CI.

Project layout

src/RedPdf/
  Rendering/     HtmlToPdfRenderer, deployment presets (PuppeteerSharp / Chromium)
  Manipulation/  Merge, split, watermark (PDFsharp)
  Signing/       PKCS#7 signer + RFC 3161 timestamps (PDFsharp + .NET SignedCms)  [licensed]
  Compliance/    PDF/A converter, incremental-update writer, bundled sRGB profile [licensed]
  Licensing/     Offline key validation, feature gates
  Fonts/         PortableFontResolver (PDFsharp needs one off-Windows)
tools/RedPdf.LicenseTool/   Vendor-only key generation and license issuing
tools/RedPdf.Chromium.Pack/ Builds the RedPdf.Chromium.<rid> browser packages (release CI)
tests/RedPdf.Tests/         Unit + integration + veraPDF conformance tests
samples/RedPdf.Sample/      End-to-end demo (REDPDF_LICENSE_KEY env var unlocks paid half)
samples/RedPdf.DockerSample/           HTML→PDF in a Linux container (CI smoke-tested)
samples/RedPdf.AzureFunctionsSample/   HTTP-triggered PDF function, containerized (CI smoke-tested)
.github/workflows/          CI matrix (win/linux/mac/arm64/alpine), veraPDF job, sample smoke
                            tests, tag-triggered NuGet publish
dotnet test tests/RedPdf.Tests --filter "Category!=Integration"   # fast unit tests
dotnet test tests/RedPdf.Tests                                    # + Chromium render + live TSA
REDPDF_LICENSE_KEY=REDPDF.… dotnet run --project samples/RedPdf.Sample
dotnet pack src/RedPdf -c Release -o artifacts                    # NuGet package

Releasing

  1. On nuget.org (username → Trusted Publishing), create a policy for repository owner Mercury-Ong, repository redpdf, workflow file release.yml, and store your nuget.org username as the NUGET_USER repository secret. No API key — the workflow authenticates via GitHub OIDC and a short-lived key.
  2. Tag and push: git tag v1.0.0-preview.1 && git push origin v1.0.0-preview.1.
  3. The release workflow tests, packs with the tag's version, and pushes to nuget.org. A second job packs the four RedPdf.Chromium.<rid> packages (same version) and pushes them too — the trusted publishing policy must cover those package IDs as well.

Roadmap

See ROADMAP.md — milestones from here to the first user (NuGet preview with API parity on the top evaluation features) and the first order (trial mode, docs site, purchase flow), plus the post-first-customer depth work (PAdES LTV, HSM signing, tagged PDF).

Product Compatible and additional computed target framework versions.
.NET 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.0.0-preview.2 91 7/14/2026
1.0.0-preview.1 73 7/10/2026