MIT License

Zero-dependency HTML to
PDF for .NET

Pure C#  •  MIT License  •  Chrome-quality output

13µs
Simple page
86µs
Invoice
1.2ms
100-row table

Install in seconds

Choose your preferred delivery method.

# Add the package to your project
dotnet add package EggPdf
# Pull and run the REST API + WebUI
docker run -p 8080:8080 eggspot/eggpdf:latest
# x64 (most Windows PCs)
curl -L https://github.com/eggspot/EggPdf/releases/latest/download/eggpdf-cli-win-x64.exe -o eggpdf.exe
.\eggpdf.exe input.html -o output.pdf

# ARM64 (Surface Pro X, Copilot+ PCs)
curl -L https://github.com/eggspot/EggPdf/releases/latest/download/eggpdf-cli-win-arm64.exe -o eggpdf.exe
# x64
curl -L https://github.com/eggspot/EggPdf/releases/latest/download/eggpdf-cli-linux-x64 -o eggpdf
chmod +x eggpdf && ./eggpdf input.html -o output.pdf

# ARM64 (Raspberry Pi, AWS Graviton)
curl -L https://github.com/eggspot/EggPdf/releases/latest/download/eggpdf-cli-linux-arm64 -o eggpdf
chmod +x eggpdf
# Apple Silicon (M1/M2/M3/M4)
curl -L https://github.com/eggspot/EggPdf/releases/latest/download/eggpdf-cli-osx-arm64 -o eggpdf
chmod +x eggpdf && ./eggpdf input.html -o output.pdf

# Intel Mac
curl -L https://github.com/eggspot/EggPdf/releases/latest/download/eggpdf-cli-osx-x64 -o eggpdf
chmod +x eggpdf
# Install as global .NET tool (requires .NET SDK, all platforms)
dotnet tool install -g dotnet-eggpdf
eggpdf input.html -o output.pdf

Everything you need

A complete HTML-to-PDF solution with zero setup friction.

📦

Zero Dependencies

No third-party NuGet packages in the core library. Just pure, portable C# code you can trust.

🌍

Multi-platform

Runs on Windows, Linux, and macOS. Native binaries available for x64 and ARM64 architectures.

🖨️

Chrome-quality Output

Full CSS cascade, Flexbox, tables, custom fonts, images, and bookmarks — rendered faithfully.

🔌

REST API Included

Ship the Docker image and get a production-ready POST /api/render endpoint instantly.

⌨️

CLI Tool

Convert HTML files from your terminal or CI pipeline with a single command. Supports stdin piping.

🎯

Multi-target .NET

Supports netstandard2.0 through net10.0. Works with any modern .NET project.

Two lines of C# to your first PDF

Call HtmlToPdf.RenderAsync with any HTML string and receive a byte array ready to save, stream, or return from an API.

No configuration required. No fonts to install. No browser runtime to manage.

Full Getting Started Guide →
Program.cs
using EggPdf;

var html = """
    <!DOCTYPE html>
    <html>
    <head>
      <style>
        body { font-family: Arial, sans-serif; }
        h1   { color: #2563eb; }
      </style>
    </head>
    <body>
      <h1>Hello, EggPdf!</h1>
      <p>Rendered in pure C#.</p>
    </body>
    </html>
    """;

var pdf = await HtmlToPdf.RenderAsync(html);
await File.WriteAllBytesAsync("output.pdf", pdf);