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: Plans start at $20/month (Starter, 500 PDFs), $40/month (Professional, 2,000 PDFs), and $70/month (Advanced, 5,000 PDFs), with no ownership at any tier. 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 ($20–$70+) | Perpetual license available |
| Rate Limits | Yes (plan-dependent) | None |
| Data Privacy | Data sent externally | Data stays local |
| HTML/CSS/JS Support | Server-side rendering (W3C compliant) | Full Chromium engine |
| Async Pattern | HTTP request (network-bound) | 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: Install IronPDF
PDFmyURL has no NuGet package — the service is a REST API, and the optional PDFmyURL.NET.dll component ships as a direct DLL download (not on nuget.org). Most integrations call the API with WebClient / HttpClient, so the migration is mainly about code, not package references. If you used the PDFmyURL.NET.dll assembly, remove the reference from your project after migrating.
# Install IronPDF
dotnet add package IronPdf
# Install IronPDF
dotnet add package IronPdf
Step 2: Update Namespaces
Replace PDFmyURL imports with IronPDF:
// Before: PDFmyURL — either plain HttpClient/WebClient against pdfmyurl.com/api,
// or the optional .NET component:
using PDFmyURLdotNET; // only if you used PDFmyURL.NET.dll
using System.Net; // WebClient / HttpClient
// After: IronPDF
using IronPdf;
using IronPdf.Rendering;
// Before: PDFmyURL — either plain HttpClient/WebClient against pdfmyurl.com/api,
// or the optional .NET component:
using PDFmyURLdotNET; // only if you used PDFmyURL.NET.dll
using System.Net; // WebClient / HttpClient
// After: IronPDF
using IronPdf;
using IronPdf.Rendering;
Imports PDFmyURLdotNET ' only if you used PDFmyURL.NET.dll
Imports System.Net ' WebClient / HttpClient
' After: IronPDF
Imports IronPdf
Imports IronPdf.Rendering
Step 3: Initialize License
Add license initialization at application startup:
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
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:
// PDFmyURL REST API — no NuGet SDK. Docs: https://pdfmyurl.com/html-to-pdf-api
using System;
using System.Net;
class Example
{
static void Main()
{
string license = "your-license-key";
string url = "https://example.com";
try
{
using (var client = new WebClient())
{
client.QueryString.Add("license", license);
client.QueryString.Add("url", url);
// PDF binary is returned in the response body
client.DownloadFile("https://pdfmyurl.com/api", "output.pdf");
}
}
catch (WebException ex)
{
Console.WriteLine("Error: " + ex.Message);
}
}
}
// PDFmyURL REST API — no NuGet SDK. Docs: https://pdfmyurl.com/html-to-pdf-api
using System;
using System.Net;
class Example
{
static void Main()
{
string license = "your-license-key";
string url = "https://example.com";
try
{
using (var client = new WebClient())
{
client.QueryString.Add("license", license);
client.QueryString.Add("url", url);
// PDF binary is returned in the response body
client.DownloadFile("https://pdfmyurl.com/api", "output.pdf");
}
}
catch (WebException ex)
{
Console.WriteLine("Error: " + ex.Message);
}
}
}
Imports System
Imports System.Net
Class Example
Shared Sub Main()
Dim license As String = "your-license-key"
Dim url As String = "https://example.com"
Try
Using client As New WebClient()
client.QueryString.Add("license", license)
client.QueryString.Add("url", url)
' PDF binary is returned in the response body
client.DownloadFile("https://pdfmyurl.com/api", "output.pdf")
End Using
Catch ex As WebException
Console.WriteLine("Error: " & ex.Message)
End Try
End Sub
End Class
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");
}
}
Imports IronPdf
Imports System
Class Example
Shared Sub Main()
Dim renderer As New ChromePdfRenderer()
Dim pdf = renderer.RenderUrlAsPdf("https://example.com")
pdf.SaveAs("output.pdf")
End Sub
End Class
PDFmyURL requires opening an HTTP connection to https://pdfmyurl.com/api on every conversion, attaching the license token plus the target url as query (or form) parameters, and writing the response body to disk. Errors surface as WebException based on the HTTP status code.
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:
// PDFmyURL REST API — no NuGet SDK. Send the raw HTML in the `html` parameter.
// Docs: https://pdfmyurl.com/html-to-pdf-api
using System;
using System.Collections.Specialized;
using System.IO;
using System.Net;
class Example
{
static void Main()
{
string license = "your-license-key";
string html = "<html><body><h1>Hello World</h1></body></html>";
try
{
using (var client = new WebClient())
{
var values = new NameValueCollection
{
{ "license", license },
{ "html", html }
};
// POST form-encoded; response body is the PDF binary
byte[] pdfBytes = client.UploadValues("https://pdfmyurl.com/api", "POST", values);
File.WriteAllBytes("output.pdf", pdfBytes);
}
}
catch (WebException ex)
{
Console.WriteLine("Error: " + ex.Message);
}
}
}
// PDFmyURL REST API — no NuGet SDK. Send the raw HTML in the `html` parameter.
// Docs: https://pdfmyurl.com/html-to-pdf-api
using System;
using System.Collections.Specialized;
using System.IO;
using System.Net;
class Example
{
static void Main()
{
string license = "your-license-key";
string html = "<html><body><h1>Hello World</h1></body></html>";
try
{
using (var client = new WebClient())
{
var values = new NameValueCollection
{
{ "license", license },
{ "html", html }
};
// POST form-encoded; response body is the PDF binary
byte[] pdfBytes = client.UploadValues("https://pdfmyurl.com/api", "POST", values);
File.WriteAllBytes("output.pdf", pdfBytes);
}
}
catch (WebException ex)
{
Console.WriteLine("Error: " + ex.Message);
}
}
}
Imports System
Imports System.Collections.Specialized
Imports System.IO
Imports System.Net
Class Example
Shared Sub Main()
Dim license As String = "your-license-key"
Dim html As String = "<html><body><h1>Hello World</h1></body></html>"
Try
Using client As New WebClient()
Dim values As New NameValueCollection() From {
{"license", license},
{"html", html}
}
' POST form-encoded; response body is the PDF binary
Dim pdfBytes As Byte() = client.UploadValues("https://pdfmyurl.com/api", "POST", values)
File.WriteAllBytes("output.pdf", pdfBytes)
End Using
Catch ex As WebException
Console.WriteLine("Error: " & ex.Message)
End Try
End Sub
End Class
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");
}
}
Imports IronPdf
Imports System
Class Example
Shared Sub Main()
Dim renderer = New ChromePdfRenderer()
Dim html As String = "<html><body><h1>Hello World</h1></body></html>"
Dim pdf = renderer.RenderHtmlAsPdf(html)
pdf.SaveAs("output.pdf")
End Sub
End Class
PDFmyURL POSTs the raw HTML in the html form parameter to its API endpoint and returns the rendered PDF as the response body. 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:
// PDFmyURL REST API — no NuGet SDK. Page settings are sent as query/form parameters.
// Parameter reference: https://pdfmyurl.com/html-to-pdf-api
using System;
using System.Collections.Specialized;
using System.IO;
using System.Net;
class Example
{
static void Main()
{
string license = "your-license-key";
string html = File.ReadAllText("input.html");
try
{
using (var client = new WebClient())
{
var values = new NameValueCollection
{
{ "license", license },
{ "html", html },
{ "page_size", "A4" },
{ "orientation", "landscape" },
{ "top", "10" },
{ "unit", "mm" }
};
byte[] pdfBytes = client.UploadValues("https://pdfmyurl.com/api", "POST", values);
File.WriteAllBytes("output.pdf", pdfBytes);
}
}
catch (WebException ex)
{
Console.WriteLine("Error: " + ex.Message);
}
}
}
// PDFmyURL REST API — no NuGet SDK. Page settings are sent as query/form parameters.
// Parameter reference: https://pdfmyurl.com/html-to-pdf-api
using System;
using System.Collections.Specialized;
using System.IO;
using System.Net;
class Example
{
static void Main()
{
string license = "your-license-key";
string html = File.ReadAllText("input.html");
try
{
using (var client = new WebClient())
{
var values = new NameValueCollection
{
{ "license", license },
{ "html", html },
{ "page_size", "A4" },
{ "orientation", "landscape" },
{ "top", "10" },
{ "unit", "mm" }
};
byte[] pdfBytes = client.UploadValues("https://pdfmyurl.com/api", "POST", values);
File.WriteAllBytes("output.pdf", pdfBytes);
}
}
catch (WebException ex)
{
Console.WriteLine("Error: " + ex.Message);
}
}
}
Imports System
Imports System.Collections.Specialized
Imports System.IO
Imports System.Net
Class Example
Shared Sub Main()
Dim license As String = "your-license-key"
Dim html As String = File.ReadAllText("input.html")
Try
Using client As New WebClient()
Dim values As New NameValueCollection From {
{"license", license},
{"html", html},
{"page_size", "A4"},
{"orientation", "landscape"},
{"top", "10"},
{"unit", "mm"}
}
Dim pdfBytes As Byte() = client.UploadValues("https://pdfmyurl.com/api", "POST", values)
File.WriteAllBytes("output.pdf", pdfBytes)
End Using
Catch ex As WebException
Console.WriteLine("Error: " & ex.Message)
End Try
End Sub
End Class
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");
}
}
Imports IronPdf
Imports IronPdf.Rendering
Imports System
Class Example
Shared Sub Main()
Dim renderer As New ChromePdfRenderer()
renderer.RenderingOptions.PaperSize = PdfPaperSize.A4
renderer.RenderingOptions.PaperOrientation = PdfPaperOrientation.Landscape
renderer.RenderingOptions.MarginTop = 10
Dim pdf = renderer.RenderHtmlFileAsPdf("input.html")
pdf.SaveAs("output.pdf")
End Sub
End Class
PDFmyURL configures pages by adding form parameters like page_size=A4, orientation=landscape, and the margin fields (top, bottom, left, right) alongside a unit (e.g. mm, in). 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 / Entry Points
| PDFmyURL | IronPDF |
|---|---|
WebClient / HttpClient posting to https://pdfmyurl.com/api |
ChromePdfRenderer |
PDFmyURLdotNET.PDFmyURL (optional .NET component from PDFmyURL.NET.dll) |
ChromePdfRenderer |
| Form / query parameters | ChromePdfRenderOptions |
| HTTP response body bytes | PdfDocument |
Methods
| PDFmyURL | IronPDF |
|---|---|
WebClient.DownloadFile(".../api?license=...&url=...", file) |
renderer.RenderUrlAsPdf(url).SaveAs(file) |
POST with html= parameter |
renderer.RenderHtmlAsPdf(html) |
File.ReadAllText("input.html") then POST html= |
renderer.RenderHtmlFileAsPdf(path) |
pdf.ConvertURL(url, file) (PDFmyURL.NET.dll) |
renderer.RenderUrlAsPdf(url).SaveAs(file) |
pdf.ConvertHTML(html, file) (PDFmyURL.NET.dll) |
renderer.RenderHtmlAsPdf(html).SaveAs(file) |
HTTP response body (byte[]) |
pdf.BinaryData |
| HTTP response stream | new MemoryStream(pdf.BinaryData) |
Configuration Options
PDFmyURL settings are passed as form/query parameters on the HTTP request. The table below maps real PDFmyURL parameter names to IronPDF's RenderingOptions.
| PDFmyURL parameter | IronPDF (RenderingOptions) |
|---|---|
page_size=A4 |
.PaperSize = PdfPaperSize.A4 |
page_size=Letter |
.PaperSize = PdfPaperSize.Letter |
orientation=landscape |
.PaperOrientation = PdfPaperOrientation.Landscape |
orientation=portrait |
.PaperOrientation = PdfPaperOrientation.Portrait |
top=10&unit=mm |
.MarginTop = 10 |
bottom=10&unit=mm |
.MarginBottom = 10 |
left=10&unit=mm |
.MarginLeft = 10 |
right=10&unit=mm |
.MarginRight = 10 |
header=<html> |
.HtmlHeader = new HtmlHeaderFooter { HtmlFragment = html } |
footer=<html> |
.HtmlFooter = new HtmlHeaderFooter { HtmlFragment = html } |
javascript_time=500 |
.RenderDelay = 500 |
no_javascript=true |
.EnableJavaScript = false |
css_media_type=print |
.CssMediaType = PdfCssMediaType.Print |
Authentication Comparison
| PDFmyURL | IronPDF |
|---|---|
license=<key> query/form parameter on every API request |
IronPdf.License.LicenseKey = "LICENSE-KEY" |
| License token per request | One-time at startup |
| Required for every call | Set once globally |
Common Migration Issues and Solutions
Issue 1: License Token vs License Key
PDFmyURL: Requires the license token on every API request.
Solution: Set the IronPDF license once at application startup:
// PDFmyURL: license token per request
client.QueryString.Add("license", "your-license-key");
// IronPDF: One-time license at startup
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
// Set once, typically in Program.cs or Startup.cs
// PDFmyURL: license token per request
client.QueryString.Add("license", "your-license-key");
// IronPDF: One-time license at startup
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
// Set once, typically in Program.cs or Startup.cs
' PDFmyURL: license token per request
client.QueryString.Add("license", "your-license-key")
' IronPDF: One-time license at startup
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY"
' Set once, typically in Program.vb or Startup.vb
Issue 2: Placeholder Syntax in Headers/Footers
PDFmyURL: Uses tokens such as [page] and [topage] inside the header / footer form parameters (consult the live API reference for the canonical token list).
Solution: Update to IronPDF's placeholder format inside HtmlHeaderFooter.HtmlFragment:
// PDFmyURL: "Page [page] of [topage]"
// IronPDF: "Page {page} of {total-pages}"
// PDFmyURL: "Page [page] of [topage]"
// IronPDF: "Page {page} of {total-pages}"
' PDFmyURL: "Page [page] of [topage]"
' IronPDF: "Page {page} of {total-pages}"
Issue 3: Async Patterns
PDFmyURL: Is a remote HTTP call; typically invoked with HttpClient.PostAsync against pdfmyurl.com/api.
Solution: IronPDF is in-process and synchronous by default; wrap for async if needed:
// PDFmyURL: HTTP request to the public endpoint
var response = await http.PostAsync("https://pdfmyurl.com/api", form);
// IronPDF: Sync by default, wrap for async
var pdf = await Task.Run(() => renderer.RenderUrlAsPdf(url));
// PDFmyURL: HTTP request to the public endpoint
var response = await http.PostAsync("https://pdfmyurl.com/api", form);
// IronPDF: Sync by default, wrap for async
var pdf = await Task.Run(() => renderer.RenderUrlAsPdf(url));
Imports System.Net.Http
Imports System.Threading.Tasks
' PDFmyURL: HTTP request to the public endpoint
Dim response = Await http.PostAsync("https://pdfmyurl.com/api", form)
' IronPDF: Sync by default, wrap for async
Dim pdf = Await Task.Run(Function() renderer.RenderUrlAsPdf(url))
Issue 4: Error Handling
PDFmyURL: HTTP-level failures (invalid license, rate limit, network error, service unavailable) surface as WebException / non-success status codes.
Solution: Update catch blocks for IronPDF's typed exceptions:
// PDFmyURL: WebException from the HTTP call
catch (WebException e) { ... }
// IronPDF: Typed exceptions
catch (IronPdf.Exceptions.IronPdfRenderingException e) { ... }
// PDFmyURL: WebException from the HTTP call
catch (WebException e) { ... }
// IronPDF: Typed exceptions
catch (IronPdf.Exceptions.IronPdfRenderingException e) { ... }
Issue 5: Configuration Pattern
PDFmyURL: Configuration is passed as form/query parameters on the HTTP request.
Solution: Use strongly-typed RenderingOptions properties:
// PDFmyURL: form/query parameters
values.Add("page_size", "A4");
values.Add("orientation", "landscape");
// IronPDF: Properties with enums
renderer.RenderingOptions.PaperSize = PdfPaperSize.A4;
renderer.RenderingOptions.PaperOrientation = PdfPaperOrientation.Landscape;
// PDFmyURL: form/query parameters
values.Add("page_size", "A4");
values.Add("orientation", "landscape");
// IronPDF: Properties with enums
renderer.RenderingOptions.PaperSize = PdfPaperSize.A4;
renderer.RenderingOptions.PaperOrientation = PdfPaperOrientation.Landscape;
' PDFmyURL: form/query parameters
values.Add("page_size", "A4")
values.Add("orientation", "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 endpoint and component usage
grep -r "pdfmyurl.com/api\|PDFmyURLdotNET\|new PDFmyURL(" --include="*.cs" .
# Find license-token references
grep -r "license=\|licensekey" --include="*.cs" --include="*.json" --include="*.config" .
# Find placeholder patterns to migrate
grep -r "\[page\]\|\[topage\]" --include="*.cs" .
# Find PDFmyURL endpoint and component usage
grep -r "pdfmyurl.com/api\|PDFmyURLdotNET\|new PDFmyURL(" --include="*.cs" .
# Find license-token references
grep -r "license=\|licensekey" --include="*.cs" --include="*.json" --include="*.config" .
# Find placeholder patterns to migrate
grep -r "\[page\]\|\[topage\]" --include="*.cs" .
Document current configuration parameters used (page_size, orientation, margins, header/footer, etc.). Plan license key storage using environment variables.
Code Update Tasks
- Remove the optional
PDFmyURL.NET.dllreference if you used it (no NuGet package exists to uninstall) - Install the IronPDF NuGet package
- Update all namespace imports
- Replace the per-request
licensetoken withIronPdf.License.LicenseKey - Convert form/query parameters to
RenderingOptionsproperties - Update placeholder syntax in headers/footers (e.g.
[page]→{page},[topage]→{total-pages}) - Update error handling code (
WebException→ typed IronPDF exceptions) - 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: IronPDF's regular updates ensure compatibility with current modern .NET versions.

