How to Migrate from Adobe PDF Library SDK to IronPDF
The Adobe PDF Library SDK, available through Datalogics, provides the authentic Adobe PDF engine with high-level capabilities. However, the high licensing costs, complex native SDK integration, and low-level API design make it impractical for many development teams. This guide offers a step-by-step migration path from Adobe PDF Library SDK to IronPDF—a modern, cost-effective .NET PDF library supporting .NET Framework 4.6.2 through .NET 9 and future versions.
Why Consider Moving Away from Adobe PDF Library SDK?
While the Adobe PDF Library SDK offers the genuine Adobe PDF engine, several factors lead development teams to explore alternatives for their PDF generation and manipulation needs.
High Licensing Costs
The Adobe PDF Library SDK operates at enterprise pricing levels, typically ranging from $10,000 to $50,000+ annually. This cost structure makes the SDK impractical for small to mid-sized businesses, startups, individual developers, and projects where full Adobe engine capabilities aren't essential.
Complex Native SDK Integration
The Adobe PDF Library SDK is built on native C++ code requiring platform-specific binaries. Developers must carefully manage memory, handle explicit initialization and termination patterns, and work through intricate setup procedures. This adds significant development overhead and complicates CI/CD pipelines.
Low-Level API Design
Creating PDFs with Adobe PDF Library SDK involves constructing pages, content streams, text runs, and fonts programmatically. Simple tasks like rendering HTML content become multi-step operations involving coordinate calculations, font embedding, and manual content element management.
Library Lifecycle Management Overhead
Every operation requires wrapping code in Library.Initialize() and Library.Terminate() blocks with careful COM object disposal. Forgetting cleanup steps leads to resource leaks and application instability.
Overkill for Typical Projects
For applications primarily needing HTML-to-PDF conversion, basic document manipulation, or report generation, the full Adobe PDF engine represents significant over-engineering where simpler solutions deliver equivalent results.
Adobe PDF Library SDK vs. IronPDF: Key Differences
Understanding the fundamental architectural differences between these libraries helps plan an effective migration strategy.
| Aspect | Adobe PDF Library SDK | IronPDF |
|---|---|---|
| Pricing | $10K-$50K+/year enterprise | Affordable per-developer licensing |
| Installation | Native DLLs, platform-specific | Simple NuGet package |
| Document Creation | Low-level page/content construction | HTML/CSS rendering |
| Initialization | Library.Initialize()/Terminate() required | Automatic |
| Coordinate System | PostScript points, bottom-left origin | CSS-based layout |
| Font Handling | Manual embedding required | Automatic |
| Memory Management | Manual disposal of COM objects | Standard IDisposable pattern |
| Async Support | Not available | Full async/await support |
Pre-Migration Preparation
Prerequisites
Ensure your environment meets these requirements before beginning migration:
- .NET Framework 4.6.2+ or .NET Core 3.1 / .NET 5-9
- Visual Studio 2019+ or JetBrains Rider
- NuGet Package Manager access
- IronPDF license key (free trial available at ironpdf.com)
Audit Adobe PDF Library SDK Usage
Run these commands in your solution directory to identify all Adobe PDF Library SDK references:
grep -r "using Datalogics" --include="*.cs" .
grep -r "Adobe.PDF.Library" --include="*.csproj" .
grep -r "Library.Initialize\|Library.Terminate" --include="*.cs" .grep -r "using Datalogics" --include="*.cs" .
grep -r "Adobe.PDF.Library" --include="*.csproj" .
grep -r "Library.Initialize\|Library.Terminate" --include="*.cs" .Breaking Changes to Anticipate
| Category | Adobe PDF Library SDK | IronPDF | Migration Action |
|---|---|---|---|
| Initialization | Library.Initialize() / Terminate() | Automatic | Remove lifecycle code |
| Document Creation | new Document() with page construction | ChromePdfRenderer | Use HTML rendering |
| Coordinate System | PostScript points, bottom-left origin | CSS-based layout | Use HTML/CSS |
| Font Handling | Manual Font creation and embedding | Automatic | Remove font code |
| Memory Management | Manual disposal of COM objects | Standard IDisposable | Use using statements |
| Page Construction | CreatePage(), AddContent() | Automatic from HTML | Simplify significantly |
Step-by-Step Migration Process
Step 1: Update NuGet Packages
Remove the Adobe PDF Library SDK package and install IronPDF:
# Remove Adobe PDF Library
dotnet remove package Adobe.PDF.Library.LM.NET
# Install IronPDF
dotnet add package IronPdf# Remove Adobe PDF Library
dotnet remove package Adobe.PDF.Library.LM.NET
# Install IronPDF
dotnet add package IronPdfStep 2: Configure the License Key
Replace Adobe's licensing with IronPDF's code-based license key:
// Replace Adobe's Library.LicenseKey with IronPDF license
// Add at application startup, before any IronPDF operations
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
// Verify license status
bool isLicensed = IronPdf.License.IsLicensed;// Replace Adobe's Library.LicenseKey with IronPDF license
// Add at application startup, before any IronPDF operations
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
// Verify license status
bool isLicensed = IronPdf.License.IsLicensed;' Replace Adobe's Library.LicenseKey with IronPDF license
' Add at application startup, before any IronPDF operations
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY"
' Verify license status
Dim isLicensed As Boolean = IronPdf.License.IsLicensedStep 3: Update Namespace References
Perform a global find-and-replace across your solution:
| Find | Replace With |
|---|---|
using Datalogics.PDFL; | using IronPdf; |
using Datalogics.PDFL.Document; | using IronPdf; |
using Datalogics.PDFL.Page; | using IronPdf; |
using Datalogics.PDFL.Content; | using IronPdf; |
Step 4: Remove Library Lifecycle Code
One of the most significant simplifications involves removing initialization and termination patterns:
// Adobe PDF Library SDK - REMOVE THIS PATTERN
Library.Initialize();
try
{
// PDF operations
}
finally
{
Library.Terminate(); // Must always terminate
}
// IronPDF - Just use directly
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf(html);// Adobe PDF Library SDK - REMOVE THIS PATTERN
Library.Initialize();
try
{
// PDF operations
}
finally
{
Library.Terminate(); // Must always terminate
}
// IronPDF - Just use directly
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf(html);Imports AdobePDFLibrary
Imports IronPdf
' Adobe PDF Library SDK - REMOVE THIS PATTERN
Library.Initialize()
Try
' PDF operations
Finally
Library.Terminate() ' Must always terminate
End Try
' IronPDF - Just use directly
Dim renderer As New ChromePdfRenderer()
Dim pdf = renderer.RenderHtmlAsPdf(html)Complete API Migration Reference
Library Lifecycle Methods
| Adobe Method | IronPDF Equivalent |
|---|---|
Library.Initialize() | Not needed |
Library.Terminate() | Not needed |
Library.LicenseKey = "KEY" | IronPdf.License.LicenseKey = "KEY" |
using (Library lib = new Library()) | Not needed |
Document Creation Methods
| Adobe Method | IronPDF Method |
|---|---|
new Document() | new ChromePdfRenderer() |
new Document(path) | PdfDocument.FromFile(path) |
doc.CreatePage(index, rect) | Automatic from HTML |
doc.Save(SaveFlags.Full, path) | pdf.SaveAs(path) |
doc.NumPages | pdf.PageCount |
doc.GetPage(index) | pdf.Pages[index] |
doc.InsertPages(...) | PdfDocument.Merge() |
Content Creation (Major Paradigm Shift)
Adobe PDF Library SDK requires low-level content construction. IronPDF uses HTML/CSS:
| Adobe Method | IronPDF Method |
|---|---|
new Text() | Use HTML <p>, <h1>, etc. |
text.AddRun(textRun) | Use HTML |
new TextRun(text, font, size, point) | CSS styling |
new Font(name, flags) | CSS font-family |
new Image(path) | HTML <img> tag |
content.AddElement(...) | HTML content |
page.UpdateContent() | Not needed |
Watermark and Security Methods
| Adobe Method | IronPDF Method |
|---|---|
new Watermark(doc, textParams, wmParams) | pdf.ApplyWatermark(html) |
WatermarkParams.Opacity | CSS opacity |
new EncryptionHandler(user, owner, perms) | pdf.SecuritySettings |
PermissionFlags.PrintDoc | AllowUserPrinting |
Text Extraction
| Adobe Method | IronPDF Method |
|---|---|
new WordFinder(doc, config) | pdf.ExtractAllText() |
wordFinder.GetWordList() | pdf.Pages[i].Text |
| Complex word/character iteration | Single method call |
Code Migration Examples
HTML to PDF Conversion
The most dramatic simplification occurs when converting content to PDF. Adobe PDF Library SDK requires manual page construction, font embedding, and coordinate positioning.
Adobe PDF Library SDK Implementation:
// Adobe PDF Library SDK
using Datalogics.PDFL;
using System;
class AdobeHtmlToPdf
{
static void Main()
{
using (Library lib = new Library())
{
// Adobe PDF Library requires complex setup with HTML conversion parameters
HTMLConversionParameters htmlParams = new HTMLConversionParameters();
htmlParams.PaperSize = PaperSize.Letter;
htmlParams.Orientation = Orientation.Portrait;
string htmlContent = "<html><body><h1>Hello World</h1></body></html>";
// Convert HTML to PDF
Document doc = Document.CreateFromHTML(htmlContent, htmlParams);
doc.Save(SaveFlags.Full, "output.pdf");
doc.Dispose();
}
}
}// Adobe PDF Library SDK
using Datalogics.PDFL;
using System;
class AdobeHtmlToPdf
{
static void Main()
{
using (Library lib = new Library())
{
// Adobe PDF Library requires complex setup with HTML conversion parameters
HTMLConversionParameters htmlParams = new HTMLConversionParameters();
htmlParams.PaperSize = PaperSize.Letter;
htmlParams.Orientation = Orientation.Portrait;
string htmlContent = "<html><body><h1>Hello World</h1></body></html>";
// Convert HTML to PDF
Document doc = Document.CreateFromHTML(htmlContent, htmlParams);
doc.Save(SaveFlags.Full, "output.pdf");
doc.Dispose();
}
}
}Imports Datalogics.PDFL
Imports System
Class AdobeHtmlToPdf
Shared Sub Main()
Using lib As New Library()
' Adobe PDF Library requires complex setup with HTML conversion parameters
Dim htmlParams As New HTMLConversionParameters()
htmlParams.PaperSize = PaperSize.Letter
htmlParams.Orientation = Orientation.Portrait
Dim htmlContent As String = "<html><body><h1>Hello World</h1></body></html>"
' Convert HTML to PDF
Dim doc As Document = Document.CreateFromHTML(htmlContent, htmlParams)
doc.Save(SaveFlags.Full, "output.pdf")
doc.Dispose()
End Using
End Sub
End ClassIronPDF Implementation:
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class IronPdfHtmlToPdf
{
static void Main()
{
var renderer = new ChromePdfRenderer();
string htmlContent = "<html><body><h1>Hello World</h1></body></html>";
// Convert HTML to PDF with simple API
var pdf = renderer.RenderHtmlAsPdf(htmlContent);
pdf.SaveAs("output.pdf");
}
}// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class IronPdfHtmlToPdf
{
static void Main()
{
var renderer = new ChromePdfRenderer();
string htmlContent = "<html><body><h1>Hello World</h1></body></html>";
// Convert HTML to PDF with simple API
var pdf = renderer.RenderHtmlAsPdf(htmlContent);
pdf.SaveAs("output.pdf");
}
}Imports IronPdf
Imports System
Class IronPdfHtmlToPdf
Shared Sub Main()
Dim renderer = New ChromePdfRenderer()
Dim htmlContent As String = "<html><body><h1>Hello World</h1></body></html>"
' Convert HTML to PDF with simple API
Dim pdf = renderer.RenderHtmlAsPdf(htmlContent)
pdf.SaveAs("output.pdf")
End Sub
End ClassIronPDF eliminates the library lifecycle wrapper, conversion parameter objects, and explicit disposal. The ChromePdfRenderer uses a Chromium-based engine for pixel-perfect CSS and JavaScript support. For advanced scenarios, see the HTML to PDF documentation.
Merging Multiple PDFs
PDF merging demonstrates the API complexity difference clearly.
Adobe PDF Library SDK Implementation:
// Adobe PDF Library SDK
using Datalogics.PDFL;
using System;
class AdobeMergePdfs
{
static void Main()
{
using (Library lib = new Library())
{
// Open first PDF document
Document doc1 = new Document("document1.pdf");
Document doc2 = new Document("document2.pdf");
// Insert pages from second document into first
PageInsertParams insertParams = new PageInsertParams();
insertParams.InsertFlags = PageInsertFlags.None;
for (int i = 0; i < doc2.NumPages; i++)
{
Page page = doc2.GetPage(i);
doc1.InsertPage(doc1.NumPages - 1, page, insertParams);
}
doc1.Save(SaveFlags.Full, "merged.pdf");
doc1.Dispose();
doc2.Dispose();
}
}
}// Adobe PDF Library SDK
using Datalogics.PDFL;
using System;
class AdobeMergePdfs
{
static void Main()
{
using (Library lib = new Library())
{
// Open first PDF document
Document doc1 = new Document("document1.pdf");
Document doc2 = new Document("document2.pdf");
// Insert pages from second document into first
PageInsertParams insertParams = new PageInsertParams();
insertParams.InsertFlags = PageInsertFlags.None;
for (int i = 0; i < doc2.NumPages; i++)
{
Page page = doc2.GetPage(i);
doc1.InsertPage(doc1.NumPages - 1, page, insertParams);
}
doc1.Save(SaveFlags.Full, "merged.pdf");
doc1.Dispose();
doc2.Dispose();
}
}
}Imports Datalogics.PDFL
Imports System
Class AdobeMergePdfs
Shared Sub Main()
Using lib As New Library()
' Open first PDF document
Dim doc1 As New Document("document1.pdf")
Dim doc2 As New Document("document2.pdf")
' Insert pages from second document into first
Dim insertParams As New PageInsertParams()
insertParams.InsertFlags = PageInsertFlags.None
For i As Integer = 0 To doc2.NumPages - 1
Dim page As Page = doc2.GetPage(i)
doc1.InsertPage(doc1.NumPages - 1, page, insertParams)
Next
doc1.Save(SaveFlags.Full, "merged.pdf")
doc1.Dispose()
doc2.Dispose()
End Using
End Sub
End ClassIronPDF Implementation:
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class IronPdfMergePdfs
{
static void Main()
{
// Load PDF documents
var pdf1 = PdfDocument.FromFile("document1.pdf");
var pdf2 = PdfDocument.FromFile("document2.pdf");
// Merge PDFs with simple method
var merged = PdfDocument.Merge(pdf1, pdf2);
merged.SaveAs("merged.pdf");
}
}// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class IronPdfMergePdfs
{
static void Main()
{
// Load PDF documents
var pdf1 = PdfDocument.FromFile("document1.pdf");
var pdf2 = PdfDocument.FromFile("document2.pdf");
// Merge PDFs with simple method
var merged = PdfDocument.Merge(pdf1, pdf2);
merged.SaveAs("merged.pdf");
}
}Imports IronPdf
Imports System
Class IronPdfMergePdfs
Shared Sub Main()
' Load PDF documents
Dim pdf1 = PdfDocument.FromFile("document1.pdf")
Dim pdf2 = PdfDocument.FromFile("document2.pdf")
' Merge PDFs with simple method
Dim merged = PdfDocument.Merge(pdf1, pdf2)
merged.SaveAs("merged.pdf")
End Sub
End ClassAdobe's approach requires page-by-page iteration with insertion parameters. IronPDF provides a single Merge method that accepts multiple documents.
Adding Watermarks
Watermarking illustrates how IronPDF leverages HTML/CSS for styling flexibility.
Adobe PDF Library SDK Implementation:
// Adobe PDF Library SDK
using Datalogics.PDFL;
using System;
class AdobeAddWatermark
{
static void Main()
{
using (Library lib = new Library())
{
Document doc = new Document("input.pdf");
// Create watermark with complex API
WatermarkParams watermarkParams = new WatermarkParams();
watermarkParams.Opacity = 0.5;
watermarkParams.Rotation = 45.0;
watermarkParams.VerticalAlignment = WatermarkVerticalAlignment.Center;
watermarkParams.HorizontalAlignment = WatermarkHorizontalAlignment.Center;
WatermarkTextParams textParams = new WatermarkTextParams();
textParams.Text = "CONFIDENTIAL";
Watermark watermark = new Watermark(doc, textParams, watermarkParams);
doc.Save(SaveFlags.Full, "watermarked.pdf");
doc.Dispose();
}
}
}// Adobe PDF Library SDK
using Datalogics.PDFL;
using System;
class AdobeAddWatermark
{
static void Main()
{
using (Library lib = new Library())
{
Document doc = new Document("input.pdf");
// Create watermark with complex API
WatermarkParams watermarkParams = new WatermarkParams();
watermarkParams.Opacity = 0.5;
watermarkParams.Rotation = 45.0;
watermarkParams.VerticalAlignment = WatermarkVerticalAlignment.Center;
watermarkParams.HorizontalAlignment = WatermarkHorizontalAlignment.Center;
WatermarkTextParams textParams = new WatermarkTextParams();
textParams.Text = "CONFIDENTIAL";
Watermark watermark = new Watermark(doc, textParams, watermarkParams);
doc.Save(SaveFlags.Full, "watermarked.pdf");
doc.Dispose();
}
}
}Imports Datalogics.PDFL
Imports System
Class AdobeAddWatermark
Shared Sub Main()
Using lib As New Library()
Dim doc As New Document("input.pdf")
' Create watermark with complex API
Dim watermarkParams As New WatermarkParams()
watermarkParams.Opacity = 0.5
watermarkParams.Rotation = 45.0
watermarkParams.VerticalAlignment = WatermarkVerticalAlignment.Center
watermarkParams.HorizontalAlignment = WatermarkHorizontalAlignment.Center
Dim textParams As New WatermarkTextParams()
textParams.Text = "CONFIDENTIAL"
Dim watermark As New Watermark(doc, textParams, watermarkParams)
doc.Save(SaveFlags.Full, "watermarked.pdf")
doc.Dispose()
End Using
End Sub
End ClassIronPDF Implementation:
// NuGet: Install-Package IronPdf
using IronPdf;
using IronPdf.Editing;
using System;
class IronPdfAddWatermark
{
static void Main()
{
var pdf = PdfDocument.FromFile("input.pdf");
// Apply text watermark with simple API
pdf.ApplyWatermark("<h1 style='color:red; opacity:0.5;'>CONFIDENTIAL</h1>",
rotation: 45,
verticalAlignment: VerticalAlignment.Middle,
horizontalAlignment: HorizontalAlignment.Center);
pdf.SaveAs("watermarked.pdf");
}
}// NuGet: Install-Package IronPdf
using IronPdf;
using IronPdf.Editing;
using System;
class IronPdfAddWatermark
{
static void Main()
{
var pdf = PdfDocument.FromFile("input.pdf");
// Apply text watermark with simple API
pdf.ApplyWatermark("<h1 style='color:red; opacity:0.5;'>CONFIDENTIAL</h1>",
rotation: 45,
verticalAlignment: VerticalAlignment.Middle,
horizontalAlignment: HorizontalAlignment.Center);
pdf.SaveAs("watermarked.pdf");
}
}Imports IronPdf
Imports IronPdf.Editing
Imports System
Class IronPdfAddWatermark
Shared Sub Main()
Dim pdf = PdfDocument.FromFile("input.pdf")
' Apply text watermark with simple API
pdf.ApplyWatermark("<h1 style='color:red; opacity:0.5;'>CONFIDENTIAL</h1>",
rotation:=45,
verticalAlignment:=VerticalAlignment.Middle,
horizontalAlignment:=HorizontalAlignment.Center)
pdf.SaveAs("watermarked.pdf")
End Sub
End ClassIronPDF's HTML-based watermarking provides complete design control through CSS styling, eliminating the need for separate parameter objects.
Password Protection and Encryption
Adobe PDF Library SDK Implementation:
using Datalogics.PDFL;
public void ProtectPdf(string inputPath, string outputPath, string password)
{
Library.Initialize();
try
{
using (Document doc = new Document(inputPath))
{
PermissionFlags permissions =
PermissionFlags.PrintDoc |
PermissionFlags.PrintFidelity;
EncryptionHandler encHandler = new EncryptionHandler(
password, // User password
password, // Owner password
permissions,
EncryptionMethod.AES256);
doc.SetEncryptionHandler(encHandler);
doc.Save(SaveFlags.Full | SaveFlags.Encrypted, outputPath);
}
}
finally
{
Library.Terminate();
}
}using Datalogics.PDFL;
public void ProtectPdf(string inputPath, string outputPath, string password)
{
Library.Initialize();
try
{
using (Document doc = new Document(inputPath))
{
PermissionFlags permissions =
PermissionFlags.PrintDoc |
PermissionFlags.PrintFidelity;
EncryptionHandler encHandler = new EncryptionHandler(
password, // User password
password, // Owner password
permissions,
EncryptionMethod.AES256);
doc.SetEncryptionHandler(encHandler);
doc.Save(SaveFlags.Full | SaveFlags.Encrypted, outputPath);
}
}
finally
{
Library.Terminate();
}
}Imports Datalogics.PDFL
Public Sub ProtectPdf(inputPath As String, outputPath As String, password As String)
Library.Initialize()
Try
Using doc As New Document(inputPath)
Dim permissions As PermissionFlags = PermissionFlags.PrintDoc Or PermissionFlags.PrintFidelity
Dim encHandler As New EncryptionHandler(
password, ' User password
password, ' Owner password
permissions,
EncryptionMethod.AES256)
doc.SetEncryptionHandler(encHandler)
doc.Save(SaveFlags.Full Or SaveFlags.Encrypted, outputPath)
End Using
Finally
Library.Terminate()
End Try
End SubIronPDF Implementation:
using IronPdf;
public void ProtectPdf(string inputPath, string outputPath, string password)
{
using var pdf = PdfDocument.FromFile(inputPath);
pdf.SecuritySettings.UserPassword = password;
pdf.SecuritySettings.OwnerPassword = password;
pdf.SecuritySettings.AllowUserPrinting = PdfPrintSecurity.FullPrintRights;
pdf.SecuritySettings.AllowUserCopyPasteContent = false;
pdf.SecuritySettings.AllowUserEdits = PdfEditSecurity.NoEdit;
pdf.SaveAs(outputPath);
}using IronPdf;
public void ProtectPdf(string inputPath, string outputPath, string password)
{
using var pdf = PdfDocument.FromFile(inputPath);
pdf.SecuritySettings.UserPassword = password;
pdf.SecuritySettings.OwnerPassword = password;
pdf.SecuritySettings.AllowUserPrinting = PdfPrintSecurity.FullPrintRights;
pdf.SecuritySettings.AllowUserCopyPasteContent = false;
pdf.SecuritySettings.AllowUserEdits = PdfEditSecurity.NoEdit;
pdf.SaveAs(outputPath);
}Imports IronPdf
Public Sub ProtectPdf(inputPath As String, outputPath As String, password As String)
Using pdf = PdfDocument.FromFile(inputPath)
pdf.SecuritySettings.UserPassword = password
pdf.SecuritySettings.OwnerPassword = password
pdf.SecuritySettings.AllowUserPrinting = PdfPrintSecurity.FullPrintRights
pdf.SecuritySettings.AllowUserCopyPasteContent = False
pdf.SecuritySettings.AllowUserEdits = PdfEditSecurity.NoEdit
pdf.SaveAs(outputPath)
End Using
End SubIronPDF uses strongly-typed properties instead of bitwise permission flags and encryption handler objects.
Text Extraction
Adobe PDF Library SDK Implementation:
using Datalogics.PDFL;
public string ExtractText(string pdfPath)
{
string extractedText = "";
Library.Initialize();
try
{
using (Document doc = new Document(pdfPath))
{
WordFinderConfig config = new WordFinderConfig();
config.IgnoreCharGaps = true;
for (int i = 0; i < doc.NumPages; i++)
{
using (WordFinder wordFinder = new WordFinder(doc, i, config))
{
IList<Word> words = wordFinder.GetWordList();
foreach (Word word in words)
{
extractedText += word.Text + " ";
}
extractedText += "\n";
}
}
}
}
finally
{
Library.Terminate();
}
return extractedText;
}using Datalogics.PDFL;
public string ExtractText(string pdfPath)
{
string extractedText = "";
Library.Initialize();
try
{
using (Document doc = new Document(pdfPath))
{
WordFinderConfig config = new WordFinderConfig();
config.IgnoreCharGaps = true;
for (int i = 0; i < doc.NumPages; i++)
{
using (WordFinder wordFinder = new WordFinder(doc, i, config))
{
IList<Word> words = wordFinder.GetWordList();
foreach (Word word in words)
{
extractedText += word.Text + " ";
}
extractedText += "\n";
}
}
}
}
finally
{
Library.Terminate();
}
return extractedText;
}Imports Datalogics.PDFL
Public Function ExtractText(ByVal pdfPath As String) As String
Dim extractedText As String = ""
Library.Initialize()
Try
Using doc As New Document(pdfPath)
Dim config As New WordFinderConfig()
config.IgnoreCharGaps = True
For i As Integer = 0 To doc.NumPages - 1
Using wordFinder As New WordFinder(doc, i, config)
Dim words As IList(Of Word) = wordFinder.GetWordList()
For Each word As Word In words
extractedText &= word.Text & " "
Next
extractedText &= vbLf
End Using
Next
End Using
Finally
Library.Terminate()
End Try
Return extractedText
End FunctionIronPDF Implementation:
using IronPdf;
public string ExtractText(string pdfPath)
{
using var pdf = PdfDocument.FromFile(pdfPath);
return pdf.ExtractAllText();
}using IronPdf;
public string ExtractText(string pdfPath)
{
using var pdf = PdfDocument.FromFile(pdfPath);
return pdf.ExtractAllText();
}Imports IronPdf
Public Function ExtractText(pdfPath As String) As String
Using pdf = PdfDocument.FromFile(pdfPath)
Return pdf.ExtractAllText()
End Using
End FunctionAdobe's word-by-word iteration becomes a single method call with IronPDF.
Headers and Footers
Adobe PDF Library SDK Implementation:
using Datalogics.PDFL;
public void AddHeaderFooter(string inputPath, string outputPath)
{
Library.Initialize();
try
{
using (Document doc = new Document(inputPath))
{
Font font = new Font("Helvetica", FontCreateFlags.None);
for (int i = 0; i < doc.NumPages; i++)
{
using (Page page = doc.GetPage(i))
{
Content content = page.Content;
// Add header
Text header = new Text();
header.AddRun(new TextRun("Document Header",
font, 10, new Point(72, page.MediaBox.Top - 36)));
content.AddElement(header);
// Add footer with page number
Text footer = new Text();
footer.AddRun(new TextRun($"Page {i + 1} of {doc.NumPages}",
font, 10, new Point(72, 36)));
content.AddElement(footer);
page.UpdateContent();
}
}
doc.Save(SaveFlags.Full, outputPath);
}
}
finally
{
Library.Terminate();
}
}using Datalogics.PDFL;
public void AddHeaderFooter(string inputPath, string outputPath)
{
Library.Initialize();
try
{
using (Document doc = new Document(inputPath))
{
Font font = new Font("Helvetica", FontCreateFlags.None);
for (int i = 0; i < doc.NumPages; i++)
{
using (Page page = doc.GetPage(i))
{
Content content = page.Content;
// Add header
Text header = new Text();
header.AddRun(new TextRun("Document Header",
font, 10, new Point(72, page.MediaBox.Top - 36)));
content.AddElement(header);
// Add footer with page number
Text footer = new Text();
footer.AddRun(new TextRun($"Page {i + 1} of {doc.NumPages}",
font, 10, new Point(72, 36)));
content.AddElement(footer);
page.UpdateContent();
}
}
doc.Save(SaveFlags.Full, outputPath);
}
}
finally
{
Library.Terminate();
}
}Imports Datalogics.PDFL
Public Sub AddHeaderFooter(inputPath As String, outputPath As String)
Library.Initialize()
Try
Using doc As New Document(inputPath)
Dim font As New Font("Helvetica", FontCreateFlags.None)
For i As Integer = 0 To doc.NumPages - 1
Using page As Page = doc.GetPage(i)
Dim content As Content = page.Content
' Add header
Dim header As New Text()
header.AddRun(New TextRun("Document Header", font, 10, New Point(72, page.MediaBox.Top - 36)))
content.AddElement(header)
' Add footer with page number
Dim footer As New Text()
footer.AddRun(New TextRun($"Page {i + 1} of {doc.NumPages}", font, 10, New Point(72, 36)))
content.AddElement(footer)
page.UpdateContent()
End Using
Next
doc.Save(SaveFlags.Full, outputPath)
End Using
Finally
Library.Terminate()
End Try
End SubIronPDF Implementation:
using IronPdf;
public void CreatePdfWithHeaderFooter(string html, string outputPath)
{
var renderer = new ChromePdfRenderer();
renderer.RenderingOptions.TextHeader = new TextHeaderFooter
{
CenterText = "Document Header",
FontSize = 10,
FontFamily = "Helvetica"
};
renderer.RenderingOptions.TextFooter = new TextHeaderFooter
{
CenterText = "Page {page} of {total-pages}",
FontSize = 10,
FontFamily = "Helvetica"
};
using var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs(outputPath);
}using IronPdf;
public void CreatePdfWithHeaderFooter(string html, string outputPath)
{
var renderer = new ChromePdfRenderer();
renderer.RenderingOptions.TextHeader = new TextHeaderFooter
{
CenterText = "Document Header",
FontSize = 10,
FontFamily = "Helvetica"
};
renderer.RenderingOptions.TextFooter = new TextHeaderFooter
{
CenterText = "Page {page} of {total-pages}",
FontSize = 10,
FontFamily = "Helvetica"
};
using var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs(outputPath);
}Imports IronPdf
Public Sub CreatePdfWithHeaderFooter(html As String, outputPath As String)
Dim renderer = New ChromePdfRenderer()
renderer.RenderingOptions.TextHeader = New TextHeaderFooter With {
.CenterText = "Document Header",
.FontSize = 10,
.FontFamily = "Helvetica"
}
renderer.RenderingOptions.TextFooter = New TextHeaderFooter With {
.CenterText = "Page {page} of {total-pages}",
.FontSize = 10,
.FontFamily = "Helvetica"
}
Using pdf = renderer.RenderHtmlAsPdf(html)
pdf.SaveAs(outputPath)
End Using
End SubIronPDF handles page iteration automatically and supports placeholder tokens like {page} and {total-pages}. For more advanced layouts, see the headers and footers documentation.
URL to PDF Conversion
Adobe PDF Library SDK lacks built-in URL rendering capability. IronPDF provides native support:
using IronPdf;
public void ConvertUrlToPdf(string url, string outputPath)
{
var renderer = new ChromePdfRenderer();
using var pdf = renderer.RenderUrlAsPdf(url);
pdf.SaveAs(outputPath);
}using IronPdf;
public void ConvertUrlToPdf(string url, string outputPath)
{
var renderer = new ChromePdfRenderer();
using var pdf = renderer.RenderUrlAsPdf(url);
pdf.SaveAs(outputPath);
}Imports IronPdf
Public Sub ConvertUrlToPdf(url As String, outputPath As String)
Dim renderer As New ChromePdfRenderer()
Using pdf = renderer.RenderUrlAsPdf(url)
pdf.SaveAs(outputPath)
End Using
End SubFor complete URL conversion options, see the URL to PDF documentation.
ASP.NET Core Integration
Adobe PDF Library SDK's static initialization pattern creates friction with dependency injection. IronPDF integrates naturally with modern .NET architectures.
Adobe Pattern (Problematic for DI):
public class AdobePdfService
{
public byte[] Generate(string content)
{
Library.Initialize();
try
{
// Complex document construction...
return bytes;
}
finally
{
Library.Terminate();
}
}
}public class AdobePdfService
{
public byte[] Generate(string content)
{
Library.Initialize();
try
{
// Complex document construction...
return bytes;
}
finally
{
Library.Terminate();
}
}
}Public Class AdobePdfService
Public Function Generate(content As String) As Byte()
Library.Initialize()
Try
' Complex document construction...
Return bytes
Finally
Library.Terminate()
End Try
End Function
End ClassIronPDF Pattern (DI-Friendly):
public interface IPdfService
{
Task<byte[]> GeneratePdfAsync(string html);
}
public class IronPdfService : IPdfService
{
private readonly ChromePdfRenderer _renderer;
public IronPdfService()
{
_renderer = new ChromePdfRenderer();
_renderer.RenderingOptions.PaperSize = PdfPaperSize.A4;
}
public async Task<byte[]> GeneratePdfAsync(string html)
{
using var pdf = await _renderer.RenderHtmlAsPdfAsync(html);
return pdf.BinaryData;
}
}
// Register in Program.cs (.NET 6+):
builder.Services.AddSingleton<IPdfService, IronPdfService>();public interface IPdfService
{
Task<byte[]> GeneratePdfAsync(string html);
}
public class IronPdfService : IPdfService
{
private readonly ChromePdfRenderer _renderer;
public IronPdfService()
{
_renderer = new ChromePdfRenderer();
_renderer.RenderingOptions.PaperSize = PdfPaperSize.A4;
}
public async Task<byte[]> GeneratePdfAsync(string html)
{
using var pdf = await _renderer.RenderHtmlAsPdfAsync(html);
return pdf.BinaryData;
}
}
// Register in Program.cs (.NET 6+):
builder.Services.AddSingleton<IPdfService, IronPdfService>();Imports System.Threading.Tasks
Public Interface IPdfService
Function GeneratePdfAsync(html As String) As Task(Of Byte())
End Interface
Public Class IronPdfService
Implements IPdfService
Private ReadOnly _renderer As ChromePdfRenderer
Public Sub New()
_renderer = New ChromePdfRenderer()
_renderer.RenderingOptions.PaperSize = PdfPaperSize.A4
End Sub
Public Async Function GeneratePdfAsync(html As String) As Task(Of Byte()) Implements IPdfService.GeneratePdfAsync
Using pdf = Await _renderer.RenderHtmlAsPdfAsync(html)
Return pdf.BinaryData
End Using
End Function
End Class
' Register in Program.vb (.NET 6+):
builder.Services.AddSingleton(Of IPdfService, IronPdfService)()Async Support
Adobe PDF Library SDK doesn't support async operations. IronPDF provides full async/await capabilities essential for scalable web applications:
public async Task<IActionResult> GenerateReport()
{
var renderer = new ChromePdfRenderer();
using var pdf = await renderer.RenderHtmlAsPdfAsync(html);
return File(pdf.BinaryData, "application/pdf");
}public async Task<IActionResult> GenerateReport()
{
var renderer = new ChromePdfRenderer();
using var pdf = await renderer.RenderHtmlAsPdfAsync(html);
return File(pdf.BinaryData, "application/pdf");
}Imports System.Threading.Tasks
Imports Microsoft.AspNetCore.Mvc
Public Class ReportController
Inherits Controller
Public Async Function GenerateReport() As Task(Of IActionResult)
Dim renderer As New ChromePdfRenderer()
Using pdf = Await renderer.RenderHtmlAsPdfAsync(html)
Return File(pdf.BinaryData, "application/pdf")
End Using
End Function
End ClassPerformance Optimization
Memory Usage Comparison
| Scenario | Adobe PDF Library SDK | IronPDF |
|---|---|---|
| Simple PDF | ~100 MB | ~50 MB |
| Complex document | ~200 MB | ~80 MB |
| Batch (100 PDFs) | High (native memory) | ~100 MB |
Optimization Tips
Reuse Renderer Instances:
// Good: Reuse renderer for batch operations
var renderer = new ChromePdfRenderer();
foreach (var html in htmlList)
{
using var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs($"output_{i}.pdf");
}// Good: Reuse renderer for batch operations
var renderer = new ChromePdfRenderer();
foreach (var html in htmlList)
{
using var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs($"output_{i}.pdf");
}' Good: Reuse renderer for batch operations
Dim renderer = New ChromePdfRenderer()
For Each html In htmlList
Using pdf = renderer.RenderHtmlAsPdf(html)
pdf.SaveAs($"output_{i}.pdf")
End Using
NextUse Async in Web Applications:
public async Task<IActionResult> GenerateReport()
{
var renderer = new ChromePdfRenderer();
using var pdf = await renderer.RenderHtmlAsPdfAsync(html);
return File(pdf.BinaryData, "application/pdf");
}public async Task<IActionResult> GenerateReport()
{
var renderer = new ChromePdfRenderer();
using var pdf = await renderer.RenderHtmlAsPdfAsync(html);
return File(pdf.BinaryData, "application/pdf");
}Imports System.Threading.Tasks
Imports Microsoft.AspNetCore.Mvc
Public Class ReportController
Inherits Controller
Public Async Function GenerateReport() As Task(Of IActionResult)
Dim renderer As New ChromePdfRenderer()
Using pdf = Await renderer.RenderHtmlAsPdfAsync(html)
Return File(pdf.BinaryData, "application/pdf")
End Using
End Function
End ClassTroubleshooting Common Migration Issues
Issue: Coordinate-Based Positioning Not Working
Adobe uses PostScript point coordinates. IronPDF uses CSS positioning:
// Adobe: Point-based
new TextRun("Hello", font, 12, new Point(100, 700));
// IronPDF: CSS-based
string html = "<p style='position:absolute; left:100px; top:92px;'>Hello</p>";// Adobe: Point-based
new TextRun("Hello", font, 12, new Point(100, 700));
// IronPDF: CSS-based
string html = "<p style='position:absolute; left:100px; top:92px;'>Hello</p>";' Adobe: Point-based
New TextRun("Hello", font, 12, New Point(100, 700))
' IronPDF: CSS-based
Dim html As String = "<p style='position:absolute; left:100px; top:92px;'>Hello</p>"Issue: Page Size Differences
Adobe uses PostScript points. IronPDF uses enums or custom dimensions:
// Adobe: Points
Rect(0, 0, 612, 792) // Letter
// IronPDF: Enum or custom
renderer.RenderingOptions.PaperSize = PdfPaperSize.Letter;
// Or custom:
renderer.RenderingOptions.SetCustomPaperSizeInInches(8.5, 11);// Adobe: Points
Rect(0, 0, 612, 792) // Letter
// IronPDF: Enum or custom
renderer.RenderingOptions.PaperSize = PdfPaperSize.Letter;
// Or custom:
renderer.RenderingOptions.SetCustomPaperSizeInInches(8.5, 11);' Adobe: Points
Rect(0, 0, 612, 792) ' Letter
' IronPDF: Enum or custom
renderer.RenderingOptions.PaperSize = PdfPaperSize.Letter
' Or custom:
renderer.RenderingOptions.SetCustomPaperSizeInInches(8.5, 11)Issue: Font Not Found
Adobe requires manual font embedding. IronPDF handles fonts automatically:
// IronPDF: Use web fonts if needed
string html = @"
<style>
@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap');
body { font-family: 'Roboto', sans-serif; }
</style>";// IronPDF: Use web fonts if needed
string html = @"
<style>
@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap');
body { font-family: 'Roboto', sans-serif; }
</style>";' IronPDF: Use web fonts if needed
Dim html As String = "
<style>
@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap');
body { font-family: 'Roboto', sans-serif; }
</style>"Issue: SaveFlags Not Available
Adobe uses save flag combinations. IronPDF uses direct save:
// Adobe
doc.Save(SaveFlags.Full | SaveFlags.Incremental, path);
// IronPDF - full save is default
pdf.SaveAs(path);// Adobe
doc.Save(SaveFlags.Full | SaveFlags.Incremental, path);
// IronPDF - full save is default
pdf.SaveAs(path);' Adobe
doc.Save(SaveFlags.Full Or SaveFlags.Incremental, path)
' IronPDF - full save is default
pdf.SaveAs(path)Post-Migration Checklist
After completing the code migration, verify the following:
- Run all existing unit and integration tests
- Compare PDF outputs visually against previous versions
- Test all PDF workflows in a staging environment
- Verify licensing works correctly (
IronPdf.License.IsLicensed) - Performance benchmark against previous implementation
- Remove Adobe licensing configuration
- Update CI/CD pipeline dependencies
- Remove all Adobe PDF Library DLLs from the project
- Document new patterns for your development team
Future-Proofing Your PDF Infrastructure
With .NET 10 approaching and C# 14 introducing new language features, selecting a .NET PDF library with active development ensures compatibility with evolving runtime capabilities. IronPDF's commitment to supporting the latest .NET versions means your migration investment pays dividends as projects extend into 2025 and 2026.
Additional Resources
Migrating from Adobe PDF Library SDK to IronPDF significantly simplifies your PDF generation codebase while reducing licensing costs by a large margin. The shift from low-level page construction to HTML/CSS rendering eliminates hundreds of lines of coordinate calculation, font management, and lifecycle handling code. For teams building modern .NET applications, IronPDF provides equivalent capabilities with a developer-friendly API designed for contemporary development workflows.






