IRONSOFTWAREHOME
MIGRATION GUIDES

How to Migrate from PeachPDF to IronPDF in C#

Curtis Chau
Curtis Chau
Updated: August 1, 2026

Migrating from PeachPDF to IronPDF provides access to enterprise-grade PDF generation with comprehensive features, active development, and professional support. This guide provides a step-by-step migration path that takes you from PeachPDF's pre-1.0 async HTML-to-PDF workflow to a fuller-featured PDF solution with Chromium rendering, security settings, and document manipulation APIs.

Why Migrate from PeachPDF to IronPDF

Understanding PeachPDF

PeachPDF is a relatively new entrant in the .NET ecosystem designed for developers who need to convert HTML to PDF. As a library, PeachPDF promises a pure .NET implementation, setting itself apart by not relying on external processes, ensuring it can be seamlessly integrated across platforms where .NET is supported. This characteristic positions PeachPDF as an appealing choice for projects looking for a lightweight, managed library solution.

Despite its potential, PeachPDF is still in development, highlighting both exciting possibilities and notable limitations. PeachPDF remains enticing because of its pure .NET core, which promises straightforward deployment in diverse environments. However, it also translates into limited adoption, with a smaller user base and community-driven support.

The Limitations of PeachPDF

PeachPDF is a single-maintainer, pre-1.0 .NET library (latest 0.7.26, October 2025) released under BSD-3-Clause by jhaygood86. It lacks the maturity, features, and support of established solutions. Key reasons to migrate:

  1. Pre-1.0 Feature Set: PeachPDF has no built-in digital signatures, PDF/A compliance, OCR, form filling, or page-level header/footer API.
  2. No JavaScript engine: PeachPDF is a layout renderer built on PeachPDF.PdfSharpCore, not a browser; scripts and complex Grid/Flexbox layouts do not execute.
  3. net8.0 only: the package targets net8.0; older .NET Framework / .NET 6 projects need to upgrade or pick a different library.
  4. Small Community: a single GitHub maintainer, limited documentation, limited examples.
  5. No Enterprise Support: no commercial support or SLA options.

PeachPDF vs IronPDF Comparison

Feature/CharacteristicPeachPDFIronPDF
ImplementationPure managed .NET (on PeachPDF.PdfSharpCore + SixLabors)Managed with embedded Chromium runtime
LicenseBSD-3-ClauseCommercial
Target Frameworknet8.0 only.NET Framework 4.6.2+, .NET 6/7/8
User BaseSmall (pre-1.0, 0.7.26 released Oct 2025)Large
SupportCommunity-driven (single maintainer, jhaygood86)Professional with dedicated support
HTML RenderingHTML+CSS layout engine on PdfSharpCoreFull Chromium
CSS SupportHTML+CSS subset, web fonts, @font-faceFull CSS3
JavaScriptNot executedFull ES2024
Digital SignaturesNoYes
PDF/A ComplianceNoYes
DocumentationLimited (single README)Extensive
Development StatusPre-1.0 (0.7.26, Oct 2025)Mature, stable release

IronPDF stands out with broader functionality, supporting not just HTML-to-PDF conversions but also OCR, watermarking, and other advanced features. Its professional support structure offers quick resolution paths for issues developers run into.

For teams adopting modern .NET, IronPDF provides comprehensive features and active maintenance to support long-term stability across current .NET versions.


Before You Start

Prerequisites

  1. .NET Environment: .NET Framework 4.6.2+ or .NET Core 3.1+ / .NET 5/6/7/8/9+
  2. NuGet Access: Ability to install NuGet packages
  3. IronPDF License: Obtain your license key from ironpdf.com

NuGet Package Changes

# Remove PeachPDF
dotnet remove package PeachPDF

# Install IronPDF
dotnet add package IronPdf
SHELL

License Configuration

// Add at application startup
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";

Identify PeachPDF Usage

# Audit PeachPDF usage in codebase
grep -r "using PeachPDF" --include="*.cs" .
grep -r "PdfGenerator\|PdfGenerateConfig\|GeneratePdf" --include="*.cs" .
SHELL

Complete API Reference

Namespace Changes

// Before: PeachPDF
using PeachPDF;
using PeachPDF.PdfSharpCore;
using System.IO;
using System.Threading.Tasks;

// After: IronPDF
using IronPdf;
using IronPdf.Rendering;

Core API Mappings

PeachPDFIronPDF
new PdfGenerator()new ChromePdfRenderer()
await generator.GeneratePdf(html, config)renderer.RenderHtmlAsPdf(html)
document.Save(stream)pdf.SaveAs(path)
document.Save(memStream) then memStream.ToArray()pdf.BinaryData
new PdfGenerateConfig { NetworkAdapter = new HttpClientNetworkAdapter(...) }renderer.RenderUrlAsPdf(url)
config.PageSize, config.PageOrientationrenderer.RenderingOptions.PaperSize, .PaperOrientation
Embed in source HTML (CSS position: fixed)RenderingOptions.HtmlHeader / HtmlFooter
Not supportedPdfDocument.FromFile(path)
Not supportedPdfDocument.Merge(pdfs) / pdf.AppendPdf(...)

Code Migration Examples

Example 1: HTML String to PDF Conversion

Before (PeachPDF):

using PeachPDF;
using PeachPDF.PdfSharpCore;
using System.IO;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var html = "<html><body><h1>Hello World</h1></body></html>";

        var config = new PdfGenerateConfig
        {
            PageSize = PageSize.Letter,
            PageOrientation = PageOrientation.Portrait
        };

        var generator = new PdfGenerator();
        var document = await generator.GeneratePdf(html, config);

        using var stream = File.Create("output.pdf");
        document.Save(stream);
    }
}

After (IronPDF):

// NuGet: Install-Package IronPdf
using IronPdf;
using System;

class Program
{
    static void Main()
    {
        var renderer = new ChromePdfRenderer();
        var html = "<html><body><h1>Hello World</h1></body></html>";
        var pdf = renderer.RenderHtmlAsPdf(html);
        pdf.SaveAs("output.pdf");
    }
}

This example shows the fundamental difference between the two libraries. PeachPDF separates a PdfGenerator (engine) from a PdfGenerateConfig (settings), exposes an async GeneratePdf method, and returns a document whose Save method writes to a Stream. IronPDF uses ChromePdfRenderer with RenderHtmlAsPdf(), which returns a PdfDocument object with a built-in SaveAs() method.

A practical advantage of IronPDF's approach: the PdfDocument object can be further manipulated (adding watermarks, merging, security settings) before saving, and SaveAs takes a file path directly without an intermediate FileStream. See the HTML to PDF documentation for further examples.

Example 2: URL to PDF Conversion

Before (PeachPDF):

// PeachPDF has no ConvertUrl-style helper; URL fetching is wired via
// HttpClientNetworkAdapter and passing null HTML so the engine fetches the page.
using PeachPDF;
using PeachPDF.Network;
using PeachPDF.PdfSharpCore;
using System;
using System.IO;
using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var http = new HttpClient();

        var config = new PdfGenerateConfig
        {
            PageSize = PageSize.Letter,
            NetworkAdapter = new HttpClientNetworkAdapter(http, new Uri("https://www.example.com"))
        };

        var generator = new PdfGenerator();
        var document = await generator.GeneratePdf(null, config);

        using var stream = File.Create("webpage.pdf");
        document.Save(stream);
    }
}

After (IronPDF):

// NuGet: Install-Package IronPdf
using IronPdf;
using System;

class Program
{
    static void Main()
    {
        var renderer = new ChromePdfRenderer();
        var url = "https://www.example.com";
        var pdf = renderer.RenderUrlAsPdf(url);
        pdf.SaveAs("webpage.pdf");
    }
}

PeachPDF has no first-class URL-to-PDF helper; you set NetworkAdapter on the config to an HttpClientNetworkAdapter and pass null HTML so the engine fetches the page. IronPDF exposes RenderUrlAsPdf(url) directly. Because PeachPDF does not execute JavaScript, single-page apps and dynamic content typically will not render correctly via the network adapter route; IronPDF's Chromium engine handles modern CSS and JavaScript. Learn more in our tutorials.

Example 3: Adding Headers and Footers

Before (PeachPDF):

// PeachPDF v0.7.x has no header/footer API. The closest approach is
// to embed the header/footer markup directly inside the source HTML
// using CSS positioning.
using PeachPDF;
using PeachPDF.PdfSharpCore;
using System.IO;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var html = @"
            <html><head><style>
              .header { position: fixed; top: 0; left: 0; right: 0; text-align:center; }
              .footer { position: fixed; bottom: 0; left: 0; right: 0; text-align:center; }
            </style></head>
            <body>
              <div class='header'>My Header</div>
              <h1>Document Content</h1>
              <div class='footer'>Footer text</div>
            </body></html>";

        var config = new PdfGenerateConfig { PageSize = PageSize.Letter };
        var generator = new PdfGenerator();
        var document = await generator.GeneratePdf(html, config);

        using var stream = File.Create("document.pdf");
        document.Save(stream);
    }
}

After (IronPDF):

// NuGet: Install-Package IronPdf
using IronPdf;
using IronPdf.Rendering;
using System;

class Program
{
    static void Main()
    {
        var renderer = new ChromePdfRenderer();
        renderer.RenderingOptions.HtmlHeader = new HtmlHeaderFooter() { HtmlFragment = "<div style='text-align:center'>My Header</div>" };
        renderer.RenderingOptions.HtmlFooter = new HtmlHeaderFooter() { HtmlFragment = "<div style='text-align:center'>Page {page}</div>" };
        var html = "<html><body><h1>Document Content</h1></body></html>";
        var pdf = renderer.RenderHtmlAsPdf(html);
        pdf.SaveAs("document.pdf");
    }
}

This example shows a key architectural difference. PeachPDF does not expose a header/footer API on PdfGenerator or PdfGenerateConfig, so the page chrome has to live inside the source HTML using CSS positioning. IronPDF uses HtmlHeaderFooter objects assigned to RenderingOptions.HtmlHeader and RenderingOptions.HtmlFooter, separating page chrome from document content.

The IronPDF approach also exposes properties like MaxHeight for controlling header/footer size, and supports the {page} and {total-pages} placeholders for page numbering.

Note the additional namespace required for IronPDF: using IronPdf.Rendering; is needed for the HtmlHeaderFooter class.


Critical Migration Notes

Generator/Renderer Class Change

PeachPDF uses a PdfGenerator + PdfGenerateConfig pair; IronPDF uses a single ChromePdfRenderer:

// PeachPDF
var config = new PdfGenerateConfig { PageSize = PageSize.Letter };
var generator = new PdfGenerator();

// IronPDF
var renderer = new ChromePdfRenderer();

Async vs Sync, and Return Type

PeachPDF's GeneratePdf is async-only and returns a document whose Save method takes a Stream. IronPDF's RenderHtmlAsPdf is synchronous (an async variant RenderHtmlAsPdfAsync is also available) and returns a PdfDocument:

// PeachPDF: async, save to a Stream
var document = await generator.GeneratePdf(html, config);
using var fs = File.Create("output.pdf");
document.Save(fs);

// IronPDF: synchronous PdfDocument object
PdfDocument pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("output.pdf");
// Or get bytes: byte[] bytes = pdf.BinaryData;

Header/Footer Property Change

// PeachPDF: no header/footer API -- embed in source HTML
// (e.g. via CSS position:fixed)

// IronPDF: HtmlHeaderFooter objects
renderer.RenderingOptions.HtmlHeader = new HtmlHeaderFooter()
{
    HtmlFragment = "<div>Header</div>"
};
renderer.RenderingOptions.HtmlFooter = new HtmlHeaderFooter()
{
    HtmlFragment = "<div>Footer</div>"
};

Method Name Changes

PeachPDFIronPDF
await generator.GeneratePdf(html, config)renderer.RenderHtmlAsPdf(html)
NetworkAdapter = new HttpClientNetworkAdapter(...) + GeneratePdf(null, config)renderer.RenderUrlAsPdf(url)
document.Save(stream)pdf.SaveAs(path)

New Capabilities After Migration

After migrating to IronPDF, you gain capabilities that PeachPDF cannot provide:

PDF Merging

var pdf1 = PdfDocument.FromFile("doc1.pdf");
var pdf2 = PdfDocument.FromFile("doc2.pdf");
var merged = PdfDocument.Merge(pdf1, pdf2);
merged.SaveAs("merged.pdf");
C#

Watermarks with HTML

var pdf = PdfDocument.FromFile("document.pdf");
pdf.ApplyWatermark("<div style='color: red; font-size: 48pt;'>DRAFT</div>");
pdf.SaveAs("watermarked.pdf");

Password Protection

var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf("<h1>Confidential</h1>");

pdf.SecuritySettings.OwnerPassword = "owner123";
pdf.SecuritySettings.UserPassword = "user123";
pdf.SecuritySettings.AllowUserCopyPasteContent = false;
pdf.SecuritySettings.AllowUserPrinting = PdfPrintSecurity.NoPrint;

pdf.SaveAs("protected.pdf");

Digital Signatures

using IronPdf.Signing;

var pdf = PdfDocument.FromFile("document.pdf");
var signature = new PdfSignature("certificate.pfx", "password")
{
    SigningReason = "Document Approval",
    SigningLocation = "New York"
};
pdf.Sign(signature);
pdf.SaveAs("signed.pdf");

Async Operations

var renderer = new ChromePdfRenderer();
var pdf = await renderer.RenderHtmlAsPdfAsync("<h1>Async PDF</h1>");
pdf.SaveAs("async_output.pdf");

Feature Comparison Summary

FeaturePeachPDFIronPDF
HTML to PDFPdfSharpCore-based layoutFull Chromium
URL to PDFVia HttpClientNetworkAdapter (no JS)Yes
CSS Grid/FlexboxPartial / not guaranteedYes
JavaScriptNot executedFull ES2024
Merge PDFsNo (HTML->PDF only)Yes
Split PDFsNoYes
WatermarksManual via HTMLFull HTML
Headers/FootersManual via HTML/CSSFull HTML
Digital SignaturesNoYes
PDF/ANoYes
Form FillingNoYes
Text ExtractionNoYes
Image ExtractionNoYes
Async SupportAsync-only APIYes
Cross-Platformnet8.0 (Windows / Linux / macOS)Yes

Common Migration Issues

Issue 1: Different API Pattern

Problem: PeachPDF separates PdfGenerator (engine) from PdfGenerateConfig (settings) and is async; IronPDF uses one ChromePdfRenderer that returns a PdfDocument synchronously.

Solution:

// PeachPDF pattern (async, stream-out)
var config = new PdfGenerateConfig { PageSize = PageSize.Letter };
var generator = new PdfGenerator();
var document = await generator.GeneratePdf(html, config);
using var fs = File.Create(path);
document.Save(fs);

// IronPDF pattern
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs(path);

Issue 2: Save Targets a Stream, Not a Path

Problem: PeachPDF's document.Save(stream) only takes a Stream; IronPDF's pdf.SaveAs(path) takes a path string.

Solution: Use pdf.SaveAs("file.pdf") directly in IronPDF instead of opening a FileStream.

Issue 3: No Existing-PDF Operations

Problem: PeachPDF is HTML-to-PDF only; it cannot load, merge, split, or edit existing PDFs.

Solution: Replace those operations with IronPDF's PdfDocument.FromFile, PdfDocument.Merge, and pdf.AppendPdf once migrated.


Migration Checklist

Pre-Migration

  • Audit PeachPDF usage in codebase
  • Document custom configurations
  • Note all header/footer implementations
  • Obtain IronPDF license key from ironpdf.com
  • Test with IronPDF trial license first

Package Changes

  • Remove PeachPDF NuGet package
  • Install IronPdf NuGet package: dotnet add package IronPdf

Code Changes

  • Update namespace imports (using PeachPDF;using IronPdf;)
  • Add using IronPdf.Rendering; for header/footer functionality
  • Replace PdfGenerator + PdfGenerateConfig with ChromePdfRenderer
  • Replace await generator.GeneratePdf(html, config) with renderer.RenderHtmlAsPdf(html) (or RenderHtmlAsPdfAsync to stay async)
  • Replace HttpClientNetworkAdapter + GeneratePdf(null, config) with renderer.RenderUrlAsPdf(url)
  • Replace document.Save(stream) with pdf.SaveAs(path)
  • Replace HTML-embedded headers/footers with RenderingOptions.HtmlHeader/HtmlFooter objects
  • Add license initialization at application startup

Post-Migration

  • Test HTML rendering quality
  • Verify PDF output matches expectations
  • Test header/footer rendering with page numbers
  • Add new capabilities (security, watermarks, merging) as needed

Please note: PeachPDF is a registered trademark of its respective owner. This site is not affiliated with, endorsed by, or sponsored by PeachPDF. All product names, logos, and brands are property of their respective owners. Comparisons are for informational purposes only and reflect publicly available information at the time of writing.
Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...
Read More

Related Articles

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required