How to Migrate from PDFmyURL to IronPDF in C#
PDFmyURL is a cloud-based API service designed for converting URLs and HTML content to PDF documents. The service processes all conversions on external servers, providing a straightforward integration path that requires minimal local infrastructure. However, this cloud-dependent architecture creates significant concerns for production applications that handle sensitive data, require offline capability, or need to avoid ongoing subscription costs.
This guide provides a complete migration path from PDFmyURL to IronPDF, with step-by-step instructions, code comparisons, and practical examples for professional .NET developers evaluating this transition.
Why Migrate from PDFmyURL
PDFmyURL's cloud processing model introduces several challenges that development teams must consider:
Privacy & Data Security: Every document you convert travels to and through PDFmyURL's servers—sensitive contracts, financial reports, and personal data are all processed externally.
Ongoing Subscription Costs: Starting at $39/month, annual costs exceed $468/year with no ownership. This subscription model means continuous expenditure regardless of usage patterns.
Internet Dependency: Every conversion requires network connectivity. Applications cannot process PDFs offline or during network outages.
Rate Limits & Throttling: API calls can be throttled during peak usage, potentially impacting application performance.
Service Availability: Your application depends on a third-party service being online and functional.
Vendor Lock-in: API changes can break your integration without notice, requiring reactive code updates.
IronPDF vs PDFmyURL: Feature Comparison
Understanding the architectural differences helps technical decision-makers evaluate the migration investment:
| Aspect | PDFmyURL | IronPDF |
|---|---|---|
| Processing Location | External servers | Local (your server) |
| Type | API Wrapper | .NET Library |
| Authentication | API key per request | One-time license key |
| Network Required | Every conversion | Only initial setup |
| Pricing Model | Monthly subscription ($39+) | Perpetual license available |
| Rate Limits | Yes (plan-dependent) | None |
| Data Privacy | Data sent externally | Data stays local |
| HTML/CSS/JS Support | W3C compliant | Full Chromium engine |
| Async Pattern | Required (async only) | Sync and async options |
| PDF Manipulation | Limited | Full suite (merge, split, edit) |
| Use Case | Low-volume applications | High-volume and enterprise |
Quick Start: PDFmyURL to IronPDF Migration
The migration can begin immediately with these foundational steps.
Step 1: Replace NuGet Packages
Remove PDFmyURL packages:
# Remove PDFmyURL packages
dotnet remove package PdfMyUrl
dotnet remove package Pdfcrowd# Remove PDFmyURL packages
dotnet remove package PdfMyUrl
dotnet remove package PdfcrowdInstall IronPDF:
# Install IronPDF
dotnet add package IronPdf# Install IronPDF
dotnet add package IronPdfStep 2: Update Namespaces
Replace PDFmyURL namespaces with IronPdf:
// Before: PDFmyURL
using PdfMyUrl;
using Pdfcrowd;
// After: IronPDF
using IronPdf;
using IronPdf.Rendering;// Before: PDFmyURL
using PdfMyUrl;
using Pdfcrowd;
// After: IronPDF
using IronPdf;
using IronPdf.Rendering;Step 3: Initialize License
Add license initialization at application startup:
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";Code Migration Examples
Converting URLs to PDF
The URL-to-PDF operation demonstrates the fundamental API differences between PDFmyURL and IronPDF.
PDFmyURL Approach:
// Install PDFmyURL SDK
using System;
using Pdfcrowd;
class Example
{
static void Main()
{
try
{
var client = new HtmlToPdfClient("username", "apikey");
client.convertUrlToFile("https://example.com", "output.pdf");
}
catch(Error why)
{
Console.WriteLine("Error: " + why);
}
}
}// Install PDFmyURL SDK
using System;
using Pdfcrowd;
class Example
{
static void Main()
{
try
{
var client = new HtmlToPdfClient("username", "apikey");
client.convertUrlToFile("https://example.com", "output.pdf");
}
catch(Error why)
{
Console.WriteLine("Error: " + why);
}
}
}IronPDF Approach:
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class Example
{
static void Main()
{
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderUrlAsPdf("https://example.com");
pdf.SaveAs("output.pdf");
}
}// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class Example
{
static void Main()
{
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderUrlAsPdf("https://example.com");
pdf.SaveAs("output.pdf");
}
}PDFmyURL requires creating an HtmlToPdfClient with username and API key credentials for every conversion request, then calling convertUrlToFile() with both the URL and output path. The entire operation must be wrapped in try-catch for PDFmyURL's custom Error type.
IronPDF simplifies this to three lines: create a ChromePdfRenderer, call RenderUrlAsPdf(), and use the built-in SaveAs() method. No per-request credentials are needed—the license is set once at application startup.
For advanced URL-to-PDF scenarios, see the URL to PDF documentation.
Converting HTML Strings to PDF
HTML string conversion shows the pattern differences clearly.
PDFmyURL Approach:
// Install PDFmyURL SDK
using System;
using Pdfcrowd;
class Example
{
static void Main()
{
try
{
var client = new HtmlToPdfClient("username", "apikey");
string html = "<html><body><h1>Hello World</h1></body></html>";
client.convertStringToFile(html, "output.pdf");
}
catch(Error why)
{
Console.WriteLine("Error: " + why);
}
}
}// Install PDFmyURL SDK
using System;
using Pdfcrowd;
class Example
{
static void Main()
{
try
{
var client = new HtmlToPdfClient("username", "apikey");
string html = "<html><body><h1>Hello World</h1></body></html>";
client.convertStringToFile(html, "output.pdf");
}
catch(Error why)
{
Console.WriteLine("Error: " + why);
}
}
}IronPDF Approach:
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class Example
{
static void Main()
{
var renderer = new ChromePdfRenderer();
string html = "<html><body><h1>Hello World</h1></body></html>";
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("output.pdf");
}
}// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class Example
{
static void Main()
{
var renderer = new ChromePdfRenderer();
string html = "<html><body><h1>Hello World</h1></body></html>";
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("output.pdf");
}
}PDFmyURL uses convertStringToFile() which sends the HTML content to external servers for processing. IronPDF's RenderHtmlAsPdf() processes everything locally using the Chromium rendering engine.
Explore the HTML to PDF conversion guide for additional options.
HTML File Conversion with Page Settings
Configuring paper size, orientation, and margins requires different approaches in each library.
PDFmyURL Approach:
// Install PDFmyURL SDK
using System;
using Pdfcrowd;
class Example
{
static void Main()
{
try
{
var client = new HtmlToPdfClient("username", "apikey");
client.setPageSize("A4");
client.setOrientation("landscape");
client.setMarginTop("10mm");
client.convertFileToFile("input.html", "output.pdf");
}
catch(Error why)
{
Console.WriteLine("Error: " + why);
}
}
}// Install PDFmyURL SDK
using System;
using Pdfcrowd;
class Example
{
static void Main()
{
try
{
var client = new HtmlToPdfClient("username", "apikey");
client.setPageSize("A4");
client.setOrientation("landscape");
client.setMarginTop("10mm");
client.convertFileToFile("input.html", "output.pdf");
}
catch(Error why)
{
Console.WriteLine("Error: " + why);
}
}
}IronPDF Approach:
// NuGet: Install-Package IronPdf
using IronPdf;
using IronPdf.Rendering;
using System;
class Example
{
static void Main()
{
var renderer = new ChromePdfRenderer();
renderer.RenderingOptions.PaperSize = PdfPaperSize.A4;
renderer.RenderingOptions.PaperOrientation = PdfPaperOrientation.Landscape;
renderer.RenderingOptions.MarginTop = 10;
var pdf = renderer.RenderHtmlFileAsPdf("input.html");
pdf.SaveAs("output.pdf");
}
}// NuGet: Install-Package IronPdf
using IronPdf;
using IronPdf.Rendering;
using System;
class Example
{
static void Main()
{
var renderer = new ChromePdfRenderer();
renderer.RenderingOptions.PaperSize = PdfPaperSize.A4;
renderer.RenderingOptions.PaperOrientation = PdfPaperOrientation.Landscape;
renderer.RenderingOptions.MarginTop = 10;
var pdf = renderer.RenderHtmlFileAsPdf("input.html");
pdf.SaveAs("output.pdf");
}
}PDFmyURL uses setter methods with string parameters like setPageSize("A4") and setMarginTop("10mm"). IronPDF provides strongly-typed properties through RenderingOptions with enums like PdfPaperSize.A4 and integer values for margins in millimeters.
PDFmyURL API to IronPDF Mapping Reference
This mapping accelerates migration by showing direct API equivalents:
Core Classes
| PDFmyURL | IronPDF | Notes |
|---|---|---|
HtmlToPdfClient | ChromePdfRenderer | Main conversion class |
PdfMyUrlClient | ChromePdfRenderer | Alternative client class |
| API response object | PdfDocument | Result PDF object |
Methods
| PDFmyURL | IronPDF | Notes |
|---|---|---|
client.convertUrlToFile(url, file) | renderer.RenderUrlAsPdf(url).SaveAs(file) | URL to PDF |
client.convertStringToFile(html, file) | renderer.RenderHtmlAsPdf(html).SaveAs(file) | HTML string to PDF |
client.convertFileToFile(input, output) | renderer.RenderHtmlFileAsPdf(input).SaveAs(output) | File to file |
response.GetBytes() | pdf.BinaryData | Get raw bytes |
response.GetStream() | pdf.Stream | Get as stream |
Configuration Options
| PDFmyURL (setXxx methods) | IronPDF (RenderingOptions) | Notes |
|---|---|---|
setPageSize("A4") | .PaperSize = PdfPaperSize.A4 | Paper size |
setPageSize("Letter") | .PaperSize = PdfPaperSize.Letter | US Letter |
setOrientation("landscape") | .PaperOrientation = PdfPaperOrientation.Landscape | Orientation |
setOrientation("portrait") | .PaperOrientation = PdfPaperOrientation.Portrait | Portrait |
setMarginTop("10mm") | .MarginTop = 10 | Top margin (mm) |
setMarginBottom("10mm") | .MarginBottom = 10 | Bottom margin (mm) |
setMarginLeft("10mm") | .MarginLeft = 10 | Left margin (mm) |
setMarginRight("10mm") | .MarginRight = 10 | Right margin (mm) |
setHeaderHtml(html) | .HtmlHeader = new HtmlHeaderFooter { HtmlFragment = html } | Header |
setFooterHtml(html) | .HtmlFooter = new HtmlHeaderFooter { HtmlFragment = html } | Footer |
setJavascriptDelay(500) | .RenderDelay = 500 | JS wait time (ms) |
setDisableJavascript(true) | .EnableJavaScript = false | Disable JS |
setUsePrintMedia(true) | .CssMediaType = PdfCssMediaType.Print | Print CSS |
Authentication Comparison
| PDFmyURL | IronPDF |
|---|---|
new HtmlToPdfClient("username", "apikey") | IronPdf.License.LicenseKey = "LICENSE-KEY" |
| API key per request | One-time at startup |
| Required for every call | Set once globally |
Common Migration Issues and Solutions
Issue 1: API Key vs License Key
PDFmyURL: Requires credentials for every conversion request.
Solution: Set the IronPDF license once at application startup:
// PDFmyURL: API key per request
var client = new HtmlToPdfClient("username", "apikey");
// IronPDF: One-time license at startup
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
// Set once, typically in Program.cs or Startup.cs// PDFmyURL: API key per request
var client = new HtmlToPdfClient("username", "apikey");
// IronPDF: One-time license at startup
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
// Set once, typically in Program.cs or Startup.csIssue 2: Placeholder Syntax in Headers/Footers
PDFmyURL: Uses {page_number} and {total_pages} placeholders.
Solution: Update to IronPDF's placeholder format:
// PDFmyURL: "Page {page_number} of {total_pages}"
// IronPDF: "Page {page} of {total-pages}"// PDFmyURL: "Page {page_number} of {total_pages}"
// IronPDF: "Page {page} of {total-pages}"Issue 3: Async Patterns
PDFmyURL: Requires async/await patterns.
Solution: IronPDF is synchronous by default; wrap for async if needed:
// PDFmyURL: Native async
var response = await client.ConvertUrlAsync(url);
// IronPDF: Sync by default, wrap for async
var pdf = await Task.Run(() => renderer.RenderUrlAsPdf(url));// PDFmyURL: Native async
var response = await client.ConvertUrlAsync(url);
// IronPDF: Sync by default, wrap for async
var pdf = await Task.Run(() => renderer.RenderUrlAsPdf(url));Issue 4: Error Handling
PDFmyURL: Uses custom Pdfcrowd.Error exception type.
Solution: Update catch blocks for IronPDF exceptions:
// PDFmyURL: Pdfcrowd.Error
catch (Pdfcrowd.Error e) { ... }
// IronPDF: Standard exceptions
catch (IronPdf.Exceptions.IronPdfRenderingException e) { ... }// PDFmyURL: Pdfcrowd.Error
catch (Pdfcrowd.Error e) { ... }
// IronPDF: Standard exceptions
catch (IronPdf.Exceptions.IronPdfRenderingException e) { ... }Issue 5: Configuration Pattern
PDFmyURL: Uses setter methods with string values.
Solution: Use strongly-typed RenderingOptions properties:
// PDFmyURL: Setter methods
client.setPageSize("A4");
client.setOrientation("landscape");
// IronPDF: Properties with enums
renderer.RenderingOptions.PaperSize = PdfPaperSize.A4;
renderer.RenderingOptions.PaperOrientation = PdfPaperOrientation.Landscape;// PDFmyURL: Setter methods
client.setPageSize("A4");
client.setOrientation("landscape");
// IronPDF: Properties with enums
renderer.RenderingOptions.PaperSize = PdfPaperSize.A4;
renderer.RenderingOptions.PaperOrientation = PdfPaperOrientation.Landscape;PDFmyURL Migration Checklist
Pre-Migration Tasks
Audit your codebase to identify all PDFmyURL usage:
# Find PDFmyURL usage
grep -r "PdfMyUrl\|Pdfcrowd\|HtmlToPdfClient" --include="*.cs" .
# Find API key references
grep -r "apikey\|api-key\|api_key" --include="*.cs" --include="*.json" --include="*.config" .
# Find placeholder patterns to migrate
grep -r "{page_number}\|{total_pages}" --include="*.cs" .# Find PDFmyURL usage
grep -r "PdfMyUrl\|Pdfcrowd\|HtmlToPdfClient" --include="*.cs" .
# Find API key references
grep -r "apikey\|api-key\|api_key" --include="*.cs" --include="*.json" --include="*.config" .
# Find placeholder patterns to migrate
grep -r "{page_number}\|{total_pages}" --include="*.cs" .Document current configuration options used. Plan license key storage using environment variables.
Code Update Tasks
- Remove PDFmyURL/Pdfcrowd NuGet packages
- Install IronPdf NuGet package
- Update all namespace imports
- Replace API key authentication with IronPDF license key
- Convert setter methods to RenderingOptions properties
- Update placeholder syntax in headers/footers (
{page_number}→{page},{total_pages}→{total-pages}) - Update error handling code for IronPDF exception types
- Add IronPDF license initialization at startup
Post-Migration Testing
After migration, verify these aspects:
- Test PDF output quality matches expectations
- Verify async patterns work correctly
- Compare rendering fidelity with previous output
- Test all template variations render correctly
- Validate page settings (size, orientation, margins)
- Install Linux dependencies if deploying to Linux servers
Key Benefits of Migrating to IronPDF
Moving from PDFmyURL to IronPDF provides several critical advantages:
Complete Privacy: Documents never leave your server. All processing happens locally, eliminating data security concerns for sensitive content.
One-Time Cost: Perpetual license option eliminates recurring subscription fees. No more monthly payments regardless of usage volume.
Offline Capability: Works without internet after initial setup. Network outages don't impact PDF generation.
No Rate Limits: Process unlimited documents without throttling concerns.
Lower Latency: No network overhead means faster conversions, especially for high-volume applications.
Full Control: You control the processing environment, not a third-party service.
Modern Chromium Engine: Full CSS3 and JavaScript support with the same rendering engine that powers Chrome browser.
Active Development: As .NET 10 and C# 14 adoption increases through 2026, IronPDF's regular updates ensure compatibility with current and future .NET versions.






