PDFmyURL에서 IronPDF로의 마이그레이션 방법 (C#)
PDFmyURL은 URL과 HTML 콘텐츠를 PDF 문서로 변환하기 위해 설계된 클라우드 기반 API 서비스입니다. 이 서비스는 모든 변환을 외부 서버에서 처리하여 최소한의 로컬 인프라로도 쉽게 통합할 수 있는 방법을 제공합니다. 하지만, 클라우드 의존 아키텍처는 민감한 데이터를 처리하거나 오프라인 기능이 필요하거나 지속적인 구독 비용을 피해야 하는 생산 애플리케이션에 상당한 문제를 야기합니다.
이 가이드는 PDFmyURL에서 IronPDF로의 완전한 마이그레이션 경로를 제공하며, 단계별 지침, 코드 비교 및 이 전환을 평가하는 전문 .NET 개발자를 위한 실용적인 예제를 포함합니다.
PDFmyURL에서 마이그레이션해야 하는 이유
PDFmyURL의 클라우드 처리 모델은 개발팀이 고려해야 할 몇 가지 문제를 소개합니다:
프라이버시 및 데이터 보안: 변환하는 모든 문서는 PDFmyURL의 서버로 이동하며, 민감한 계약서, 재무 보고서 및 개인 데이터가 모두 외부에서 처리됩니다.
지속적인 구독 비용: 월 $39부터 시작하며, 연간 비용은 소유권 없이 $468을 초과합니다. 이 구독 모델은 사용 패턴에 상관없이 지속적인 지출을 의미합니다.
인터넷 의존성: 모든 변환은 네트워크 연결성을 필요로 합니다. 애플리케이션은 오프라인이나 네트워크 장애 시 PDF를 처리할 수 없습니다.
속도 제한 & 제어: API 호출은 피크 사용 중에 제어될 수 있어 애플리케이션 성능에 영향을 미칠 수 있습니다.
서비스 가용성: 귀하의 애플리케이션은 서드 파티 서비스의 온라인 여부와 작동 여부에 의존합니다.
벤더 종속: API 변경은 통지를 받기 전에 통합을 깨트릴 수 있으며, 반응적인 코드 업데이트가 필요합니다.
IronPDFvs PDFmyURL: 기능 비교
구조적 차이를 이해하면 기술 결정을 내리는데 이주 투자를 평가하는데 도움이 됩니다:
| 측면 | PDFmyURL | IronPDF |
|---|---|---|
| 처리 위치 | 외부 서버 | 로컬(당신의 서버) |
| 유형 | API 래퍼 | .NET 라이브러리 |
| 인증 | 요청당 API 키 | 일회성 라이선스 키 |
| 네트워크 필요 | 모든 변환 | 초기 설정만 |
| 가격 모델 | 월 구독 ($39+) | 영구 라이선스 제공 |
| 속도 제한 | 예 (계획에 따라 다름) | 없음 |
| 데이터 개인정보 | 외부로 전송된 데이터 | 데이터가 로컬에 남아 있음 |
| HTML/CSS/JS 지원 | W3C 준수 | 전체 Chromium 엔진 |
| 비동기 패턴 | 필요 (비동기 전용) | 동기 및 비동기 옵션 |
| PDF 조작 | 제한적 | 전체 도구 (병합, 분할, 편집) |
| 사용 사례 | 저용량 애플리케이션 | 고용량 및 Enterprise |
빠른 시작: PDFmyURL에서 IronPDF로의 마이그레이션
이러한 기본 단계를 통해 즉시 이주를 시작할 수 있습니다.
단계 1: NuGet 패키지 교체
PDFmyURL 패키지를 제거하십시오:
# RemovePDFmyURLpackages
dotnet remove package PdfMyUrl
dotnet remove package Pdfcrowd
# RemovePDFmyURLpackages
dotnet remove package PdfMyUrl
dotnet remove package Pdfcrowd
IronPDF 설치하세요:
# Install IronPDF
dotnet add package IronPdf
# Install IronPDF
dotnet add package IronPdf
단계 2: 네임스페이스 업데이트
PDFmyURL 네임스페이스를 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;
' Before: PDFmyURL
Imports PdfMyUrl
Imports Pdfcrowd
' After: IronPDF
Imports IronPdf
Imports IronPdf.Rendering
단계 3: 라이선스 초기화
애플리케이션 시작 시 라이선스 초기화를 추가합니다:
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY"
코드 마이그레이션 예제
URL을 PDF로 변환
URL-to-PDF 작업은 PDFmyURL과IronPDF간의 주요 API 차이를 보여줍니다.
PDFmyURL 접근 방식:
// InstallPDFmyURLSDK
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);
}
}
}
// InstallPDFmyURLSDK
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);
}
}
}
Imports System
Imports Pdfcrowd
Class Example
Shared Sub Main()
Try
Dim client = New HtmlToPdfClient("username", "apikey")
client.convertUrlToFile("https://example.com", "output.pdf")
Catch why As Error
Console.WriteLine("Error: " & why)
End Try
End Sub
End Class
IronPDF 접근법:
// 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은 사용자 이름과 API 키 자격 증명을 사용하여 HtmlToPdfClient을 생성하고, URL과 출력 경로를 모두 포함하여 convertUrlToFile()을 호출해야 합니다. 전체 작업은 PDFmyURL의 사용자 정의 Error 유형에 대해 try-catch로 감싸야 합니다.
IronPDF는 이를 세 줄로 단순화합니다: ChromePdfRenderer을 만들고, RenderUrlAsPdf()을 호출하며, 내장 SaveAs() 메서드를 사용합니다. 요청별 자격 증명이 필요하지 않습니다. 라이선스는 애플리케이션 시작 시 한 번 설정됩니다.
고급 URL-to-PDF 시나리오를 위해, URL to PDF 문서를 참조하십시오.
HTML 문자열을 PDF로 변환
HTML 문자열 변환은 패턴 차이를 명확히 보여줍니다.
PDFmyURL 접근 방식:
// InstallPDFmyURLSDK
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);
}
}
}
// InstallPDFmyURLSDK
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);
}
}
}
Imports System
Imports Pdfcrowd
Class Example
Shared Sub Main()
Try
Dim client = New HtmlToPdfClient("username", "apikey")
Dim html As String = "<html><body><h1>Hello World</h1></body></html>"
client.convertStringToFile(html, "output.pdf")
Catch why As Error
Console.WriteLine("Error: " & why.ToString())
End Try
End Sub
End Class
IronPDF 접근법:
// 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은 HTML 콘텐츠를 처리하기 위해 외부 서버에 보내는 convertStringToFile()을 사용합니다. IronPDF의 RenderHtmlAsPdf()은 모든 작업을 로컬에서 Chromium 렌더링 엔진을 사용하여 처리합니다.
HTML to PDF 변환 가이드에서 추가 옵션을 탐색하십시오.
페이지 설정을 통한 HTML 파일 변환
용지 크기, 방향 및 여백을 설정하는 데 각 라이브러리마다 다른 접근이 필요합니다.
PDFmyURL 접근 방식:
// InstallPDFmyURLSDK
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);
}
}
}
// InstallPDFmyURLSDK
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);
}
}
}
Imports System
Imports Pdfcrowd
Class Example
Shared Sub Main()
Try
Dim client = New HtmlToPdfClient("username", "apikey")
client.setPageSize("A4")
client.setOrientation("landscape")
client.setMarginTop("10mm")
client.convertFileToFile("input.html", "output.pdf")
Catch why As Error
Console.WriteLine("Error: " & why.ToString())
End Try
End Sub
End Class
IronPDF 접근법:
// 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은 setPageSize("A4") 및 setMarginTop("10mm")과 같은 문자열 매개변수가 있는 세터 메서드를 사용합니다. IronPDF는 RenderingOptions를 통해 PdfPaperSize.A4와 같은 열거형 및 밀리미터 단위의 여백에 대한 정수 값을 포함하는 강력하게 형식화된 속성을 제공합니다.
PDFmyURLAPI에서IronPDF매핑 참조
이 매핑은 직접적인 API 대응을 보여주어 마이그레이션을 가속화합니다:
핵심 클래스
| PDFmyURL | IronPDF |
|---|---|
HtmlToPdfClient |
ChromePdfRenderer |
PdfMyUrlClient |
ChromePdfRenderer |
| API 응답 객체 | PdfDocument |
메소드
| PDFmyURL | IronPDF |
|---|---|
client.convertUrlToFile(url, file) |
renderer.RenderUrlAsPdf(url).SaveAs(file) |
client.convertStringToFile(html, file) |
renderer.RenderHtmlAsPdf(html).SaveAs(file) |
client.convertFileToFile(input, output) |
renderer.RenderHtmlFileAsPdf(input).SaveAs(output) |
response.GetBytes() |
pdf.BinaryData |
response.GetStream() |
pdf.Stream |
구성 옵션
| PDFmyURL (setXxx 메소드) | IronPDF (RenderingOptions) |
|---|---|
setPageSize("A4") |
.PaperSize = PdfPaperSize.A4 |
setPageSize("Letter") |
.PaperSize = PdfPaperSize.Letter |
setOrientation("landscape") |
.PaperOrientation = PdfPaperOrientation.Landscape |
setOrientation("portrait") |
.PaperOrientation = PdfPaperOrientation.Portrait |
setMarginTop("10mm") |
.MarginTop = 10 |
setMarginBottom("10mm") |
.MarginBottom = 10 |
setMarginLeft("10mm") |
.MarginLeft = 10 |
setMarginRight("10mm") |
.MarginRight = 10 |
setHeaderHtml(html) |
.HtmlHeader = new HtmlHeaderFooter { HtmlFragment = html } |
setFooterHtml(html) |
.HtmlFooter = new HtmlHeaderFooter { HtmlFragment = html } |
setJavaScriptDelay(500) |
.RenderDelay = 500 |
setDisableJavaScript(true) |
.EnableJavaScript = false |
setUsePrintMedia(true) |
.CssMediaType = PdfCssMediaType.Print |
인증 비교
| PDFmyURL | IronPDF |
|---|---|
new HtmlToPdfClient("username", "apikey") |
IronPdf.License.LicenseKey = "LICENSE-KEY" |
| 요청당 API 키 | 시작 시 단 한 번 |
| 모든 호출에 필수 | 전역적으로 한 번 설정 |
일반적인 마이그레이션 문제와 해결책
문제 1: API 키 vs 라이선스 키
PDFmyURL: 모든 변환 요청에 자격 증명이 필요합니다.
해결책: 애플리케이션 시작 시IronPDF라이선스를 한 번 설정하세요:
// 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
Imports IronPdf
' PDFmyURL: API key per request
Dim client As New HtmlToPdfClient("username", "apikey")
' IronPDF: One-time license at startup
License.LicenseKey = "YOUR-LICENSE-KEY"
' Set once, typically in Program.vb or Startup.vb
문제 2: 헤더/푸터에서 자리 표시자 구문
PDFmyURL: {page_number} 및 {total_pages} 플레이스홀더를 사용합니다.
해결책: IronPDF의 자리 표시자 형식으로 업데이트하세요:
// 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}"
' PDFmyURL: "Page {page_number} of {total_pages}"
' IronPDF: "Page {page} of {total-pages}"
문제 3: 비동기 패턴
PDFmyURL: async/await 패턴이 필요합니다.
해결책: IronPDF는 기본적으로 동기화됩니다; 필요시 비동기 랩핑:
// 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));
Imports System.Threading.Tasks
' PDFmyURL: Native async
Dim response = Await client.ConvertUrlAsync(url)
' IronPDF: Sync by default, wrap for async
Dim pdf = Await Task.Run(Function() renderer.RenderUrlAsPdf(url))
문제 4: 오류 처리
PDFmyURL: 사용자 정의 Pdfcrowd.Error 예외 유형을 사용합니다.
해결책:IronPDF예외를 위한 catch 블록을 업데이트하세요:
// 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) { ... }
문제 5: 구성 패턴
PDFmyURL: 문자열 값을 가진 setter 메소드를 사용합니다.
해결책: 강력한 타입의 RenderingOptions 속성을 사용하세요:
// 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: Setter methods
client.setPageSize("A4")
client.setOrientation("landscape")
' IronPDF: Properties with enums
renderer.RenderingOptions.PaperSize = PdfPaperSize.A4
renderer.RenderingOptions.PaperOrientation = PdfPaperOrientation.Landscape
PDFmyURL마이그레이션 체크리스트
이동 전 작업
PDFmyURL 사용 사례를 식별하기 위해 코드베이스를 감사하세요:
# FindPDFmyURLusage
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" .
# FindPDFmyURLusage
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" .
현재 사용 중인 구성 옵션을 문서화하세요. 환경 변수를 사용하여 라이선스 키 저장을 계획하세요.
코드 업데이트 작업
- PDFmyURL/Pdfcrowd NuGet 패키지를 제거하세요
- IronPdf NuGet 패키지를 설치하세요
- 모든 네임스페이스 가져오기를 업데이트하세요
- API 키 인증을IronPDF라이선스 키로 교체하세요
- setter 메소드를 RenderingOptions 속성으로 변환하세요
- 헤더/푸터의 플레이스홀더 구문 업데이트 (
{page_number}→{page},{total_pages}→{total-pages}) 7.IronPDF예외 유형을 위한 오류 처리 코드를 업데이트하세요 - 시작 시IronPDF라이선스 초기화를 추가하세요
마이그레이션 후 테스트
마이그레이션 후 다음 측면을 검증:
- PDF 출력 품질이 기대에 부합하는지 테스트하세요
- 비동기 패턴이 올바르게 작동하는지 확인하세요
- 이전 출력과 렌더링 충실도를 비교하세요
- 모든 템플릿 변형이 정확하게 렌더링되는지 테스트
- 페이지 설정(크기, 방향, 여백)을 검증하세요
- Linux 서버로 배포할 경우 Linux 종속성을 설치하세요
IronPDF로 마이그레이션할 때의 주요 이점
PDFmyURL에서 IronPDF로 이전하면 여러 중요한 이점이 있습니다:
완벽한 개인정보 보호: 문서가 서버를 떠나지 않습니다. 모든 처리는 로컬에서 이루어지며 민감한 콘텐츠에 대한 데이터 보안 우려를 제거합니다.
일회 요금: 영구 라이선스 옵션으로 반복 구독 요금을 제거합니다. 사용량과 관계없이 월 사용료가 없습니다.
오프라인 기능: 초기 설정 후 인터넷 없이 작동합니다. 네트워크 장애가 PDF 생성에 영향을 미치지 않습니다.
제한 없음: 문서를 무제한으로 처리할 수 있으며 쓰로틀링에 대한 걱정이 없습니다.
낮은 레이턴시: 네트워크 오버헤드가 없어 특히 대용량 애플리케이션의 경우 변환 속도가 빠릅니다.
완전한 제어: 처리 환경을 제3자 서비스가 아닌 스스로 제어합니다.
모던 Chromium 엔진: Chrome 브라우저를 구동하는 동일한 렌더링 엔진으로 전체 CSS3 및 JavaScript를 지원합니다.
활발한 개발: .NET 10 및 C# 14의 채택이 2026년까지 증가함에 따라 IronPDF의 정기 업데이트는 현재 및 미래의 .NET 버전과의 호환성을 보장합니다.

