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:
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.
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.
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.
Limited Features: Basic functionality only—simple HTML to PDF and basic PDF merging with no advanced features like forms, security, or watermarks.
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.
- 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
- .NET Environment: .NET Framework 4.6.2+ or .NET Core 3.1+ / .NET 5/6/7/8/9+
- NuGet Access: Ability to install NuGet packages
- 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 IronPdfLicense 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";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" .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 | Notes |
|---|---|---|
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 .NET | IronPDF | Notes |
|---|---|---|
settings.PageSize = PageSize.A4 | RenderingOptions.PaperSize = PdfPaperSize.A4 | Paper size |
settings.PageSize = PageSize.Letter | RenderingOptions.PaperSize = PdfPaperSize.Letter | US Letter |
settings.Orientation = Landscape | RenderingOptions.PaperOrientation = Landscape | Orientation |
new Margins(top, right, bottom, left) | Individual margin properties | See below |
Margins Mappings
| PDF Duo .NET | IronPDF | Notes |
|---|---|---|
new Margins(top, right, bottom, left) | Individual properties | No margins object |
margins.Top | RenderingOptions.MarginTop | Top margin (mm) |
margins.Right | RenderingOptions.MarginRight | Right margin (mm) |
margins.Bottom | RenderingOptions.MarginBottom | Bottom margin (mm) |
margins.Left | RenderingOptions.MarginLeft | Left margin (mm) |
Document Operations Mappings
| PDF Duo .NET | IronPDF | Notes |
|---|---|---|
PDFDocument.Load(path) | PdfDocument.FromFile(path) | Load PDF |
document.Save(path) | pdf.SaveAs(path) | Save PDF |
document.ToBytes() | pdf.BinaryData | Get 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
| 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!");
}
}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!");
}
}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!");
}
}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!");
}
}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!");
}
}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!");
}
}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");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");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");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");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();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;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");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")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;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 | Full 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.NETNuGet package - Install
IronPdfNuGet package:dotnet add package IronPdf - Update namespace imports from
using PDFDuo;tousing IronPdf;
Code Changes
- Add license key configuration at startup
- Replace
HtmlToPdfConverterwithChromePdfRenderer - Replace
ConvertHtmlString(html, path)withRenderHtmlAsPdf(html).SaveAs(path) - Replace
ConvertUrl(url, path)withRenderUrlAsPdf(url).SaveAs(path) - Replace
PdfMergerpattern withPdfDocument.Merge()pattern - Convert
Marginsobject to individual margin properties - Replace
Save()withSaveAs() - Replace
Load()withFromFile()
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






