Download Binaries

Self-contained executables require no .NET runtime installed on the machine. Download the binary for your platform from GitHub Releases:

PlatformArchitectureFileDownload
Windowsx64 eggpdf-cli-win-x64.exe ↓ Download
WindowsARM64 eggpdf-cli-win-arm64.exe ↓ Download
Linuxx64 eggpdf-cli-linux-x64 ↓ Download
LinuxARM64 eggpdf-cli-linux-arm64 ↓ Download
macOSIntel (x64) eggpdf-cli-osx-x64 ↓ Download
macOSApple Silicon (ARM64) eggpdf-cli-osx-arm64 ↓ Download

Make executable (Linux / macOS)

chmod +x eggpdf-cli-linux-x64
# or
chmod +x eggpdf-cli-osx-arm64
⚠️
On macOS, you may need to allow the binary in System Settings → Privacy & Security after the first run, or run xattr -dr com.apple.quarantine ./eggpdf-cli-osx-arm64.

Install as a dotnet Tool

If you have the .NET SDK installed, install EggPdf as a global dotnet tool — no binary download needed:

dotnet tool install -g dotnet-eggpdf

After installation, the eggpdf command is available globally:

eggpdf --version

Update to the latest version:

dotnet tool update -g dotnet-eggpdf

Basic Usage

# Convert an HTML file to PDF
eggpdf input.html -o output.pdf

# Specify page size
eggpdf input.html -o output.pdf --page-size Letter

# Add a footer with page numbers
eggpdf input.html -o output.pdf --footer "Page {page} of {pages}"

# Add a header
eggpdf input.html -o output.pdf --header "My Company — Confidential"

# Custom margins (top right bottom left, in CSS pixels)
eggpdf input.html -o output.pdf --margin 60 50 60 50

# Set document title
eggpdf input.html -o output.pdf --title "Annual Report 2025"

All Options

OptionShortDefaultDescription
--output-orequiredOutput PDF file path
--page-sizeA4Page size: A3, A4, A5, Letter, Legal
--margin40 40 40 40Margins in px: top right bottom left
--titlePDF document title metadata
--headerHeader template. Supports {page}, {pages}
--footerFooter template. Supports {page}, {pages}
--landscapefalseRender in landscape orientation
--verbose-vfalsePrint render statistics to stderr
--versionPrint version and exit
--help-hShow help message and exit

Piping / stdin

Use - as the input argument to read HTML from standard input. This is ideal for shell pipelines and template engines:

# Pipe HTML directly
echo "<h1>Hi</h1>" | eggpdf - -o out.pdf

# From a template engine
mustache data.json template.html | eggpdf - -o report.pdf

# From curl (remote HTML)
curl -s https://example.com | eggpdf - -o example.pdf

# Heredoc
eggpdf - -o greeting.pdf <<'EOF'
<!DOCTYPE html>
<html><body><h1>Hello, World!</h1></body></html>
EOF

CI Examples

GitHub Actions

.github/workflows/generate-pdf.yml
name: Generate PDF Report
on: [push]

jobs:
  pdf:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install EggPdf CLI
        run: |
          curl -L https://github.com/eggspot/EggPdf/releases/latest/download/eggpdf-cli-linux-x64 -o eggpdf
          chmod +x eggpdf

      - name: Render Report PDF
        run: ./eggpdf report.html -o report.pdf --footer "Page {page} of {pages}"

      - name: Upload PDF artifact
        uses: actions/upload-artifact@v4
        with:
          name: report
          path: report.pdf