Skip to footer content
MIGRATION GUIDES

How to Migrate from PDF Duo to IronPDF in C#

Migrating from PDF Duo .NET to IronPDF moves your .NET PDF workflow from an obscure, poorly documented library with unclear maintenance status to a stable, well-documented, and actively maintained solution. This guide provides a comprehensive, step-by-step migration path that eliminates the risks associated with abandoned libraries while gaining access to advanced features that PDF Duo cannot provide.

Why Migrate from PDF Duo to IronPDF

The PDF Duo Risk Problem

PDF Duo .NET is an elusive and lesser-known library in the .NET ecosystem. While it may have appealed to developers seeking simplicity, the library's obscurity presents significant challenges for production applications:

  1. Unclear Provenance: Unknown developer with no verifiable company backing. There is no visible GitHub repository or source code, limited NuGet download statistics, and uncertain licensing terms.

  2. Missing Documentation: Nearly impossible to find reliable information. There is no official API reference, sparse community examples, and no official tutorials or guides. Any attempts to utilize PDF Duo are hindered by the scarcity of reliable documentation.

  3. Abandoned or Inactive Status: Signs of neglect are evident with sporadic or no updates. Support forums show posts from 2019 with no responses. The very real risk of abandonment compromises its viability for significant projects.

  4. Limited Features: Basic functionality only—simple HTML to PDF and basic PDF merging with no advanced features like forms, security, or watermarks.

  5. Unknown Rendering Engine: No transparency about what's under the hood. CSS/JavaScript support is unknown, rendering quality is unpredictable, and modern web feature support is uncertain.

  6. Support Risk: No recourse when things break. There is no professional support, no community to help, and complete risk of abandonment.

PDF Duo vs IronPDF Comparison

AspectPDF Duo .NETIronPDF
MaintenanceUnknown/InactiveActive, regular updates
DocumentationSparse/MissingComprehensive
SupportNoneProfessional support team
Community~0 users41M+ NuGet downloads
RenderingUnknown engineModern Chromium
FeaturesBasicFull-featured
StabilityUnknownProduction-proven
LicensingUnclearTransparent

For teams planning .NET 10 and C# 14 adoption through 2025 and 2026, IronPDF provides a stable foundation with active development and comprehensive documentation, eliminating the uncertainties of relying on an abandoned library.


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 PDF Duo .NET (if you can find the correct package name)
dotnet remove package PDFDuo.NET
dotnet remove package PDFDuo
dotnet remove package PDF-Duo

# Install IronPDF
dotnet add package IronPdf
# Remove PDF Duo .NET (if you can find the correct package name)
dotnet remove package PDFDuo.NET
dotnet remove package PDFDuo
dotnet remove package PDF-Duo

# Install IronPDF
dotnet add package IronPdf
SHELL

License Configuration

// Add at application startup (Program.cs or Startup.cs)
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
// Add at application startup (Program.cs or Startup.cs)
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
$vbLabelText   $csharpLabel

Identify PDF Duo Usage

# Find all PDF Duo references
grep -r "PDFDuo\|HtmlToPdfConverter\|PdfMerger" --include="*.cs" .
# Find all PDF Duo references
grep -r "PDFDuo\|HtmlToPdfConverter\|PdfMerger" --include="*.cs" .
SHELL

Complete API Reference

Namespace Changes

PDF Duo .NETIronPDF
using PDFDuo;using IronPdf;
using PDFDuo.Document;using IronPdf;
using PDFDuo.Rendering;using IronPdf.Rendering;
using PDFDuo.Settings;using IronPdf;

HTML to PDF Conversion Mappings

PDF Duo .NETIronPDFNotes
new HtmlToPdfConverter()new ChromePdfRenderer()Main renderer
converter.ConvertHtmlString(html, path)renderer.RenderHtmlAsPdf(html).SaveAs(path)HTML string
converter.ConvertUrl(url, path)renderer.RenderUrlAsPdf(url).SaveAs(path)URL conversion
converter.ConvertFile(htmlPath, pdfPath)renderer.RenderHtmlFileAsPdf(htmlPath).SaveAs(pdfPath)HTML file

Page Configuration Mappings

PDF Duo .NETIronPDFNotes
settings.PageSize = PageSize.A4RenderingOptions.PaperSize = PdfPaperSize.A4Paper size
settings.PageSize = PageSize.LetterRenderingOptions.PaperSize = PdfPaperSize.LetterUS Letter
settings.Orientation = LandscapeRenderingOptions.PaperOrientation = LandscapeOrientation
new Margins(top, right, bottom, left)Individual margin propertiesSee below

Margins Mappings

PDF Duo .NETIronPDFNotes
new Margins(top, right, bottom, left)Individual propertiesNo margins object
margins.TopRenderingOptions.MarginTopTop margin (mm)
margins.RightRenderingOptions.MarginRightRight margin (mm)
margins.BottomRenderingOptions.MarginBottomBottom margin (mm)
margins.LeftRenderingOptions.MarginLeftLeft margin (mm)

Document Operations Mappings

PDF Duo .NETIronPDFNotes
PDFDocument.Load(path)PdfDocument.FromFile(path)Load PDF
document.Save(path)pdf.SaveAs(path)Save PDF
document.ToBytes()pdf.BinaryDataGet byte array
new PdfMerger()PdfDocument.Merge()Static method
merger.AddFile(path)PdfDocument.FromFile(path)Load then merge
merger.Merge(output)merged.SaveAs(output)After merge

New Features Not Available in PDF Duo

FeatureIronPDF
Headers/FootersRenderingOptions.HtmlHeader, HtmlFooter
Page numbers{page}, {total-pages} placeholders
Watermarkspdf.ApplyWatermark(html)
Password protectionpdf.SecuritySettings
Form fillingpdf.Form.Fields
Digital signaturespdf.SignWithFile()
Text extractionpdf.ExtractAllText()
PDF to Imagepdf.RasterizeToImageFiles()

Code Migration Examples

Example 1: HTML to PDF Conversion

Before (PDF Duo):

// NuGet: Install-Package PDFDuo.NET
using PDFDuo;
using System;

class Program
{
    static void Main()
    {
        var converter = new HtmlToPdfConverter();
        var htmlContent = "<h1>Hello World</h1><p>This is a PDF document.</p>";
        converter.ConvertHtmlString(htmlContent, "output.pdf");
        Console.WriteLine("PDF created successfully!");
    }
}
// NuGet: Install-Package PDFDuo.NET
using PDFDuo;
using System;

class Program
{
    static void Main()
    {
        var converter = new HtmlToPdfConverter();
        var htmlContent = "<h1>Hello World</h1><p>This is a PDF document.</p>";
        converter.ConvertHtmlString(htmlContent, "output.pdf");
        Console.WriteLine("PDF created successfully!");
    }
}
$vbLabelText   $csharpLabel

After (IronPDF):

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

class Program
{
    static void Main()
    {
        var renderer = new ChromePdfRenderer();
        var htmlContent = "<h1>Hello World</h1><p>This is a PDF document.</p>";
        var pdf = renderer.RenderHtmlAsPdf(htmlContent);
        pdf.SaveAs("output.pdf");
        Console.WriteLine("PDF created successfully!");
    }
}
// NuGet: Install-Package IronPdf
using IronPdf;
using System;

class Program
{
    static void Main()
    {
        var renderer = new ChromePdfRenderer();
        var htmlContent = "<h1>Hello World</h1><p>This is a PDF document.</p>";
        var pdf = renderer.RenderHtmlAsPdf(htmlContent);
        pdf.SaveAs("output.pdf");
        Console.WriteLine("PDF created successfully!");
    }
}
$vbLabelText   $csharpLabel

The fundamental difference here is the API pattern. PDF Duo's HtmlToPdfConverter.ConvertHtmlString() takes both the HTML and output path in a single call, handling conversion and saving together. IronPDF's ChromePdfRenderer.RenderHtmlAsPdf() returns a PdfDocument object first, which you then save with SaveAs().

This object-oriented approach provides significant advantages: you can manipulate the PDF (add watermarks, merge documents, add security, extract text) before saving—none of which are possible with PDF Duo's direct-to-file approach. See the HTML to PDF documentation for additional rendering options.

Example 2: URL to PDF Conversion

Before (PDF Duo):

// NuGet: Install-Package PDFDuo.NET
using PDFDuo;
using System;

class Program
{
    static void Main()
    {
        var converter = new HtmlToPdfConverter();
        converter.ConvertUrl("https://www.example.com", "webpage.pdf");
        Console.WriteLine("Webpage converted to PDF!");
    }
}
// NuGet: Install-Package PDFDuo.NET
using PDFDuo;
using System;

class Program
{
    static void Main()
    {
        var converter = new HtmlToPdfConverter();
        converter.ConvertUrl("https://www.example.com", "webpage.pdf");
        Console.WriteLine("Webpage converted to PDF!");
    }
}
$vbLabelText   $csharpLabel

After (IronPDF):

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

class Program
{
    static void Main()
    {
        var renderer = new ChromePdfRenderer();
        var pdf = renderer.RenderUrlAsPdf("https://www.example.com");
        pdf.SaveAs("webpage.pdf");
        Console.WriteLine("Webpage converted to PDF!");
    }
}
// NuGet: Install-Package IronPdf
using IronPdf;
using System;

class Program
{
    static void Main()
    {
        var renderer = new ChromePdfRenderer();
        var pdf = renderer.RenderUrlAsPdf("https://www.example.com");
        pdf.SaveAs("webpage.pdf");
        Console.WriteLine("Webpage converted to PDF!");
    }
}
$vbLabelText   $csharpLabel

PDF Duo uses the same HtmlToPdfConverter class for URL conversion with ConvertUrl(url, outputPath). IronPDF uses ChromePdfRenderer with the dedicated RenderUrlAsPdf(url) method, returning a PdfDocument object.

A key advantage is that IronPDF's Chromium-based rendering engine provides modern CSS3 and JavaScript support, whereas PDF Duo's unknown rendering engine leaves CSS/JavaScript support uncertain and rendering quality unpredictable. Learn more about URL to PDF conversion.

Example 3: PDF Merging

Before (PDF Duo):

// NuGet: Install-Package PDFDuo.NET
using PDFDuo;
using System;

class Program
{
    static void Main()
    {
        var merger = new PdfMerger();
        merger.AddFile("document1.pdf");
        merger.AddFile("document2.pdf");
        merger.Merge("merged.pdf");
        Console.WriteLine("PDFs merged successfully!");
    }
}
// NuGet: Install-Package PDFDuo.NET
using PDFDuo;
using System;

class Program
{
    static void Main()
    {
        var merger = new PdfMerger();
        merger.AddFile("document1.pdf");
        merger.AddFile("document2.pdf");
        merger.Merge("merged.pdf");
        Console.WriteLine("PDFs merged successfully!");
    }
}
$vbLabelText   $csharpLabel

After (IronPDF):

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

class Program
{
    static void Main()
    {
        var pdf1 = PdfDocument.FromFile("document1.pdf");
        var pdf2 = PdfDocument.FromFile("document2.pdf");
        var merged = PdfDocument.Merge(pdf1, pdf2);
        merged.SaveAs("merged.pdf");
        Console.WriteLine("PDFs merged successfully!");
    }
}
// NuGet: Install-Package IronPdf
using IronPdf;
using System;

class Program
{
    static void Main()
    {
        var pdf1 = PdfDocument.FromFile("document1.pdf");
        var pdf2 = PdfDocument.FromFile("document2.pdf");
        var merged = PdfDocument.Merge(pdf1, pdf2);
        merged.SaveAs("merged.pdf");
        Console.WriteLine("PDFs merged successfully!");
    }
}
$vbLabelText   $csharpLabel

This example shows a fundamental architectural difference. PDF Duo uses a dedicated PdfMerger class with an AddFile() method to queue files, then Merge() to combine and save in one step.

IronPDF uses a different pattern: load each PDF as a PdfDocument using PdfDocument.FromFile(), then use the static PdfDocument.Merge() method to combine them. This returns a new PdfDocument object that you save separately with SaveAs().

The IronPDF approach provides more flexibility—you can manipulate any of the PDFs before merging, add watermarks to the merged result, apply security settings, and more. For merging many files, you can use LINQ:

var paths = new[] { "document1.pdf", "document2.pdf", "document3.pdf" };
var pdfs = paths.Select(PdfDocument.FromFile).ToList();
var merged = PdfDocument.Merge(pdfs);
merged.SaveAs("merged.pdf");
var paths = new[] { "document1.pdf", "document2.pdf", "document3.pdf" };
var pdfs = paths.Select(PdfDocument.FromFile).ToList();
var merged = PdfDocument.Merge(pdfs);
merged.SaveAs("merged.pdf");
$vbLabelText   $csharpLabel

Learn more about merging and splitting PDFs.


New Capabilities After Migration

After migrating to IronPDF, you gain capabilities that PDF Duo simply cannot provide:

Headers and Footers with Page Numbers

using IronPdf;

var renderer = new ChromePdfRenderer();

renderer.RenderingOptions.HtmlHeader = new HtmlHeaderFooter
{
    HtmlFragment = "<div style='text-align:center; font-size:10px;'>Company Report</div>",
    MaxHeight = 25
};

renderer.RenderingOptions.HtmlFooter = new HtmlHeaderFooter
{
    HtmlFragment = "<div style='text-align:center; font-size:10px;'>Page {page} of {total-pages}</div>",
    MaxHeight = 25
};

var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("report.pdf");
using IronPdf;

var renderer = new ChromePdfRenderer();

renderer.RenderingOptions.HtmlHeader = new HtmlHeaderFooter
{
    HtmlFragment = "<div style='text-align:center; font-size:10px;'>Company Report</div>",
    MaxHeight = 25
};

renderer.RenderingOptions.HtmlFooter = new HtmlHeaderFooter
{
    HtmlFragment = "<div style='text-align:center; font-size:10px;'>Page {page} of {total-pages}</div>",
    MaxHeight = 25
};

var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("report.pdf");
$vbLabelText   $csharpLabel

PDF Duo doesn't support headers or footers—there is no equivalent functionality. IronPDF provides full HTML/CSS support with built-in placeholders for dynamic content like page numbers. See the headers and footers guide.

Watermarks

using IronPdf;
using IronPdf.Editing;

var pdf = PdfDocument.FromFile("document.pdf");

pdf.ApplyWatermark(
    "<h1 style='color:red; opacity:0.3;'>CONFIDENTIAL</h1>",
    45,
    VerticalAlignment.Middle,
    HorizontalAlignment.Center);

pdf.SaveAs("watermarked.pdf");
using IronPdf;
using IronPdf.Editing;

var pdf = PdfDocument.FromFile("document.pdf");

pdf.ApplyWatermark(
    "<h1 style='color:red; opacity:0.3;'>CONFIDENTIAL</h1>",
    45,
    VerticalAlignment.Middle,
    HorizontalAlignment.Center);

pdf.SaveAs("watermarked.pdf");
$vbLabelText   $csharpLabel

PDF Duo doesn't support watermarks. IronPDF provides HTML-based watermarks with full CSS styling support.

Password Protection

var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SecuritySettings.UserPassword = "userpassword";
pdf.SecuritySettings.OwnerPassword = "ownerpassword";
pdf.SecuritySettings.AllowUserPrinting = IronPdf.Security.PdfPrintSecurity.FullPrintRights;
pdf.SaveAs("secured.pdf");
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SecuritySettings.UserPassword = "userpassword";
pdf.SecuritySettings.OwnerPassword = "ownerpassword";
pdf.SecuritySettings.AllowUserPrinting = IronPdf.Security.PdfPrintSecurity.FullPrintRights;
pdf.SaveAs("secured.pdf");
$vbLabelText   $csharpLabel

PDF Duo doesn't support password protection or security settings.

Text Extraction

var pdf = PdfDocument.FromFile("document.pdf");
string text = pdf.ExtractAllText();
var pdf = PdfDocument.FromFile("document.pdf");
string text = pdf.ExtractAllText();
$vbLabelText   $csharpLabel

PDF Duo doesn't support text extraction.


Critical Migration Notes

Margins Object to Individual Properties

PDF Duo uses a single Margins object; IronPDF uses individual properties:

// PDF Duo:
new Margins(top: 20, right: 15, bottom: 20, left: 15)

// IronPDF:
renderer.RenderingOptions.MarginTop = 20;
renderer.RenderingOptions.MarginRight = 15;
renderer.RenderingOptions.MarginBottom = 20;
renderer.RenderingOptions.MarginLeft = 15;
// PDF Duo:
new Margins(top: 20, right: 15, bottom: 20, left: 15)

// IronPDF:
renderer.RenderingOptions.MarginTop = 20;
renderer.RenderingOptions.MarginRight = 15;
renderer.RenderingOptions.MarginBottom = 20;
renderer.RenderingOptions.MarginLeft = 15;
$vbLabelText   $csharpLabel

Save Method Naming

Different method names for saving:

// PDF Duo:
document.Save("output.pdf");

// IronPDF:
pdf.SaveAs("output.pdf");
// PDF Duo:
document.Save("output.pdf");

// IronPDF:
pdf.SaveAs("output.pdf");
$vbLabelText   $csharpLabel

Loading PDFs

Different method names for loading:

// PDF Duo:
PDFDocument.Load("document.pdf")

// IronPDF:
PdfDocument.FromFile("document.pdf")
// PDF Duo:
PDFDocument.Load("document.pdf")

// IronPDF:
PdfDocument.FromFile("document.pdf")
$vbLabelText   $csharpLabel

Settings Object to Properties

PDF Duo uses settings objects passed to constructor; IronPDF uses properties:

// PDF Duo:
var settings = new PDFSettings { PageSize = PageSize.A4 };
var converter = new HtmlToPdfConverter(settings);

// IronPDF:
var renderer = new ChromePdfRenderer();
renderer.RenderingOptions.PaperSize = PdfPaperSize.A4;
// PDF Duo:
var settings = new PDFSettings { PageSize = PageSize.A4 };
var converter = new HtmlToPdfConverter(settings);

// IronPDF:
var renderer = new ChromePdfRenderer();
renderer.RenderingOptions.PaperSize = PdfPaperSize.A4;
$vbLabelText   $csharpLabel

Feature Comparison

FeaturePDF Duo .NETIronPDF
HTML to PDFBasicFull CSS3, JavaScript
URL to PDFBasicFull with auth support
PDF MergingYesYes
Headers/FootersNoFull HTML support
Page NumbersNoBuilt-in placeholders
WatermarksNoHTML-based
Password ProtectionNoFull security options
Form FillingNoYes
Digital SignaturesNoYes
Text ExtractionNoYes
PDF to ImagesNoYes
Async SupportUnknownFull async/await
.NET Core/5+UnknownFull support

Migration Checklist

Pre-Migration

  • Find all PDF Duo references in codebase
  • Document current settings (page size, margins, etc.)
  • List all PDF operations used
  • Identify opportunities for new features (headers, watermarks, security)
  • Obtain IronPDF license key

Package Changes

  • Remove PDFDuo.NET NuGet package
  • Install IronPdf NuGet package: dotnet add package IronPdf
  • Update namespace imports from using PDFDuo; to using IronPdf;

Code Changes

  • Add license key configuration at startup
  • Replace HtmlToPdfConverter with ChromePdfRenderer
  • Replace ConvertHtmlString(html, path) with RenderHtmlAsPdf(html).SaveAs(path)
  • Replace ConvertUrl(url, path) with RenderUrlAsPdf(url).SaveAs(path)
  • Replace PdfMerger pattern with PdfDocument.Merge() pattern
  • Convert Margins object to individual margin properties
  • Replace Save() with SaveAs()
  • Replace Load() with FromFile()

Post-Migration

  • Run regression tests comparing PDF output
  • Verify page sizes and margins match
  • Test with complex HTML/CSS (IronPDF's modern engine should handle it better)
  • Add new features (headers, footers, watermarks, security)
  • Update documentation

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