RawPrint에서 IronPDF로의 마이그레이션 방법 (C#)
RawPrint에서 IronPDF로 이동하는 것은 교체보다 재구성에 가깝습니다: RawPrint와 IronPDF는 다른 문제를 해결하며, 대부분의 팀에서는 '대체'보다 '보완'이 정직합니다. 이 가이드는 IronPDF가 실제로RawPrint파이프라인 Windows에서 PDF를 생성한 다음 푸시하는 워크플로우)에서 대체할 수 있는 경우를 다루며, RawPrint를 계속 사용해야 하는 경우 (ESC/POS, ZPL, EPL, RAW PCL)를 표시합니다.
왜 RawPrint에서 IronPDF로 마이그레이션하는가
RawPrint이해하기
RawPrint은 NuGet 패키지 RawPrint (frogmorecs/RawPrint, v0.5.0, 2019년 9월에 마지막으로 릴리스, 현재 nuget.org에서 목록 해제/레거시)입니다. 이는 winspool.Drv을(를) 통해 바이트 스트림을 Windows인쇄 스풀러로 직접 보내는 얇은 P/Invoke 래퍼입니다. 공개 API는 작습니다: RawPrint 네임스페이스에서 IPrinter을 구현하는 Printer 클래스로, PrintRawFile 및 PrintRawStream 오버로드를 노출합니다. 기반이 되는 Win32 호출(OpenPrinter, StartDocPrinter, WritePrinter, EndDocPrinter, ClosePrinter)은 해당 인터페이스 뒤에 숨겨져 있습니다 — 패키지를 사용할 때 이를 직접 작성하지 않습니다.
ESC/POS 영수증 프린터, ZPL/EPL Zebra 레이블 프린터, 그리고 프린터 펌웨어가 기대하는 바이트를 이미 생성한 구형 PCL/PostScript 작업에 RawPrint가 적합합니다. Windows특정 환경을 목표로 하고 직접적인 프린터 통신이 필요한 개발자에게 RawPrint는 드라이버나 그래픽 인터페이스 같은 중간 계층을 우회하는 효율적인 경로를 제공합니다.
그러나 RawPrint는 PDF 라이브러리가 아닙니다 — 프린터로 데이터를 직접 전달할 뿐입니다. 현재 다른 라이브러리에서 PDF를 구축한 다음 RawPrint에 전달하는 애플리케이션이라면, 이 전체 파이프라인을 IronPDF로 Windows에서 대체할 수 있습니다.
핵심 문제: PDF 생성 불가
RawPrint에는 현대 문서 워크플로에 적합하지 않은 주요 제한이 있습니다:
-
PDF 생성 불가: RawPrint는 단순히 데이터 전송에 집중되어 있으며, PDF 생성, 렌더링, 또는 조작 기능이 부족합니다.
-
아주 낮은 수준: 원시 바이트를 직접 처리함으로써, 개발자는 프린터의 명령 언어에 대한 깊은 이해가 필요하며, 이는 간단한 문서 인쇄 작업에 덜 적합합니다.
-
플랫폼 의존성: Windows인쇄 스풀러에 의존하여, 크로스 플랫폼 적용 가능성을 제한합니다.
-
문서 처리 불가: 렌더링 기능 없이 바이트 전송만 가능.
- 제어 제한: 최소한의 인쇄 작업 구성 옵션.
RawPrintvsIronPDF비교
| 기능 | RawPrint | IronPDF |
|---|---|---|
| 기능 | 프린터로 원시 인쇄 데이터를 직접 전송 | 포괄적인 PDF 생성 및 조작 |
| 사용 사례 | 라벨과 같은 특수 인쇄 | 일반 문서 관리 및 생성 |
| 플랫폼 의존성 | Windows 전용 | 크로스 플랫폼 |
| 복잡성 | 낮은 수준으로, 프린터 명령 지식 필요 | 고급 사용자 친화적 API |
| PDF 생성 | 아니요 | 예 |
| HTML에서 PDF 생성 | 아니요 | 예 |
| URL에서 PDF 생성 | 아니요 | 예 |
| PDF 편집/수정 | 아니요 | 예 |
| PDF 병합/분할 | 아니요 | 예 |
| 기존 PDF 인쇄 | 예 (원시 바이트) | 예 (고급 API) |
| 인쇄 제어 | 기초적인 | 전체 옵션 |
| 이상적임 | 직접적인 프린터 접근 필요 | 웹 및 데스크톱 앱에서 PDF 관련 작업 |
| 유연성 | 원시 바이트 처리로 인해 제한됨 | 다양한 기능 제공 |
RawPrint에 비해 IronPDF는 PDF를 포괄적으로 처리하는 강력하고 다양한 API를 제공합니다. .NET 환경에서 확립된 이름으로서, IronPDF는 개발자가 플랫폼 간에 손쉽게 PDF를 생성, 편집 및 변환할 수 있게 합니다.
현대 .NET을 대상으로 하는 팀에게 IronPDF는 RawPrint가 설계상 제공하지 않는 크로스 플랫폼 호환성을 제공합니다.
시작하기 전에
필수 조건
- .NET 환경: .NET Framework 4.6.2+ 또는 .NET Core 3.1+ / .NET 5/6/7/8/9+
- NuGet 접근 권한: NuGet 패키지를 설치할 수 있는 능력
- IronPDF 라이선스: ironpdf.com에서 라이선스 키를 획득하세요
NuGet 패키지 변경 사항
# Remove RawPrint
dotnet remove package RawPrint
# Install IronPDF
dotnet add package IronPdf
# Remove RawPrint
dotnet remove package RawPrint
# Install IronPDF
dotnet add package IronPdf
라이선스 구성
// Add at application startup
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
// Add at application startup
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
' Add at application startup
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY"
RawPrint사용 찾기
# Identify allRawPrintusage
grep -r "using RawPrint" --include="*.cs" .
grep -r "PrintRawFile\|PrintRawStream" --include="*.cs" .
# Identify allRawPrintusage
grep -r "using RawPrint" --include="*.cs" .
grep -r "PrintRawFile\|PrintRawStream" --include="*.cs" .
참고: winspool.Drv 주변에 손으로 만든 P/Invoke 래퍼는 가끔 클래스 이름 RawPrinterHelper을 사용하여RawPrint사용과 겉보기에는 유사하지만, 패키지가 아닙니다 — Win32 스풀러를 직접 호출합니다. 패키지 자체는 IPrinter만을 PrintRawFile 및 PrintRawStream로 노출합니다.
완전한 API 참조
네임스페이스 변경
// Before: RawPrint
using RawPrint;
// After: IronPDF
using IronPdf;
// Before: RawPrint
using RawPrint;
// After: IronPDF
using IronPdf;
Imports IronPdf
핵심 API 매핑
| RawPrint (실제 공공 API) | IronPDF | 노트 |
|---|---|---|
new Printer() / IPrinter |
new ChromePdfRenderer() / PdfDocument |
RawPrint는 바이트를 전달합니다; IronPDF는 PDF를 생성합니다 |
printer.PrintRawFile(name, path, paused) |
PdfDocument.FromFile(path).Print() |
IronPDF는 OS 인쇄 시스템으로 재렌더링합니다; RAW 아님 |
printer.PrintRawStream(name, stream, doc, paused) |
new PdfDocument(stream).Print() |
같은 주의 |
printer.OnJobCreated 이벤트 |
n/a | 대신IronPDF인쇄 옵션을 사용하세요 |
| n/a | ChromePdfRenderer.RenderHtmlAsPdf() |
PDF 생성 |
| n/a | PdfDocument.Merge() |
PDF 병합 |
| n/a | pdf.ApplyWatermark() |
워터마크 추가 |
IronPDF는 문서를 운영 체제에 전달하여 인쇄하며, 스풀러로 원시 바이트를 스트리밍하지 않습니다. 프린터가 RAW 데이터 유형 (ESC/POS, ZPL, 특정 PCL 워크플로우)을 요구하는 경우, 이것이 RawPrint의 역할이며 IronPDF는 대체할 수 없습니다.
코드 마이그레이션 예제
예제 1: HTML에서 PDF로 변환
이전 (RawPrint):
// NuGet: Install-Package RawPrint
using System;
using System.IO;
using System.Text;
using RawPrint;
class Program
{
static void Main()
{
//RawPrintcannot convert HTML to PDF. Sending raw HTML bytes to a printer just
// prints the HTML source as text — the markup is not rendered.
string html = "<html><body><h1>Hello World</h1></body></html>";
byte[] data = Encoding.ASCII.GetBytes(html);
IPrinter printer = new Printer();
using (var stream = new MemoryStream(data))
{
// PrintRawStream(printerName, stream, documentName, paused)
printer.PrintRawStream("Microsoft Print to PDF", stream, "HTML Document", false);
}
Console.WriteLine("Raw HTML bytes sent to spooler (not rendered).");
}
}
// NuGet: Install-Package RawPrint
using System;
using System.IO;
using System.Text;
using RawPrint;
class Program
{
static void Main()
{
//RawPrintcannot convert HTML to PDF. Sending raw HTML bytes to a printer just
// prints the HTML source as text — the markup is not rendered.
string html = "<html><body><h1>Hello World</h1></body></html>";
byte[] data = Encoding.ASCII.GetBytes(html);
IPrinter printer = new Printer();
using (var stream = new MemoryStream(data))
{
// PrintRawStream(printerName, stream, documentName, paused)
printer.PrintRawStream("Microsoft Print to PDF", stream, "HTML Document", false);
}
Console.WriteLine("Raw HTML bytes sent to spooler (not rendered).");
}
}
Imports System
Imports System.IO
Imports System.Text
Imports RawPrint
Class Program
Shared Sub Main()
' RawPrint cannot convert HTML to PDF. Sending raw HTML bytes to a printer just
' prints the HTML source as text — the markup is not rendered.
Dim html As String = "<html><body><h1>Hello World</h1></body></html>"
Dim data As Byte() = Encoding.ASCII.GetBytes(html)
Dim printer As IPrinter = New Printer()
Using stream As New MemoryStream(data)
' PrintRawStream(printerName, stream, documentName, paused)
printer.PrintRawStream("Microsoft Print to PDF", stream, "HTML Document", False)
End Using
Console.WriteLine("Raw HTML bytes sent to spooler (not rendered).")
End Sub
End Class
이후 (IronPDF):
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class Program
{
static void Main()
{
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
var renderer = new ChromePdfRenderer();
string html = "<html><body><h1>Hello World</h1></body></html>";
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("output.pdf");
Console.WriteLine("PDF created successfully");
}
}
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class Program
{
static void Main()
{
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
var renderer = new ChromePdfRenderer();
string html = "<html><body><h1>Hello World</h1></body></html>";
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("output.pdf");
Console.WriteLine("PDF created successfully");
}
}
Imports IronPdf
Imports System
Class Program
Shared Sub Main()
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY"
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")
Console.WriteLine("PDF created successfully")
End Sub
End Class
패키지 자체의 친숙한 API에서도 아키텍처의 불일치는 눈에 띕니다: RawPrint는 RAW 데이터 유형으로 Windows스풀러에 바이트를 전달하므로 HTML을 전달하면 프린터는 원본 텍스트를 인쇄합니다. IronPDF의 ChromePdfRenderer는 실제로 마크업을 렌더링합니다. 포괄적인 예제를 보려면 HTML to PDF 문서를 참조하세요.
예제 2: URL에서 PDF로 변환
이전 (RawPrint):
// NuGet: Install-Package RawPrint
using System;
using System.IO;
using System.Net.Http;
using System.Text;
using RawPrint;
class Program
{
static void Main()
{
//RawPrintcannot fetch a URL or render a web page; downloading the HTML and
// shipping it to the spooler just prints the raw HTML source.
using (var client = new HttpClient())
{
string htmlSource = client.GetStringAsync("https://example.com").GetAwaiter().GetResult();
byte[] data = Encoding.UTF8.GetBytes(htmlSource);
IPrinter printer = new Printer();
using (var stream = new MemoryStream(data))
{
printer.PrintRawStream("Microsoft Print to PDF", stream, "Web Page", false);
}
Console.WriteLine("Raw HTML sent to spooler (not a rendered PDF).");
}
}
}
// NuGet: Install-Package RawPrint
using System;
using System.IO;
using System.Net.Http;
using System.Text;
using RawPrint;
class Program
{
static void Main()
{
//RawPrintcannot fetch a URL or render a web page; downloading the HTML and
// shipping it to the spooler just prints the raw HTML source.
using (var client = new HttpClient())
{
string htmlSource = client.GetStringAsync("https://example.com").GetAwaiter().GetResult();
byte[] data = Encoding.UTF8.GetBytes(htmlSource);
IPrinter printer = new Printer();
using (var stream = new MemoryStream(data))
{
printer.PrintRawStream("Microsoft Print to PDF", stream, "Web Page", false);
}
Console.WriteLine("Raw HTML sent to spooler (not a rendered PDF).");
}
}
}
Imports System
Imports System.IO
Imports System.Net.Http
Imports System.Text
Imports RawPrint
Module Program
Sub Main()
' RawPrint cannot fetch a URL or render a web page; downloading the HTML and
' shipping it to the spooler just prints the raw HTML source.
Using client As New HttpClient()
Dim htmlSource As String = client.GetStringAsync("https://example.com").GetAwaiter().GetResult()
Dim data As Byte() = Encoding.UTF8.GetBytes(htmlSource)
Dim printer As IPrinter = New Printer()
Using stream As New MemoryStream(data)
printer.PrintRawStream("Microsoft Print to PDF", stream, "Web Page", False)
End Using
Console.WriteLine("Raw HTML sent to spooler (not a rendered PDF).")
End Using
End Sub
End Module
이후 (IronPDF):
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class Program
{
static void Main()
{
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
var renderer = new ChromePdfRenderer();
// Render a live website directly to PDF with full CSS, JavaScript, and images
var pdf = renderer.RenderUrlAsPdf("https://example.com");
pdf.SaveAs("webpage.pdf");
Console.WriteLine("Website rendered to PDF successfully");
}
}
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class Program
{
static void Main()
{
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
var renderer = new ChromePdfRenderer();
// Render a live website directly to PDF with full CSS, JavaScript, and images
var pdf = renderer.RenderUrlAsPdf("https://example.com");
pdf.SaveAs("webpage.pdf");
Console.WriteLine("Website rendered to PDF successfully");
}
}
Imports IronPdf
Imports System
Class Program
Shared Sub Main()
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY"
Dim renderer = New ChromePdfRenderer()
' Render a live website directly to PDF with full CSS, JavaScript, and images
Dim pdf = renderer.RenderUrlAsPdf("https://example.com")
pdf.SaveAs("webpage.pdf")
Console.WriteLine("Website rendered to PDF successfully")
End Sub
End Class
RawPrint는 웹 페이지를 렌더링할 수 없습니다 — 스풀러에 바이트만 전달합니다. HTML을 다운로드하여 결과론으로 프린터가 소스 텍스트를 인쇄합니다. 렌더링된 컨텐츠는 아닙니다. IronPDF의 RenderUrlAsPdf()는 CSS, JavaScript 및 이미지를 사용하여 완전히 렌더링된 웹 페이지를 캡처합니다. 더 많은 정보를 보려면 튜토리얼을 참조하세요.
예제 3: 문서 형식화
이전 (RawPrint):
// NuGet: Install-Package RawPrint
using System;
using System.IO;
using System.Text;
using RawPrint;
class Program
{
static void Main()
{
//RawPrinthas no concept of fonts, margins, or layout — formatting must be
// expressed in the printer's own command language (PCL, PostScript, ESC/POS, ZPL).
// Example: a tiny PCL5 stream that selects portrait and a 16.66cpi font.
string pclCommands = "\x1B&l0O\x1B(s0p16.66h8.5v0s0b3T";
string text = "Plain text document - formatting must be expressed in printer command language";
byte[] data = Encoding.ASCII.GetBytes(pclCommands + text);
IPrinter printer = new Printer();
using (var stream = new MemoryStream(data))
{
printer.PrintRawStream("HP LaserJet", stream, "Raw Document", false);
}
}
}
// NuGet: Install-Package RawPrint
using System;
using System.IO;
using System.Text;
using RawPrint;
class Program
{
static void Main()
{
//RawPrinthas no concept of fonts, margins, or layout — formatting must be
// expressed in the printer's own command language (PCL, PostScript, ESC/POS, ZPL).
// Example: a tiny PCL5 stream that selects portrait and a 16.66cpi font.
string pclCommands = "\x1B&l0O\x1B(s0p16.66h8.5v0s0b3T";
string text = "Plain text document - formatting must be expressed in printer command language";
byte[] data = Encoding.ASCII.GetBytes(pclCommands + text);
IPrinter printer = new Printer();
using (var stream = new MemoryStream(data))
{
printer.PrintRawStream("HP LaserJet", stream, "Raw Document", false);
}
}
}
Imports System
Imports System.IO
Imports System.Text
Imports RawPrint
Module Program
Sub Main()
' RawPrint has no concept of fonts, margins, or layout — formatting must be
' expressed in the printer's own command language (PCL, PostScript, ESC/POS, ZPL).
' Example: a tiny PCL5 stream that selects portrait and a 16.66cpi font.
Dim pclCommands As String = ChrW(&H1B) & "&l0O" & ChrW(&H1B) & "(s0p16.66h8.5v0s0b3T"
Dim text As String = "Plain text document - formatting must be expressed in printer command language"
Dim data As Byte() = Encoding.ASCII.GetBytes(pclCommands & text)
Dim printer As IPrinter = New Printer()
Using stream As New MemoryStream(data)
printer.PrintRawStream("HP LaserJet", stream, "Raw Document", False)
End Using
End Sub
End Module
이후 (IronPDF):
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class Program
{
static void Main()
{
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
var renderer = new ChromePdfRenderer();
string html = @"
<html>
<head>
<style>
body { font-family: Arial; margin: 40px; }
h1 { color: #2c3e50; font-size: 24px; }
p { line-height: 1.6; color: #34495e; }
.highlight { background-color: yellow; font-weight: bold; }
</style>
</head>
<body>
<h1>Formatted Document</h1>
<p>This is a <span class='highlight'>beautifully formatted</span> document with CSS styling.</p>
<p>Complex layouts, fonts, colors, and images are fully supported.</p>
</body>
</html>";
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("formatted.pdf");
Console.WriteLine("Formatted PDF created successfully");
}
}
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class Program
{
static void Main()
{
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
var renderer = new ChromePdfRenderer();
string html = @"
<html>
<head>
<style>
body { font-family: Arial; margin: 40px; }
h1 { color: #2c3e50; font-size: 24px; }
p { line-height: 1.6; color: #34495e; }
.highlight { background-color: yellow; font-weight: bold; }
</style>
</head>
<body>
<h1>Formatted Document</h1>
<p>This is a <span class='highlight'>beautifully formatted</span> document with CSS styling.</p>
<p>Complex layouts, fonts, colors, and images are fully supported.</p>
</body>
</html>";
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("formatted.pdf");
Console.WriteLine("Formatted PDF created successfully");
}
}
Imports IronPdf
Imports System
Module Program
Sub Main()
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY"
Dim renderer As New ChromePdfRenderer()
Dim html As String = "
<html>
<head>
<style>
body { font-family: Arial; margin: 40px; }
h1 { color: #2c3e50; font-size: 24px; }
p { line-height: 1.6; color: #34495e; }
.highlight { background-color: yellow; font-weight: bold; }
</style>
</head>
<body>
<h1>Formatted Document</h1>
<p>This is a <span class='highlight'>beautifully formatted</span> document with CSS styling.</p>
<p>Complex layouts, fonts, colors, and images are fully supported.</p>
</body>
</html>"
Dim pdf = renderer.RenderHtmlAsPdf(html)
pdf.SaveAs("formatted.pdf")
Console.WriteLine("Formatted PDF created successfully")
End Sub
End Module
RawPrint를 사용할 경우, 일반 바이트 이상의 서식 지정은 "\x1B&l0O\x1B(s0p16.66h8.5v0s0b3T"와 같은 프린터 명령 시퀀스를 수동으로 작성하고 대상 프린터의 PCL 또는 PostScript 방언을 알아야 합니다. IronPDF는 표준 HTML 및 CSS를 사용합니다 — 복잡한 레이아웃, 글꼴, 색상 및 이미지는 프린터에 대한 특정 지식 없이 완벽하게 지원됩니다.
기능 비교 요약
| 기능 | RawPrint | IronPDF |
|---|---|---|
| PDF 생성 | ||
| HTML to PDF | 아니요 | 예 |
| URL을 PDF로 변환 | 아니요 | 예 |
| 처음부터 생성 | 아니요 | 예 |
| PDF 조작 | ||
| PDF 병합 | 아니요 | 예 |
| PDF 분할 | 아니요 | 예 |
| 워터마크 추가 | 아니요 | 예 |
| 기존 편집 | 아니요 | 예 |
| 인쇄 | ||
| 스푸로 RAW 바이트 전송 | 예 | 아니요 |
| ESC/POS, ZPL, raw PCL | 예 | 아니요 |
| OS 인쇄 시스템을 통한 인쇄 | 아니요 | 예 |
| 플랫폼 | ||
| Windows | 예 | 예 |
| Linux | 아니요 | 예 |
| macOS | 아니요 | 예 |
| Docker | 아니요 | 예 |
| 기타 | ||
| 암호화 / 보안 | 아니요 | 예 |
| 디지털 서명 | 아니요 | 예 |
| PDF/A | 아니요 | 예 |
이동 후 새로운 기능
IronPDF로 마이그레이션한 후에는 RawPrint가 제공할 수 없는 기능을 갖게 됩니다:
PDF 병합
var pdfs = pdfFiles.Select(f => PdfDocument.FromFile(f)).ToList();
var merged = PdfDocument.Merge(pdfs);
merged.SaveAs("complete.pdf");
var pdfs = pdfFiles.Select(f => PdfDocument.FromFile(f)).ToList();
var merged = PdfDocument.Merge(pdfs);
merged.SaveAs("complete.pdf");
Dim pdfs = pdfFiles.Select(Function(f) PdfDocument.FromFile(f)).ToList()
Dim merged = PdfDocument.Merge(pdfs)
merged.SaveAs("complete.pdf")
설정과 함께 인쇄하기
var pdf = PdfDocument.FromFile("report.pdf");
pdf.Print(new PrintOptions
{
PrinterName = "HP LaserJet",
NumberOfCopies = 2,
DPI = 300,
GrayScale = false
});
var pdf = PdfDocument.FromFile("report.pdf");
pdf.Print(new PrintOptions
{
PrinterName = "HP LaserJet",
NumberOfCopies = 2,
DPI = 300,
GrayScale = false
});
Dim pdf = PdfDocument.FromFile("report.pdf")
pdf.Print(New PrintOptions With {
.PrinterName = "HP LaserJet",
.NumberOfCopies = 2,
.DPI = 300,
.GrayScale = False
})
하나의 워크플로우에서 만들고 인쇄하기
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf(@"
<h1>Invoice #12345</h1>
<p>Customer: John Doe</p>
<p>Amount: $150.00</p>
");
// Print directly
pdf.Print("HP LaserJet");
// Or save first
pdf.SaveAs("invoice.pdf");
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf(@"
<h1>Invoice #12345</h1>
<p>Customer: John Doe</p>
<p>Amount: $150.00</p>
");
// Print directly
pdf.Print("HP LaserJet");
// Or save first
pdf.SaveAs("invoice.pdf");
Dim renderer = New ChromePdfRenderer()
Dim pdf = renderer.RenderHtmlAsPdf("
<h1>Invoice #12345</h1>
<p>Customer: John Doe</p>
<p>Amount: $150.00</p>
")
' Print directly
pdf.Print("HP LaserJet")
' Or save first
pdf.SaveAs("invoice.pdf")
마이그레이션 체크리스트
사전 마이그레이션
- 모든RawPrint사용식별 (
PrintRawFile,PrintRawStream) - 각 호출 사이트 분류: 사무실 프린터로 가는 PDF는 IronPDF의 후보 입니다; ESC/POS, ZPL, EPL 또는 수작업으로 작성된 PCL/PostScript 바이트는 RawPrint에 남겨두어야 합니다.
- 응용 프로그램에서 사용된 프린터 이름 기록 — IronPDF는 OS 인쇄 시스템을 통해 인쇄하므로 이름을 여전히 해결할 수 있어야 합니다.
- 통합할 수 있는 외부 PDF 생성 코드를 기록합니다.
- ironpdf.com에서IronPDF라이선스 키 획득
코드 업데이트
-IronPDF Install-Package: dotnet add package IronPdf
- 남은 원시 바이트 채널이 없는 경우에만 RawPrint를 제거:
dotnet remove package RawPrint - 생성 후RawPrint파이프라인을
ChromePdfRenderer및pdf.Print()로 대체 - PDF 생성 및 인쇄를 Windows에서 단일 워크플로로 통합
- 애플리케이션 시작 시 라이선스 초기화 추가
테스트
- 대상 프린터로 인쇄 테스트를 수행합니다.
- 인쇄 품질을 확인합니다.
- 여러 부본을 테스트합니다.
- 무음 인쇄를 테스트합니다.
- 필요 시 크로스 플랫폼 검증을 수행합니다.

