TextControl에서 IronPDF로의 마이그레이션 방법 (C#)
TX Text Control은 .NET 생태계에서 포괄적인 문서 편집기 구성 요소로 자리 잡고 있으며, UI 컨트롤이 포함된 강력한 DOCX 편집 기능을 제공합니다. 그러나 각 팀의 주요 요구 사항이 전체 문서 편집이 아닌 PDF 생성인 경우 TextControl의 아키텍처는 라이선스 비용, 복잡성 및 런타임 종속성에서 큰 부담이 됩니다.
이 가이드는 TextControl에서 IronPDF로의 완전한 마이그레이션 경로를 제공하며, 전문 .NET 개발자가 이 전환을 평가하기 위한 단계별 지침, 코드 비교, 실제 예제를 포함하고 있습니다.
TextControl에서 마이그레이션하는 이유
TextControl에서 마이그레이션을 결정하는 것은 일반적으로 툴링을 실제 요구 사항에 맞추는 것에 중점을 둡니다. TX Text Control은 기본적으로 PDF 생성을 부수적인 기능으로 취급하는 문서 편집기입니다. 개발 팀이 마이그레이션을 고려하는 주요 이유는 다음과 같습니다:
비싼 라이센스: 단일 TX 텍스트 컨트롤 .NET 서버 개발자 라이센스는 $4,198에 영구이며, 1년의 업데이트/지원이 포함됩니다; 4개 개발자 팀 라이센스는 $8,398에 영구 + 1년 (textcontrol.com 가격 기준). 연간 구독 갱신은 목록 가격의 약 40% 수준 (개발자당 연간 약 $1,698)이며, 갱신 창은 만료 후 30일 후에 닫힙니다. 제품 배포는 별도의 서버 실행 라이센스도 필요합니다.
보조 경로로서의 PDF: 핵심 아키텍처는 워드 프로세싱 엔진(DOCX/RTF 우선)으로, PDF는 주 표면이 아닌 내보내기 경로로 사용됩니다.
번들 편집기 표면: TX 텍스트 컨트롤은 순수 서버 측 PDF 생성이 요구될 경우 불필요할 수 있는 DOCX 편집 UI 구성 요소를 제공합니다.
워드 프로세서 아키텍처: HTML 가져오기는 Chromium 기반 렌더러가 아닌 워드 프로세싱 파이프라인을 통해 흐르므로 HTML5/CSS3의 충실도는 일반적으로 브라우저 엔진 PDF 라이브러리보다 약합니다.
ASP.NET의 STA-Affinity: ServerTextControl은 STA COM 스타일의 구성 요소 모델을 따라 가장 STA 호환 스레드에서 신뢰할 수 있으며, 이는 현대 ASP.NET Core 스택에서의 비동기/MTA 호스팅을 복잡하게 만듭니다.
복잡한 API: ServerTextControl 컨텍스트 관리 및 별도의 StringStreamType / BinaryStreamType / StreamType 열거형과 선택 주도 문서 모델이 간단한 PDF 생성 작업에 오버헤드를 추가합니다.
비용 비교
| 측면 | TX Text Control .NET Server | IronPDF |
|---|---|---|
| 단일 개발자 | $4,198 영구 + 1년 지원 | 1회성 개발자 라이선스당 |
| 4명으로 구성된 팀 | $8,398 영구 + 1년 지원 | 좌석당 낮은 가격 |
| 연간 갱신 | 목록의 약 40% (~$1,698/개발자/년) | 선택적 지원 |
| 서버 런타임 | 제품에 필요한 별도 런타임 라이센스 | 필요하지 않음 |
| UI 구성 요소 | 번들된 DOCX 편집기 | PDF 중심 |
IronPDF대 TextControl: 기능 비교
구조적 차이를 이해하면 기술 결정을 내리는데 이주 투자를 평가하는데 도움이 됩니다:
| 기능 | TX Text Control | IronPDF |
|---|---|---|
| 주된 초점 | DOCX / 워드 프로세싱 | PDF 생성 |
| 라이선스 비용 (단일 개발자) | $4,198 영구 + 1년; 연간 약 40% 갱신 | 1회성 개발자 라이선스당 |
| PDF 생성 | 워드 프로세싱 엔진의 내보내기 경로 | 코어 기능 |
| 서버 런타임 라이센스 | 제품에 필요 | 필요하지 않음 |
| 스레딩 | ASP.NET의 STA-적합성 | STA 요구 사항 없음 |
| HTML/CSS 렌더링 | 워드 프로세싱 파이프라인을 통한 HTML 가져오기 | 크로뮴 HTML5/CSS3 |
| HTML to PDF | 예 (부차적) | 예 (주요한) |
| CSS 지원 | 제한적 | 전체 CSS3 |
| JavaScript | 제한적 | 전체 ES2024 |
| URL을 PDF로 변환 | 복잡한 설정 | 내부 지원 |
| 헤더/푸터 | 복잡한 API | 간단한 HTML |
| 메일 머지 | 독점적 | HTML 템플릿 |
| PDF/A | 예 | 예 |
| 비밀번호 보호 | 예 | 예 |
| 디지털 서명 | 예 | 예 |
| PDF 병합 | 제한적 | 예 |
| PDF 분할 | 제한적 | 예 |
| 문맥 관리 | 필요함 | 필요 없음 |
| 크로스 플랫폼 | Windows 초점 | Windows / Linux / macOS / Docker |
빠른 시작: TextControl에서 IronPDF로의 마이그레이션
이러한 기본 단계를 통해 즉시 이주를 시작할 수 있습니다.
단계 1: NuGet 패키지 교체
TX Text Control의 헤드리스 서버 런타임은 단일 공개 NuGet 패키지로 배포되지 않습니다 — 공개 패키지는 편집기 동반자 TXTextControl.Web이고, 실제 ServerTextControl 런타임은 라이선스된 Windows 설치 프로그램/MSI 또는 공급자의 비공개 NuGet 피드를 통해 배포됩니다. 제거는 보통 설치 프로그램에 포함된 패키지와 TXTextControl.Web 및 MSI 제거를 의미합니다.
# RemoveTX Text Controlpackages (names depend on which were installed
# from the licensed installer / private feed / public NuGet)
dotnet remove package TXTextControl.Web
# Then install IronPDF(single self-contained package)
dotnet add package IronPdf
# RemoveTX Text Controlpackages (names depend on which were installed
# from the licensed installer / private feed / public NuGet)
dotnet remove package TXTextControl.Web
# Then install IronPDF(single self-contained package)
dotnet add package IronPdf
단계 2: 네임스페이스 업데이트
TextControl 네임스페이스를IronPDF네임스페이스로 교체하십시오:
// Before (TextControl)
using TXTextControl;
using TXTextControl.DocumentServer;
// After (IronPDF)
using IronPdf;
// Before (TextControl)
using TXTextControl;
using TXTextControl.DocumentServer;
// After (IronPDF)
using IronPdf;
Imports TXTextControl
Imports TXTextControl.DocumentServer
' After (IronPDF)
Imports IronPdf
단계 3: 라이선스 초기화
애플리케이션 시작 시 라이선스 초기화를 추가합니다:
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY"
코드 마이그레이션 예제
HTML을 PDF로 변환
가장 일반적인 사용 사례는 이러한 .NET PDF 라이브러리 간의 아키텍처적 차이를 보여줍니다.
TextControl 접근 방식:
// NuGet: Install-Package TXTextControl.Server
using TXTextControl;
using System.IO;
namespace TextControlExample
{
class Program
{
static void Main(string[] args)
{
using (ServerTextControl textControl = new ServerTextControl())
{
textControl.Create();
string html = "<html><body><h1>Hello World</h1><p>This is a PDF document.</p></body></html>";
textControl.Load(html, StringStreamType.HTMLFormat);
textControl.Save("output.pdf", StreamType.AdobePDF);
}
}
}
}
// NuGet: Install-Package TXTextControl.Server
using TXTextControl;
using System.IO;
namespace TextControlExample
{
class Program
{
static void Main(string[] args)
{
using (ServerTextControl textControl = new ServerTextControl())
{
textControl.Create();
string html = "<html><body><h1>Hello World</h1><p>This is a PDF document.</p></body></html>";
textControl.Load(html, StringStreamType.HTMLFormat);
textControl.Save("output.pdf", StreamType.AdobePDF);
}
}
}
}
Imports TXTextControl
Imports System.IO
Namespace TextControlExample
Class Program
Shared Sub Main(ByVal args As String())
Using textControl As New ServerTextControl()
textControl.Create()
Dim html As String = "<html><body><h1>Hello World</h1><p>This is a PDF document.</p></body></html>"
textControl.Load(html, StringStreamType.HTMLFormat)
textControl.Save("output.pdf", StreamType.AdobePDF)
End Using
End Sub
End Class
End Namespace
IronPDF 접근법:
// NuGet: Install-Package IronPdf
using IronPdf;
namespace IronPdfExample
{
class Program
{
static void Main(string[] args)
{
var renderer = new ChromePdfRenderer();
string html = "<html><body><h1>Hello World</h1><p>This is a PDF document.</p></body></html>";
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("output.pdf");
}
}
}
// NuGet: Install-Package IronPdf
using IronPdf;
namespace IronPdfExample
{
class Program
{
static void Main(string[] args)
{
var renderer = new ChromePdfRenderer();
string html = "<html><body><h1>Hello World</h1><p>This is a PDF document.</p></body></html>";
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("output.pdf");
}
}
}
Imports IronPdf
Namespace IronPdfExample
Class Program
Shared Sub Main(ByVal args As String())
Dim renderer = New ChromePdfRenderer()
Dim html As String = "<html><body><h1>Hello World</h1><p>This is a PDF document.</p></body></html>"
Dim pdf = renderer.RenderHtmlAsPdf(html)
pdf.SaveAs("output.pdf")
End Sub
End Class
End Namespace
TextControl 버전에는 ServerTextControl 인스턴스를 생성하고, 컨텍스트를 초기화하기 위해 Create()을 호출하며, StreamType.HTMLFormat로 HTML을 로딩하고, StreamType.AdobePDF로 저장해야 합니다. using 블록은 적절한 리소스 해제를 위해 필수적입니다.
IronPDF는 컨텍스트 관리를 완전히 제거합니다. ChromePdfRenderer는 초기화 의식이 필요 없으며, 생성, HTML 렌더링, 저장을 할 수 있습니다. 이 아키텍처 단순화는 인지 부하와 잠재적 리소스 관리 버그를 줄입니다.
고급 HTML에서 PDF로의 시나리오는 HTML to PDF 변환 가이드를 참조하십시오.
여러 PDF 병합
PDF 병합은 이 라이브러리들 간의 또 다른 중요한 복잡성 차이를 보여줍니다.
TextControl 접근 방식:
// NuGet: Install-Package TXTextControl.Server
using TXTextControl;
using System.IO;
namespace TextControlExample
{
class Program
{
static void Main(string[] args)
{
using (ServerTextControl textControl = new ServerTextControl())
{
textControl.Create();
byte[] pdf1 = File.ReadAllBytes("document1.pdf");
textControl.Load(pdf1, BinaryStreamType.AdobePDF);
byte[] pdf2 = File.ReadAllBytes("document2.pdf");
textControl.Append(pdf2, BinaryStreamType.AdobePDF, AppendSettings.StartWithNewSection);
textControl.Save("merged.pdf", StreamType.AdobePDF);
}
}
}
}
// NuGet: Install-Package TXTextControl.Server
using TXTextControl;
using System.IO;
namespace TextControlExample
{
class Program
{
static void Main(string[] args)
{
using (ServerTextControl textControl = new ServerTextControl())
{
textControl.Create();
byte[] pdf1 = File.ReadAllBytes("document1.pdf");
textControl.Load(pdf1, BinaryStreamType.AdobePDF);
byte[] pdf2 = File.ReadAllBytes("document2.pdf");
textControl.Append(pdf2, BinaryStreamType.AdobePDF, AppendSettings.StartWithNewSection);
textControl.Save("merged.pdf", StreamType.AdobePDF);
}
}
}
}
Imports TXTextControl
Imports System.IO
Namespace TextControlExample
Class Program
Shared Sub Main(ByVal args As String())
Using textControl As New ServerTextControl()
textControl.Create()
Dim pdf1 As Byte() = File.ReadAllBytes("document1.pdf")
textControl.Load(pdf1, BinaryStreamType.AdobePDF)
Dim pdf2 As Byte() = File.ReadAllBytes("document2.pdf")
textControl.Append(pdf2, BinaryStreamType.AdobePDF, AppendSettings.StartWithNewSection)
textControl.Save("merged.pdf", StreamType.AdobePDF)
End Using
End Sub
End Class
End Namespace
IronPDF 접근법:
// NuGet: Install-Package IronPdf
using IronPdf;
namespace IronPdfExample
{
class Program
{
static void Main(string[] args)
{
var pdf1 = PdfDocument.FromFile("document1.pdf");
var pdf2 = PdfDocument.FromFile("document2.pdf");
var merged = PdfDocument.Merge(pdf1, pdf2);
merged.SaveAs("merged.pdf");
}
}
}
// NuGet: Install-Package IronPdf
using IronPdf;
namespace IronPdfExample
{
class Program
{
static void Main(string[] args)
{
var pdf1 = PdfDocument.FromFile("document1.pdf");
var pdf2 = PdfDocument.FromFile("document2.pdf");
var merged = PdfDocument.Merge(pdf1, pdf2);
merged.SaveAs("merged.pdf");
}
}
}
Imports IronPdf
Namespace IronPdfExample
Class Program
Shared Sub Main(ByVal args As String())
Dim pdf1 = PdfDocument.FromFile("document1.pdf")
Dim pdf2 = PdfDocument.FromFile("document2.pdf")
Dim merged = PdfDocument.Merge(pdf1, pdf2)
merged.SaveAs("merged.pdf")
End Sub
End Class
End Namespace
TextControl은 파일을 바이트 배열로 읽고, ServerTextControl 컨텍스트를 관리하며, 문서를 연결하기 위해 BinaryStreamType.AdobePDF 및 AppendSettings.StartWithNewSection와 함께 Append를 호출해야 합니다. IronPDF의 PdfDocument.Merge() 메서드는 모든 것을 단일 명시적 호출로 처리합니다.
선택적 페이지 추출을 포함한 고급 병합 시나리오에 대해서는 병합 및 분할 PDF 가이드를 참조하십시오.
헤더 및 풋터 추가
동적 페이지 번호가 있는 헤더와 푸터는 API 복잡성 차이를 보여줍니다.
TextControl 접근 방식:
// NuGet: Install-Package TXTextControl.Server
using TXTextControl;
using System.IO;
namespace TextControlExample
{
class Program
{
static void Main(string[] args)
{
using (ServerTextControl textControl = new ServerTextControl())
{
textControl.Create();
string html = "<html><body><h1>Document Content</h1><p>Main body text.</p></body></html>";
textControl.Load(html, StringStreamType.HTMLFormat);
HeaderFooter header = new HeaderFooter(HeaderFooterType.Header);
header.Text = "Document Header";
textControl.Sections[0].HeadersAndFooters.Add(header);
HeaderFooter footer = new HeaderFooter(HeaderFooterType.Footer);
footer.Text = "Page {page} of {numpages}";
textControl.Sections[0].HeadersAndFooters.Add(footer);
textControl.Save("output.pdf", StreamType.AdobePDF);
}
}
}
}
// NuGet: Install-Package TXTextControl.Server
using TXTextControl;
using System.IO;
namespace TextControlExample
{
class Program
{
static void Main(string[] args)
{
using (ServerTextControl textControl = new ServerTextControl())
{
textControl.Create();
string html = "<html><body><h1>Document Content</h1><p>Main body text.</p></body></html>";
textControl.Load(html, StringStreamType.HTMLFormat);
HeaderFooter header = new HeaderFooter(HeaderFooterType.Header);
header.Text = "Document Header";
textControl.Sections[0].HeadersAndFooters.Add(header);
HeaderFooter footer = new HeaderFooter(HeaderFooterType.Footer);
footer.Text = "Page {page} of {numpages}";
textControl.Sections[0].HeadersAndFooters.Add(footer);
textControl.Save("output.pdf", StreamType.AdobePDF);
}
}
}
}
Imports TXTextControl
Imports System.IO
Namespace TextControlExample
Class Program
Shared Sub Main(ByVal args As String())
Using textControl As New ServerTextControl()
textControl.Create()
Dim html As String = "<html><body><h1>Document Content</h1><p>Main body text.</p></body></html>"
textControl.Load(html, StringStreamType.HTMLFormat)
Dim header As New HeaderFooter(HeaderFooterType.Header)
header.Text = "Document Header"
textControl.Sections(0).HeadersAndFooters.Add(header)
Dim footer As New HeaderFooter(HeaderFooterType.Footer)
footer.Text = "Page {page} of {numpages}"
textControl.Sections(0).HeadersAndFooters.Add(footer)
textControl.Save("output.pdf", StreamType.AdobePDF)
End Using
End Sub
End Class
End Namespace
IronPDF 접근법:
// NuGet: Install-Package IronPdf
using IronPdf;
using IronPdf.Rendering;
namespace IronPdfExample
{
class Program
{
static void Main(string[] args)
{
var renderer = new ChromePdfRenderer();
string html = "<html><body><h1>Document Content</h1><p>Main body text.</p></body></html>";
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.AddTextHeader("Document Header");
pdf.AddTextFooter("Page {page} of {total-pages}");
pdf.SaveAs("output.pdf");
}
}
}
// NuGet: Install-Package IronPdf
using IronPdf;
using IronPdf.Rendering;
namespace IronPdfExample
{
class Program
{
static void Main(string[] args)
{
var renderer = new ChromePdfRenderer();
string html = "<html><body><h1>Document Content</h1><p>Main body text.</p></body></html>";
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.AddTextHeader("Document Header");
pdf.AddTextFooter("Page {page} of {total-pages}");
pdf.SaveAs("output.pdf");
}
}
}
Imports IronPdf
Imports IronPdf.Rendering
Namespace IronPdfExample
Class Program
Shared Sub Main(args As String())
Dim renderer As New ChromePdfRenderer()
Dim html As String = "<html><body><h1>Document Content</h1><p>Main body text.</p></body></html>"
Dim pdf = renderer.RenderHtmlAsPdf(html)
pdf.AddTextHeader("Document Header")
pdf.AddTextFooter("Page {page} of {total-pages}")
pdf.SaveAs("output.pdf")
End Sub
End Class
End Namespace
TextControl은 특정 HeaderFooterType 열거형이 있는 HeaderFooter 객체를 생성하고, textControl.Sections[0]을 통해 문서 섹션에 접근하며, HeadersAndFooters 컬렉션에 추가해야 합니다. IronPDF는 간단한 플레이스홀더 구문을 통해 직접 AddTextHeader 및 AddTextFooter 메서드( TextHeaderFooter 통해)를 제공합니다.
완전한 스타일링 제어가 가능한 HTML 기반 헤더의 경우, IronPDF는 HtmlHeaderFooter도 지원합니다:
renderer.RenderingOptions.HtmlHeader = new HtmlHeaderFooter
{
HtmlFragment = @"
<div style='width: 100%; text-align: center; font-size: 12pt;'>
Company Report
</div>",
MaxHeight = 30
};
renderer.RenderingOptions.HtmlFooter = new HtmlHeaderFooter
{
HtmlFragment = @"
<div style='width: 100%; text-align: right; font-size: 10pt;'>
Page {page} of {total-pages}
</div>",
MaxHeight = 25
};
renderer.RenderingOptions.HtmlHeader = new HtmlHeaderFooter
{
HtmlFragment = @"
<div style='width: 100%; text-align: center; font-size: 12pt;'>
Company Report
</div>",
MaxHeight = 30
};
renderer.RenderingOptions.HtmlFooter = new HtmlHeaderFooter
{
HtmlFragment = @"
<div style='width: 100%; text-align: right; font-size: 10pt;'>
Page {page} of {total-pages}
</div>",
MaxHeight = 25
};
renderer.RenderingOptions.HtmlHeader = New HtmlHeaderFooter With {
.HtmlFragment = "
<div style='width: 100%; text-align: center; font-size: 12pt;'>
Company Report
</div>",
.MaxHeight = 30
}
renderer.RenderingOptions.HtmlFooter = New HtmlHeaderFooter With {
.HtmlFragment = "
<div style='width: 100%; text-align: right; font-size: 10pt;'>
Page {page} of {total-pages}
</div>",
.MaxHeight = 25
}
더 많은 헤더와 푸터 옵션에 대해 알아보세요 헤더와 푸터 문서에서.
TextControl API에서 IronPDF로의 매핑 참조
이 매핑은 직접적인 API 대응을 보여주어 마이그레이션을 가속화합니다:
| TX Text Control | IronPDF |
|---|---|
ServerTextControl.Create() |
new ChromePdfRenderer() |
tx.Load(html, StringStreamType.HTMLFormat) |
renderer.RenderHtmlAsPdf(html) |
tx.Load(bytes, BinaryStreamType.AdobePDF) |
PdfDocument.FromFile(...) / FromBinaryData(...) |
tx.Save(path, StreamType.AdobePDF) |
pdf.SaveAs(path) |
tx.Append(bytes, BinaryStreamType.AdobePDF, AppendSettings.StartWithNewSection) |
PdfDocument.Merge(a, b) |
SaveSettings.PDFAConformance |
RenderingOptions.PdfAFormat |
DocumentServer.MailMerge |
HTML 템플릿 + Razor |
HeaderFooter + Sections[i].HeadersAndFooters |
HtmlHeaderFooter / TextHeaderFooter |
LoadSettings |
RenderingOptions |
StreamType.AdobePDF |
기본 출력 |
일반적인 마이그레이션 문제와 해결책
문제 1: ServerTextControl 문맥
TextControl은 모든 작업에 대해 Create() 및 using 블록을 요구합니다.
해결책: IronPDF는 문맥 관리가 필요 없습니다:
// Just create and use
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf(html);
// Just create and use
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf(html);
' Just create and use
Dim renderer As New ChromePdfRenderer()
Dim pdf = renderer.RenderHtmlAsPdf(html)
문제 2: StreamType 변환
TextControl은 문자열 오버로드를 위한 StringStreamType, 바이트[] 오버로드를 위한 BinaryStreamType, 파일 경로 저장을 위한 StreamType 등 세 가지 열거형을 사용해 다양한 포맷을 로드하고 PDF로 내보내야 합니다.
해결책: IronPDF는 중간 형식 변환 없이 HTML을 직접 렌더링합니다:
// No format conversion needed
var pdf = renderer.RenderHtmlAsPdf(html);
// No format conversion needed
var pdf = renderer.RenderHtmlAsPdf(html);
Dim pdf = renderer.RenderHtmlAsPdf(html)
문제 3: DOCX 템플릿
TextControl은 메일 머지가 있는 템플릿에 DOCX 파일을 사용합니다.
해결책: C# 문자열 보간법 또는 Razor를 사용하여 HTML 템플릿으로 변환하세요:
var data = new { CustomerName = "John Doe", InvoiceNumber = "12345", Total = "$1,500.00" };
var html = $@"
<html>
<head>
<style>
body {{font-family: Arial; padding: 40px;}}
h1 {{color: #333;}}
.total {{font-size: 24px; color: green;}}
</style>
</head>
<body>
<h1>Invoice #{data.InvoiceNumber}</h1>
<p>Customer: {data.CustomerName}</p>
<p class='total'>Total: {data.Total}</p>
</body>
</html>";
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("invoice.pdf");
var data = new { CustomerName = "John Doe", InvoiceNumber = "12345", Total = "$1,500.00" };
var html = $@"
<html>
<head>
<style>
body {{font-family: Arial; padding: 40px;}}
h1 {{color: #333;}}
.total {{font-size: 24px; color: green;}}
</style>
</head>
<body>
<h1>Invoice #{data.InvoiceNumber}</h1>
<p>Customer: {data.CustomerName}</p>
<p class='total'>Total: {data.Total}</p>
</body>
</html>";
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("invoice.pdf");
Imports IronPdf
Dim data = New With {Key .CustomerName = "John Doe", Key .InvoiceNumber = "12345", Key .Total = "$1,500.00"}
Dim html = $"
<html>
<head>
<style>
body {{font-family: Arial; padding: 40px;}}
h1 {{color: #333;}}
.total {{font-size: 24px; color: green;}}
</style>
</head>
<body>
<h1>Invoice #{data.InvoiceNumber}</h1>
<p>Customer: {data.CustomerName}</p>
<p class='total'>Total: {data.Total}</p>
</body>
</html>"
Dim renderer As New ChromePdfRenderer()
Dim pdf = renderer.RenderHtmlAsPdf(html)
pdf.SaveAs("invoice.pdf")
문제 4: ASP.NET의 STA 친화성
TextControl ServerTextControl은 전통적으로 STA COM 스타일 구성 요소 모델에서 유래하며, STA 호환 스레드 (예: ASP.NET Core에서 전용 STA 스레드/큐에서 래핑 호출)를 호스팅할 때 가장 신뢰할 수 있습니다. MTA 작업 스레드와 자유롭게 혼합하면 부하가 걸릴 경우 가끔 스레드 친화성 오류가 발생할 수 있습니다.
해결책: IronPDF는 STA 요구 사항이 없으며 MTA 작업 스레드, 비동기 컨트롤러, .NET 6/7/8/9에서 Linux 컨테이너 내에서 수정 없이 실행됩니다.
TextControl 마이그레이션 체크리스트
이동 전 작업
모든 TextControl 사용을 식별하기 위해 코드베이스를 감사하세요:
grep -r "using TXTextControl" --include="*.cs" .
grep -r "ServerTextControl\|Load\|Save" --include="*.cs" .
grep -r "using TXTextControl" --include="*.cs" .
grep -r "ServerTextControl\|Load\|Save" --include="*.cs" .
메일 병합 템플릿을 HTML로 변환하기 위해 문서화하세요. HtmlHeaderFooter 구현을 위한 헤더/바닥글 요구 사항에 유의하십시오. 대체 솔루션이 필요할 수 있는 DOCX 편집 기능을 식별하세요.
코드 업데이트 작업
1.TX Text ControlNuGet 패키지를 제거하세요 2.IronPDF NuGet Install-Package
ServerTextControl컨텍스트 관리를 제거합니다 (더 이상Create()호출 없음)StringStreamType.HTMLFormat로드를RenderHtmlAsPdf로 변환합니다.- 문자열 보간법 또는 Razor로 메일 병합을 HTML 템플릿으로 변환하세요
- 헤더/바닥글을
HtmlHeaderFooter또는AddTextFooter를 사용하도록 업데이트합니다. RenderingOptions를 사용하여 페이지 설정을 단순화합니다.- 시작 시 라이선스 초기화를 추가
마이그레이션 후 테스트
마이그레이션 후 다음 측면을 검증:
- 모든 문서 템플릿이 올바르게 렌더링되는지 테스트하세요
- 필요 시PDF/A준수를 확인하세요
- 비밀번호 보호 기능을 테스트하세요
- 모든 페이지에 헤더/바닥글이 나타나는지 확인하세요
- MTA 작업 스레드 및 Linux 컨테이너에서 ASP.NET Core 호스팅을 확인하십시오 — IronPDF에는 STA 친화성 요구 사항이 없습니다
IronPDF로 마이그레이션할 때의 주요 이점
TextControl에서 IronPDF로 이동하는 것은 PDF 생성에 집중하는 팀에게 여러 가지 장점을 제공합니다:
PDF-우선 아키텍처: IronPDF는 PDF 생성을 위해 특별히 맞춤 제작되었으며, 현대 HTML5 및 CSS3 표준을 활용하여 문서 생성 및 렌더링 기능을 제공합니다.
비용 효율성: IronPDF의 일회성 개발자당 가격은TX Text Control.NET 서버의 $4,198 영구 + 1년 입문 및 연간 ~40% 갱신 모델과 비교해 유리하며, 특히 개별 서버 런타임 라이선싱까지 고려하면 좋습니다.
STA 친화성 없음: IronPDF는 표준 MTA 작업 스레드, ASP.NET Core 비동기 컨트롤러, Linux 컨테이너에서 STA 호환 호스팅 고려사항 없이 실행됩니다.
컨텍스트 관리 없음: ServerTextControl 생성 절차와 세 가지 열거형 (StringStreamType / BinaryStreamType / StreamType) 로드/저장 과정을 제거합니다 — ChromePdfRenderer는 비상태적입니다.
현대적 렌더링 엔진: IronPDF의 Chromium 기반 렌더링은 단어 처리 엔진 HTML 가져오기 경로 대신 최신 HTML5/CSS3/JavaScript 표준을 대상으로 합니다.

