Skip to footer content
MIGRATION GUIDES

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:

AspectPDFmyURLIronPDF
Processing LocationExternal serversLocal (your server)
TypeAPI Wrapper.NET Library
AuthenticationAPI key per requestOne-time license key
Network RequiredEvery conversionOnly initial setup
Pricing ModelMonthly subscription ($39+)Perpetual license available
Rate LimitsYes (plan-dependent)None
Data PrivacyData sent externallyData stays local
HTML/CSS/JS SupportW3C compliantFull Chromium engine
Async PatternRequired (async only)Sync and async options
PDF ManipulationLimitedFull suite (merge, split, edit)
Use CaseLow-volume applicationsHigh-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 Pdfcrowd
SHELL

Install IronPDF:

# Install IronPDF
dotnet add package IronPdf
# Install IronPDF
dotnet add package IronPdf
SHELL

Step 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;
$vbLabelText   $csharpLabel

Step 3: Initialize License

Add license initialization at application startup:

IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
$vbLabelText   $csharpLabel

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);
        }
    }
}
$vbLabelText   $csharpLabel

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");
    }
}
$vbLabelText   $csharpLabel

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);
        }
    }
}
$vbLabelText   $csharpLabel

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");
    }
}
$vbLabelText   $csharpLabel

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);
        }
    }
}
$vbLabelText   $csharpLabel

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");
    }
}
$vbLabelText   $csharpLabel

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

PDFmyURLIronPDFNotes
HtmlToPdfClientChromePdfRendererMain conversion class
PdfMyUrlClientChromePdfRendererAlternative client class
API response objectPdfDocumentResult PDF object

Methods

PDFmyURLIronPDFNotes
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.BinaryDataGet raw bytes
response.GetStream()pdf.StreamGet as stream

Configuration Options

PDFmyURL (setXxx methods)IronPDF (RenderingOptions)Notes
setPageSize("A4").PaperSize = PdfPaperSize.A4Paper size
setPageSize("Letter").PaperSize = PdfPaperSize.LetterUS Letter
setOrientation("landscape").PaperOrientation = PdfPaperOrientation.LandscapeOrientation
setOrientation("portrait").PaperOrientation = PdfPaperOrientation.PortraitPortrait
setMarginTop("10mm").MarginTop = 10Top margin (mm)
setMarginBottom("10mm").MarginBottom = 10Bottom margin (mm)
setMarginLeft("10mm").MarginLeft = 10Left margin (mm)
setMarginRight("10mm").MarginRight = 10Right margin (mm)
setHeaderHtml(html).HtmlHeader = new HtmlHeaderFooter { HtmlFragment = html }Header
setFooterHtml(html).HtmlFooter = new HtmlHeaderFooter { HtmlFragment = html }Footer
setJavascriptDelay(500).RenderDelay = 500JS wait time (ms)
setDisableJavascript(true).EnableJavaScript = falseDisable JS
setUsePrintMedia(true).CssMediaType = PdfCssMediaType.PrintPrint CSS

Authentication Comparison

PDFmyURLIronPDF
new HtmlToPdfClient("username", "apikey")IronPdf.License.LicenseKey = "LICENSE-KEY"
API key per requestOne-time at startup
Required for every callSet 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.cs
$vbLabelText   $csharpLabel

Issue 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}"
$vbLabelText   $csharpLabel

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));
$vbLabelText   $csharpLabel

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) { ... }
$vbLabelText   $csharpLabel

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;
$vbLabelText   $csharpLabel

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" .
SHELL

Document current configuration options used. Plan license key storage using environment variables.

Code Update Tasks

  1. Remove PDFmyURL/Pdfcrowd NuGet packages
  2. Install IronPdf NuGet package
  3. Update all namespace imports
  4. Replace API key authentication with IronPDF license key
  5. Convert setter methods to RenderingOptions properties
  6. Update placeholder syntax in headers/footers ({page_number}{page}, {total_pages}{total-pages})
  7. Update error handling code for IronPDF exception types
  8. 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.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...

Read More