How to Migrate from DynamicPDF to IronPDF in C#
Why Migrate from DynamicPDF to IronPDF?
DynamicPDF's product fragmentation represents the primary driver for migration. Understanding the licensing model is essential for evaluating the true cost of your current implementation.
The Product Fragmentation Problem
DynamicPDF is sold as separate products with separate licenses:
- DynamicPDF Generator: Create PDFs from scratch
- DynamicPDF Merger: Merge, split, and manipulate existing PDFs (separate purchase)
- DynamicPDF Core Suite: Combined Generator and Merger
- DynamicPDF ReportWriter: Report generation
- DynamicPDF HTML Converter: HTML to PDF conversion (separate add-on)
- DynamicPDF Print Manager: Print PDFs programmatically
A complete PDF solution requires 3-5 separate licenses with DynamicPDF. IronPDF includes everything in one package.
Architecture Comparison
| Aspect | DynamicPDF | IronPDF |
|---|---|---|
| Product Model | Fragmented (5+ products) | All-in-one library |
| Licensing | Multiple licenses required | Single license |
| HTML to PDF | Separate add-on purchase | Built-in, Chromium-based |
| CSS Support | Limited (requires add-on) | Full CSS3 with Flexbox/Grid |
| API Style | Coordinate-based positioning | HTML/CSS + manipulation API |
| Learning Curve | Steep (multiple APIs) | Gentle (web technologies) |
| Modern .NET | .NET Standard 2.0 | .NET 6/7/8/9+ native |
Key Migration Benefits
- Single Package: One NuGet package replaces 3-5 DynamicPDF packages
- Modern Rendering: Chromium engine versus legacy rendering
- Web Technologies: Use HTML/CSS instead of coordinate-based positioning
- Simpler API: Less code, more readable, easier maintenance
- No Add-On Purchases: HTML, merging, security all included
Pre-Migration Preparation
Prerequisites
Ensure your environment meets these requirements:
- .NET Framework 4.6.2+ or .NET Core 3.1 / .NET 5-9
- Visual Studio 2019+ or VS Code with C# extension
- NuGet Package Manager access
- IronPDF license key (free trial available at ironpdf.com)
Audit DynamicPDF Usage
Run these commands in your solution directory to identify all DynamicPDF references:
# Find all DynamicPDF references
grep -r "ceTe.DynamicPDF\|DynamicPDF" --include="*.cs" --include="*.csproj" .
# Check NuGet packages
dotnet list package | grep -i dynamic# Find all DynamicPDF references
grep -r "ceTe.DynamicPDF\|DynamicPDF" --include="*.cs" --include="*.csproj" .
# Check NuGet packages
dotnet list package | grep -i dynamicCommon packages to look for:
ceTe.DynamicPDF.CoreSuite.NETceTe.DynamicPDF.Generator.NETceTe.DynamicPDF.Merger.NETceTe.DynamicPDF.HtmlConverter.NET
Understanding the Paradigm Shift
The most significant change when migrating from DynamicPDF to IronPDF is the fundamental approach to document creation. DynamicPDF uses coordinate-based positioning where you place elements at specific X,Y coordinates on a page. IronPDF uses HTML/CSS rendering where you design with web technologies.
This paradigm shift means converting Label, TextArea, and Table2 elements to their HTML equivalents—a change that typically results in more readable, maintainable code.
Step-by-Step Migration Process
Step 1: Update NuGet Packages
Remove all DynamicPDF packages and install IronPDF:
# Remove DynamicPDF packages
dotnet remove package ceTe.DynamicPDF.CoreSuite.NET
dotnet remove package ceTe.DynamicPDF.Generator.NET
dotnet remove package ceTe.DynamicPDF.Merger.NET
dotnet remove package ceTe.DynamicPDF.HtmlConverter.NET
# Install IronPDF
dotnet add package IronPdf# Remove DynamicPDF packages
dotnet remove package ceTe.DynamicPDF.CoreSuite.NET
dotnet remove package ceTe.DynamicPDF.Generator.NET
dotnet remove package ceTe.DynamicPDF.Merger.NET
dotnet remove package ceTe.DynamicPDF.HtmlConverter.NET
# Install IronPDF
dotnet add package IronPdfStep 2: Update Namespace References
Replace DynamicPDF namespaces with IronPDF:
// Remove these
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.Merger;
using ceTe.DynamicPDF.Conversion;
// Add this
using IronPdf;// Remove these
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.Merger;
using ceTe.DynamicPDF.Conversion;
// Add this
using IronPdf;Step 3: Configure License
// 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";Complete API Migration Reference
Core Class Mapping
| DynamicPDF Class | IronPDF Equivalent | Notes |
|---|---|---|
Document | ChromePdfRenderer | For generating new PDFs |
Document | PdfDocument | For manipulating existing PDFs |
Page | HTML <div> with page-break | Or multiple renders |
MergeDocument | PdfDocument.Merge() | Static merge method |
HtmlConverter | ChromePdfRenderer | Built-in, no add-on |
Page Elements to HTML Mapping
| DynamicPDF PageElement | IronPDF/HTML Equivalent |
|---|---|
Label | <p>, <span>, <div> |
TextArea | <div>, <p> with CSS |
Image | <img> tag |
Table2 | HTML <table> |
PageNumberingLabel | {page} / {total-pages} placeholders |
Key API Mappings
| DynamicPDF | IronPDF | Notes |
|---|---|---|
Document + Page | ChromePdfRenderer | HTML-based generation |
Label, TextArea | HTML <p>, <div> | Style with CSS |
Table2 | HTML <table> | Full CSS styling |
MergeDocument | PdfDocument.Merge() | Static method |
HtmlConverter | ChromePdfRenderer | Built-in, no add-on |
document.Draw() | pdf.SaveAs() / pdf.BinaryData | |
PageNumberingLabel %%CP%% | {page} placeholder | Different syntax |
Code Migration Examples
HTML to PDF Conversion
The HTML to PDF conversion demonstrates DynamicPDF's requirement for a separate HtmlConverter add-on versus IronPDF's built-in Chromium rendering.
DynamicPDF Implementation:
// NuGet: Install-Package ceTe.DynamicPDF.CoreSuite.NET
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.Conversion;
class Program
{
static void Main()
{
string html = "<html><body><h1>Hello World</h1></body></html>";
HtmlConverter converter = new HtmlConverter(html);
converter.Convert("output.pdf");
}
}// NuGet: Install-Package ceTe.DynamicPDF.CoreSuite.NET
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.Conversion;
class Program
{
static void Main()
{
string html = "<html><body><h1>Hello World</h1></body></html>";
HtmlConverter converter = new HtmlConverter(html);
converter.Convert("output.pdf");
}
}IronPDF Implementation:
// NuGet: Install-Package IronPdf
using IronPdf;
class Program
{
static void Main()
{
string html = "<html><body><h1>Hello World</h1></body></html>";
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("output.pdf");
}
}// NuGet: Install-Package IronPdf
using IronPdf;
class Program
{
static void Main()
{
string html = "<html><body><h1>Hello World</h1></body></html>";
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("output.pdf");
}
}IronPDF's ChromePdfRenderer provides Chromium-based rendering with full CSS3 support—no separate add-on purchase required. For more options, see the HTML to PDF documentation.
Merging Multiple PDFs
PDF merging demonstrates the difference between DynamicPDF's MergeDocument class (requiring the Merger product license) and IronPDF's built-in static Merge method.
DynamicPDF Implementation:
// NuGet: Install-Package ceTe.DynamicPDF.CoreSuite.NET
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.Merger;
class Program
{
static void Main()
{
MergeDocument document = new MergeDocument("document1.pdf");
document.Append("document2.pdf");
document.Draw("merged.pdf");
}
}// NuGet: Install-Package ceTe.DynamicPDF.CoreSuite.NET
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.Merger;
class Program
{
static void Main()
{
MergeDocument document = new MergeDocument("document1.pdf");
document.Append("document2.pdf");
document.Draw("merged.pdf");
}
}IronPDF Implementation:
// NuGet: Install-Package IronPdf
using IronPdf;
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");
}
}// NuGet: Install-Package IronPdf
using IronPdf;
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");
}
}IronPDF's static Merge method accepts multiple PdfDocument objects directly. For more options, see the PDF merging documentation.
Adding Text to PDFs
Text placement demonstrates the paradigm shift from DynamicPDF's coordinate-based Label elements to IronPDF's HTML-based TextStamper.
DynamicPDF Implementation:
// NuGet: Install-Package ceTe.DynamicPDF.CoreSuite.NET
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
class Program
{
static void Main()
{
Document document = new Document();
Page page = new Page(PageSize.Letter);
Label label = new Label("Hello from DynamicPDF!", 0, 0, 504, 100);
page.Elements.Add(label);
document.Pages.Add(page);
document.Draw("output.pdf");
}
}// NuGet: Install-Package ceTe.DynamicPDF.CoreSuite.NET
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
class Program
{
static void Main()
{
Document document = new Document();
Page page = new Page(PageSize.Letter);
Label label = new Label("Hello from DynamicPDF!", 0, 0, 504, 100);
page.Elements.Add(label);
document.Pages.Add(page);
document.Draw("output.pdf");
}
}IronPDF Implementation:
// NuGet: Install-Package IronPdf
using IronPdf;
using IronPdf.Editing;
class Program
{
static void Main()
{
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf("<html><body></body></html>");
var textStamper = new TextStamper()
{
Text = "Hello from IronPDF!",
FontSize = 20,
VerticalAlignment = VerticalAlignment.Top
};
pdf.ApplyStamp(textStamper);
pdf.SaveAs("output.pdf");
}
}// NuGet: Install-Package IronPdf
using IronPdf;
using IronPdf.Editing;
class Program
{
static void Main()
{
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf("<html><body></body></html>");
var textStamper = new TextStamper()
{
Text = "Hello from IronPDF!",
FontSize = 20,
VerticalAlignment = VerticalAlignment.Top
};
pdf.ApplyStamp(textStamper);
pdf.SaveAs("output.pdf");
}
}IronPDF's TextStamper provides alignment-based positioning rather than coordinate-based placement, making layouts more adaptable across different page sizes. For more options, see the watermarks and stamping documentation.
Complete Document Generation Example
This comprehensive example shows converting a DynamicPDF document with multiple elements to IronPDF's HTML approach.
DynamicPDF Implementation:
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.Merger;
// Generation (requires Generator license)
Document document = new Document();
Page page = new Page(PageSize.A4);
Label title = new Label("Invoice Report", 0, 0, 595, 30, Font.HelveticaBold, 18);
title.Align = TextAlign.Center;
page.Elements.Add(title);
Table2 table = new Table2(40, 60, 515, 500);
// ... complex table setup with columns, rows, cells...
page.Elements.Add(table);
document.Pages.Add(page);
document.Draw("invoice.pdf");
// Merging (requires Merger license)
MergeDocument mergeDoc = new MergeDocument("cover.pdf");
mergeDoc.Append("invoice.pdf");
mergeDoc.Draw("final.pdf");using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.Merger;
// Generation (requires Generator license)
Document document = new Document();
Page page = new Page(PageSize.A4);
Label title = new Label("Invoice Report", 0, 0, 595, 30, Font.HelveticaBold, 18);
title.Align = TextAlign.Center;
page.Elements.Add(title);
Table2 table = new Table2(40, 60, 515, 500);
// ... complex table setup with columns, rows, cells...
page.Elements.Add(table);
document.Pages.Add(page);
document.Draw("invoice.pdf");
// Merging (requires Merger license)
MergeDocument mergeDoc = new MergeDocument("cover.pdf");
mergeDoc.Append("invoice.pdf");
mergeDoc.Draw("final.pdf");IronPDF Implementation:
using IronPdf;
var renderer = new ChromePdfRenderer();
// All features in one library
var html = @"
<html>
<head>
<style>
body { font-family: Helvetica, sans-serif; padding: 40px; }
h1 { text-align: center; font-size: 18pt; }
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { border: 1px solid #ccc; padding: 8px; }
</style>
</head>
<body>
<h1>Invoice Report</h1>
<table>
<tr><th>Product</th><th>Qty</th><th>Price</th></tr>
<tr><td>Widget</td><td>10</td><td>$99.99</td></tr>
</table>
</body>
</html>";
var invoice = renderer.RenderHtmlAsPdf(html);
// Merging included - no separate license
var cover = PdfDocument.FromFile("cover.pdf");
var final = PdfDocument.Merge(cover, invoice);
final.SaveAs("final.pdf");using IronPdf;
var renderer = new ChromePdfRenderer();
// All features in one library
var html = @"
<html>
<head>
<style>
body { font-family: Helvetica, sans-serif; padding: 40px; }
h1 { text-align: center; font-size: 18pt; }
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { border: 1px solid #ccc; padding: 8px; }
</style>
</head>
<body>
<h1>Invoice Report</h1>
<table>
<tr><th>Product</th><th>Qty</th><th>Price</th></tr>
<tr><td>Widget</td><td>10</td><td>$99.99</td></tr>
</table>
</body>
</html>";
var invoice = renderer.RenderHtmlAsPdf(html);
// Merging included - no separate license
var cover = PdfDocument.FromFile("cover.pdf");
var final = PdfDocument.Merge(cover, invoice);
final.SaveAs("final.pdf");Critical Migration Notes
Coordinate-Based to HTML/CSS Positioning
The fundamental paradigm shift requires converting X,Y coordinate positioning to CSS-based layouts:
// DynamicPDF - coordinate-based
var label = new Label("Hello World", 100, 200, 300, 50);
// IronPDF - CSS positioning (if absolute positioning needed)
var html = "<div style='position:absolute; left:100px; top:200px; width:300px;'>Hello World</div>";
// IronPDF - preferred approach (flow-based)
var html = "<div style='margin-left:100px; margin-top:200px;'>Hello World</div>";// DynamicPDF - coordinate-based
var label = new Label("Hello World", 100, 200, 300, 50);
// IronPDF - CSS positioning (if absolute positioning needed)
var html = "<div style='position:absolute; left:100px; top:200px; width:300px;'>Hello World</div>";
// IronPDF - preferred approach (flow-based)
var html = "<div style='margin-left:100px; margin-top:200px;'>Hello World</div>";Page Numbering Syntax
DynamicPDF and IronPDF use different placeholder syntax for page numbers:
// DynamicPDF placeholders
"Page %%CP%% of %%TP%%"
// IronPDF placeholders
"Page {page} of {total-pages}"// DynamicPDF placeholders
"Page %%CP%% of %%TP%%"
// IronPDF placeholders
"Page {page} of {total-pages}"Headers and Footers
Convert DynamicPDF Template elements to IronPDF HtmlHeaderFooter:
// IronPDF header/footer
renderer.RenderingOptions.HtmlHeader = new HtmlHeaderFooter()
{
HtmlFragment = "<div style='text-align:center;'>Page {page} of {total-pages}</div>",
MaxHeight = 25
};// IronPDF header/footer
renderer.RenderingOptions.HtmlHeader = new HtmlHeaderFooter()
{
HtmlFragment = "<div style='text-align:center;'>Page {page} of {total-pages}</div>",
MaxHeight = 25
};For more header/footer options, see the headers and footers documentation.
Security Settings
// IronPDF security
pdf.SecuritySettings.OwnerPassword = "ownerPassword";
pdf.SecuritySettings.UserPassword = "userPassword";// IronPDF security
pdf.SecuritySettings.OwnerPassword = "ownerPassword";
pdf.SecuritySettings.UserPassword = "userPassword";For comprehensive security options, see the encryption documentation.
Post-Migration Checklist
After completing the code migration, verify the following:
- Visual comparison of generated PDFs
- Verify text positioning and layout
- Test table rendering and overflow
- Verify headers/footers on all pages
- Test form filling functionality
- Verify security/encryption
- Performance benchmarking
- Remove unused DynamicPDF license files
- Update documentation
Future-Proofing Your PDF Infrastructure
With .NET 10 on the horizon and C# 14 introducing new language features, choosing a PDF library that embraces modern .NET patterns ensures long-term compatibility. IronPDF's native support for .NET 6/7/8/9+ provides a clear path forward as projects extend into 2025 and 2026—without the complexity of managing multiple product licenses or navigating fragmented APIs.
Additional Resources
Migrating from DynamicPDF to IronPDF eliminates the complexity of managing multiple product licenses while providing modern Chromium-based rendering and full CSS3 support. The transition from coordinate-based positioning to HTML/CSS design typically results in more maintainable code that leverages familiar web technologies.






