푸터 콘텐츠로 바로가기
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

Aspect PDF Duo .NET IronPDF
Maintenance Unknown/Inactive Active, regular updates
Documentation Sparse/Missing Comprehensive
Support None Professional support team
Community ~0 users 41M+ NuGet downloads
Rendering Unknown engine Modern Chromium
Features Basic Full-featured
Stability Unknown Production-proven
Licensing Unclear Transparent

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 .NET IronPDF
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 .NET IronPDF
new HtmlToPdfConverter() new ChromePdfRenderer()
converter.ConvertHtmlString(html, path) renderer.RenderHtmlAsPdf(html).SaveAs(path)
converter.ConvertUrl(url, path) renderer.RenderUrlAsPdf(url).SaveAs(path)
converter.ConvertFile(htmlPath, pdfPath) renderer.RenderHtmlFileAsPdf(htmlPath).SaveAs(pdfPath)

Page Configuration Mappings

PDF Duo .NET IronPDF
settings.PageSize = PageSize.A4 RenderingOptions.PaperSize = PdfPaperSize.A4
settings.PageSize = PageSize.Letter RenderingOptions.PaperSize = PdfPaperSize.Letter
settings.Orientation = Landscape RenderingOptions.PaperOrientation = Landscape
new Margins(top, right, bottom, left) Individual margin properties

Margins Mappings

PDF Duo .NET IronPDF
new Margins(top, right, bottom, left) Individual properties
margins.Top RenderingOptions.MarginTop
margins.Right RenderingOptions.MarginRight
margins.Bottom RenderingOptions.MarginBottom
margins.Left RenderingOptions.MarginLeft

Document Operations Mappings

PDF Duo .NET IronPDF
PDFDocument.Load(path) PdfDocument.FromFile(path)
document.Save(path) pdf.SaveAs(path)
document.ToBytes() pdf.BinaryData
new PdfMerger() PdfDocument.Merge()
merger.AddFile(path) PdfDocument.FromFile(path)
merger.Merge(output) merged.SaveAs(output)

New Features Not Available in PDF Duo

Feature IronPDF
Headers/Footers RenderingOptions.HtmlHeader, HtmlFooter
Page numbers {page}, {total-pages} placeholders
Watermarks pdf.ApplyWatermark(html)
Password protection pdf.SecuritySettings
Form filling pdf.Form.Fields
Digital signatures pdf.SignWithFile()
Text extraction pdf.ExtractAllText()
PDF to Image pdf.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

Feature PDF Duo .NET IronPDF
HTML to PDF Basic Full CSS3, JavaScript
URL to PDF Basic Full with auth support
PDF Merging Yes Yes
Headers/Footers No Full HTML support
Page Numbers No Built-in placeholders
Watermarks No HTML-based
Password Protection No Full security options
Form Filling No Yes
Digital Signatures No Yes
Text Extraction No Yes
PDF to Images No Yes
Async Support Unknown Full async/await
.NET Core/5+ Unknown Supported

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

커티스 차우
기술 문서 작성자

커티스 차우는 칼턴 대학교에서 컴퓨터 과학 학사 학위를 취득했으며, Node.js, TypeScript, JavaScript, React를 전문으로 하는 프론트엔드 개발자입니다. 직관적이고 미적으로 뛰어난 사용자 인터페이스를 만드는 데 열정을 가진 그는 최신 프레임워크를 활용하고, 잘 구성되고 시각적으로 매력적인 매뉴얼을 제작하는 것을 즐깁니다.

커티스는 개발 분야 외에도 사물 인터넷(IoT)에 깊은 관심을 가지고 있으며, 하드웨어와 소프트웨어를 통합하는 혁신적인 방법을 연구합니다. 여가 시간에는 게임을 즐기거나 디스코드 봇을 만들면서 기술에 대한 애정과 창의성을 결합합니다.