C#에서 PDFFilePrint에서 IronPDF로 마이그레이션하는 방법
PDFFilePrint에서 IronPDF로의 마이그레이션은 .NET PDF 워크플로우를 인쇄 전용 Pdfium 래퍼에서 생성, 조작 및 인쇄를 단일 통합 API로 처리하는 포괄적인 PDF 라이브러리로 옮깁니다. 이 안내서는 app.config 기반의 인쇄 설정을 강력한 타입의 PrinterSettings로 대체하면서 PDFFilePrint에서 제공하지 않는 PDF 생성 및 조작 기능을 추가하는 단계별 마이그레이션 경로를 제공합니다.
PDFFilePrint에서 IronPDF로 마이그레이션 하는 이유
PDFFilePrint이해하기
PDFFilePrint는 PdfiumViewer 및 Google의 Pdfium을 래핑하여 기존 PDF 또는 XPS 파일을 프린터 드라이버로 조용히 보내는 작은 오픈소스 NuGet 패키지(MIT, Christian Andersen에 의해)입니다. 가장 최근 릴리스는 1.0.3, 2020-02-10에 게시되며, .NET Framework 4.6.1+을 Windows에서 대상으로 합니다. 특정 인쇄 작업에 유용하지만, 문서 처리의 한 측면에만 제한되는 기능을 가지고 있습니다 — 공개 표면은 본질적으로 new FilePrint(path, null).Print()가 app.config / Properties.Settings.Default 키에 의해 구동됩니다.
중요한PDFFilePrint제한 사항
-
인쇄 전용: PDF를 생성하거나 편집, 병합 또는 수정할 수 없습니다 —
FilePrint클래스는 기존 PDF/XPS 파일을 소비하고 이를 스풀러에 전달합니다. -
설정 파일 기반 API: 프린터 이름, 용지 크기, 복사 횟수 및 '파일로 인쇄' 모드는
app.config(Properties.Settings.Default)에서 읽어오며, 강력한 타입의 옵션 객체로 전달되지 않습니다. -
Windows + .NET Framework 전용:
net461을 대상으로 하며 PdfiumViewer의 Win32 네이티브 바이너리를 가져옵니다. .NET Core / .NET 6+ TFM 및 Linux/macOS 지원 없음. -
제한된 인쇄 조정: 양면 인쇄, 페이지 범위, 방향 및 색상은 프린터 드라이버 기본값에 의존 — 이들에 대한 일급 API가 없습니다.
-
사실상 유지보수되지 않음: 1.0.3 (2020년 2월) 이후 릴리스 없으며, NuGet 목록에서 링크된 공개 소스 저장소도 없습니다.
-
단순 예외 표면: 실패는 PdfiumViewer / 인쇄 관리자에서 일반 예외로 버블업되며, 유형화된 오류 계층 구조가 제공되지 않습니다.
- PDF 생성 없음: PDF를 생성할 수 없습니다 — HTML, URL, 이미지에서 인쇄된 페이지로 가려면 PDFFilePrint와 별도의 렌더러를 짝지어 사용해야 합니다.
PDFFilePrintvsIronPDF비교
| 측면 | PDFFilePrint | IronPDF |
|---|---|---|
| 주요 초점 | PDF/XPS 인쇄 | 포괄적인 PDF API |
| 유형 | Pdfium 인쇄 래퍼 | 네이티브 .NET 라이브러리 + Chromium 렌더러 |
| 통합 | new FilePrint(...).Print() + app.config |
직항 PdfDocument API |
| PDF 인쇄 | 예 | 예 |
| PDF 생성 | 아니요 | 예 (HTML, URL, 이미지) |
| PDF 조작 | 아니요 | 예 (병합, 분할, 편집) |
| 크로스 플랫폼 | Windows 전용 (net461) | Windows, Linux, macOS, Docker |
| 오류 처리 | PdfiumViewer에서 오는 단순 예외 | 입력된 IronPdfException |
| IntelliSense | 최소 (작은 표면) | 전체 |
| NuGet 패키지 | PDFFilePrint 1.0.3 (MIT, 2020년 2월) |
IronPdf |
| 마지막 릴리스 | 1.0.3 (2020년 2월) | 활성 릴리스 |
현대 .NET (Framework 4.6.2+ 및 .NET 6/7/8/9/10)을 대상으로 하는 팀을 위해, IronPDF는 PDFFilePrint의 구조적 한계를 해결하며, 크로스 플랫폼 지원 및 활성 개발을 제공하는 포괄적인 기반을 제공합니다.
시작하기 전에
필수 조건
- .NET 환경: .NET Framework 4.6.2+ 또는 .NET 6/7/8/9/10
- NuGet 접근 권한: NuGet 패키지를 설치할 수 있는 능력
- IronPDF 라이선스: ironpdf.com에서 라이선스 키를 획득하세요
NuGet 패키지 변경 사항
# RemovePDFFilePrintpackage
dotnet remove package PDFFilePrint
# Install IronPDF
dotnet add package IronPdf
# RemovePDFFilePrintpackage
dotnet remove package PDFFilePrint
# Install IronPDF
dotnet add package IronPdf
라이선스 구성
// Add at application startup (Program.cs or Startup.cs)
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
// Add at application startup (Program.cs or Startup.cs)
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";
' Add at application startup (Program.vb or Startup.vb)
IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY"
PDFFilePrint사용 식별
# FindPDFFilePrintAPI usages
grep -r "using PDFFilePrint\|new FilePrint" --include="*.cs" .
# Find related app.config keys
grep -r "PrinterName\|PaperName\|PrintToFile\|DefaultPrintToDirectory" \
--include="*.config" --include="*.settings" .
# FindPDFFilePrintAPI usages
grep -r "using PDFFilePrint\|new FilePrint" --include="*.cs" .
# Find related app.config keys
grep -r "PrinterName\|PaperName\|PrintToFile\|DefaultPrintToDirectory" \
--include="*.config" --include="*.settings" .
완전한 API 참조
네임스페이스 변경
// PDFFilePrint
using PDFFilePrint;
//IronPDF— printing flows through System.Drawing.Printing
using IronPdf;
using System.Drawing.Printing;
// PDFFilePrint
using PDFFilePrint;
//IronPDF— printing flows through System.Drawing.Printing
using IronPdf;
using System.Drawing.Printing;
Imports PDFFilePrint
Imports IronPdf
Imports System.Drawing.Printing
핵심 클래스 매핑
| PDFFilePrint | IronPDF |
|---|---|
new FilePrint(path, null) (로드) |
PdfDocument.FromFile(path) |
new ChromePdfRenderer() (상응 없음 — PDFFilePrint는 PDF를 생성할 수 없음) |
new ChromePdfRenderer() |
FilePrint |
PdfDocument |
PDF 생성 메서드 매핑
| PDFFilePrint | IronPDF |
|---|---|
| (사용 불가) | renderer.RenderHtmlAsPdf(html) |
| (사용 불가) | renderer.RenderUrlAsPdf(url) |
| (사용할 수 없음 — 인쇄 전용) | pdf.SaveAs(path) |
PDF 로딩 및 인쇄 매핑
| PDFFilePrint | IronPDF |
|---|---|
new FilePrint(path, null) |
PdfDocument.FromFile(path) |
fileprint.Print() (조용히, 항상) |
pdf.Print() (조용히) / pdf.Print(true) (대화창) |
Properties.Settings.Default.PrinterName = "..." 그 후 Print() |
pdf.GetPrintDocument(new PrinterSettings { PrinterName = "..." }).Print() |
인쇄 설정 매핑 (app.config에서 PrinterSettings로)
PDFFilePrint설정(Settings.Default) |
IronPDF(System.Drawing.Printing.PrinterSettings) |
|---|---|
PrinterName |
PrinterName |
Copies |
Copies |
| (조용한 플래그 없음 — 항상 조용히) | pdf.Print() (조용히) / pdf.Print(true) (대화창 표시) |
| (드라이버 기본값) | FromPage, ToPage, PrintRange |
| (드라이버 기본값) | DefaultPageSettings.Landscape |
| (드라이버 기본값) | Duplex |
| (드라이버 기본값) | Collate |
PaperName |
DefaultPageSettings.PaperSize |
PrintToFile + DefaultPrintToDirectory |
PrintToFile + PrintFileName |
PDFFilePrint에 없는 새로운 기능
| IronPDF기능 | 설명 |
|---|---|
PdfDocument.Merge() |
여러 개의 PDF 결합 |
pdf.CopyPages() |
특정 페이지 추출 |
pdf.ApplyWatermark() |
워터마크 추가 |
pdf.SecuritySettings |
암호 보호 |
pdf.ExtractAllText() |
텍스트 내용 추출 |
pdf.RasterizeToImageFiles() |
이미지로 변환 |
pdf.SignWithDigitalSignature() |
디지털 서명 |
코드 마이그레이션 예제
예제 1: HTML에서 PDF로 변환
이전 (PDFFilePrint):
// NuGet: Install-Package PDFFilePrint
//PDFFilePrintis a print-only wrapper around PdfiumViewer / Pdfium.
// Its FilePrint class only consumes existing PDF/XPS files — there is
// no CreateFromHtml or document-creation method.
using System;
class Program
{
static void Main()
{
throw new NotSupportedException(
"PDFFilePrint cannot convert HTML to PDF. Render the HTML to a PDF " +
"with another library, then pass the path to new FilePrint(path, null).Print().");
}
}
// NuGet: Install-Package PDFFilePrint
//PDFFilePrintis a print-only wrapper around PdfiumViewer / Pdfium.
// Its FilePrint class only consumes existing PDF/XPS files — there is
// no CreateFromHtml or document-creation method.
using System;
class Program
{
static void Main()
{
throw new NotSupportedException(
"PDFFilePrint cannot convert HTML to PDF. Render the HTML to a PDF " +
"with another library, then pass the path to new FilePrint(path, null).Print().");
}
}
Imports System
Class Program
Shared Sub Main()
Throw New NotSupportedException("PDFFilePrint cannot convert HTML to PDF. Render the HTML to a PDF " & _
"with another library, then pass the path to new FilePrint(path, null).Print().")
End Sub
End Class
이후 (IronPDF):
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class Program
{
static void Main()
{
var renderer = new ChromePdfRenderer();
string htmlContent = "<html><body><h1>Hello World</h1></body></html>";
var pdf = renderer.RenderHtmlAsPdf(htmlContent);
pdf.SaveAs("output.pdf");
}
}
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class Program
{
static void Main()
{
var renderer = new ChromePdfRenderer();
string htmlContent = "<html><body><h1>Hello World</h1></body></html>";
var pdf = renderer.RenderHtmlAsPdf(htmlContent);
pdf.SaveAs("output.pdf");
}
}
Imports IronPdf
Imports System
Class Program
Shared Sub Main()
Dim renderer = New ChromePdfRenderer()
Dim htmlContent As String = "<html><body><h1>Hello World</h1></body></html>"
Dim pdf = renderer.RenderHtmlAsPdf(htmlContent)
pdf.SaveAs("output.pdf")
End Sub
End Class
여기서의 근본적인 차이는 범위입니다. PDFFilePrint는 HTML-to-PDF 경로가 없습니다 — 공개 표면은 기존 PDF를 프린터로 전달하는 FilePrint 클래스입니다. IronPDF는 렌더링을 문서 객체에서 분리합니다: ChromePdfRenderer이 HTML-to-PDF 변환을 처리하고, PdfDocument을 반환하여 SaveAs()으로 저장합니다.
이 분리는 또한 변환 이전에 렌더러에서 렌더링 옵션을 설정하고, 반환된 PdfDocument을 저장하기 전에 조작(워터마크 추가, 다른 PDF와 병합, 보안 추가)할 수 있게 합니다. HTML to PDF 문서에서 추가 렌더링 옵션을 참조하십시오.
예제 2: URL에서 PDF로 변환
이전 (PDFFilePrint):
// NuGet: Install-Package PDFFilePrint
//PDFFilePrintcannot fetch a URL or render HTML — it only sends existing
// PDF/XPS files to a printer. URL-to-PDF requires a separate renderer.
using System;
class Program
{
static void Main()
{
throw new NotSupportedException(
"PDFFilePrint cannot convert URLs to PDF. Render the URL to a PDF with " +
"another library first, then call new FilePrint(pdfPath, null).Print().");
}
}
// NuGet: Install-Package PDFFilePrint
//PDFFilePrintcannot fetch a URL or render HTML — it only sends existing
// PDF/XPS files to a printer. URL-to-PDF requires a separate renderer.
using System;
class Program
{
static void Main()
{
throw new NotSupportedException(
"PDFFilePrint cannot convert URLs to PDF. Render the URL to a PDF with " +
"another library first, then call new FilePrint(pdfPath, null).Print().");
}
}
Imports System
Class Program
Shared Sub Main()
Throw New NotSupportedException("PDFFilePrint cannot convert URLs to PDF. Render the URL to a PDF with " & _
"another library first, then call new FilePrint(pdfPath, null).Print().")
End Sub
End Class
이후 (IronPDF):
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class Program
{
static void Main()
{
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderUrlAsPdf("https://www.example.com");
pdf.SaveAs("webpage.pdf");
}
}
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class Program
{
static void Main()
{
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderUrlAsPdf("https://www.example.com");
pdf.SaveAs("webpage.pdf");
}
}
Imports IronPdf
Imports System
Class Program
Shared Sub Main()
Dim renderer = New ChromePdfRenderer()
Dim pdf = renderer.RenderUrlAsPdf("https://www.example.com")
pdf.SaveAs("webpage.pdf")
End Sub
End Class
PDFFilePrint에는 URL 가져오기 기능이 없습니다. IronPDF는 현대 CSS, JavaScript 및 웹 기능을 렌더링하기 위해 크로뮴 엔진을 활용하는 ChromePdfRenderer의 전용 RenderUrlAsPdf() 메서드를 사용합니다. URL에서 PDF로 변환에 대해 더 알아보세요.
예제 3: PDF 인쇄
이전 (PDFFilePrint):
// NuGet: Install-Package PDFFilePrint
using System;
using PDFFilePrint;
class Program
{
static void Main()
{
// Optional: override the configured printer / copy count at runtime.
Properties.Settings.Default.PrinterName = "Default Printer";
var fileprint = new FilePrint("document.pdf", null);
fileprint.Print();
Console.WriteLine("PDF sent to printer");
}
}
// NuGet: Install-Package PDFFilePrint
using System;
using PDFFilePrint;
class Program
{
static void Main()
{
// Optional: override the configured printer / copy count at runtime.
Properties.Settings.Default.PrinterName = "Default Printer";
var fileprint = new FilePrint("document.pdf", null);
fileprint.Print();
Console.WriteLine("PDF sent to printer");
}
}
Imports System
Imports PDFFilePrint
Module Program
Sub Main()
' Optional: override the configured printer / copy count at runtime.
Properties.Settings.[Default].PrinterName = "Default Printer"
Dim fileprint = New FilePrint("document.pdf", Nothing)
fileprint.Print()
Console.WriteLine("PDF sent to printer")
End Sub
End Module
이후 (IronPDF):
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
using System.Drawing.Printing;
class Program
{
static void Main()
{
var pdf = PdfDocument.FromFile("document.pdf");
// Silent print to the default printer
pdf.Print();
// Or print to a named printer with explicit PrinterSettings:
// var settings = new PrinterSettings { PrinterName = "HP LaserJet Pro" };
// pdf.GetPrintDocument(settings).Print();
Console.WriteLine("PDF sent to printer");
}
}
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
using System.Drawing.Printing;
class Program
{
static void Main()
{
var pdf = PdfDocument.FromFile("document.pdf");
// Silent print to the default printer
pdf.Print();
// Or print to a named printer with explicit PrinterSettings:
// var settings = new PrinterSettings { PrinterName = "HP LaserJet Pro" };
// pdf.GetPrintDocument(settings).Print();
Console.WriteLine("PDF sent to printer");
}
}
Imports IronPdf
Imports System
Imports System.Drawing.Printing
Module Program
Sub Main()
Dim pdf = PdfDocument.FromFile("document.pdf")
' Silent print to the default printer
pdf.Print()
' Or print to a named printer with explicit PrinterSettings:
' Dim settings As New PrinterSettings With {.PrinterName = "HP LaserJet Pro"}
' pdf.GetPrintDocument(settings).Print()
Console.WriteLine("PDF sent to printer")
End Sub
End Module
이 예시는 두 라이브러리 간의 구조적 차이를 보여줍니다. PDFFilePrint는 new FilePrint(path, null)을 인스턴스화하고 Print()을 호출하며, 프린터 이름과 복사 횟수는 app.config (Properties.Settings.Default)에서 읽어옵니다. IronPDF는 기본 프린터를 사용하는 Print() 후 PdfDocument.FromFile()를 로드하고, 명시적 제어를 위해 GetPrintDocument(settings).Print()를 통해 System.Drawing.Printing.PrinterSettings를 전달합니다.
주요 마이그레이션 변경 사항:
new FilePrint(path, null)→PdfDocument.FromFile(path)Properties.Settings.Default.PrinterName = "..."+Print()→pdf.GetPrintDocument(new PrinterSettings { PrinterName = "..." }).Print()- 기본 프린터:
PrinterName를Settings.Default에서 빈 상태로 두기 →pdf.Print()호출
고급 인쇄 설정의 경우 IronPDF는 System.Drawing.Printing.PrinterSettings을 사용합니다. 인쇄 문서에서 추가 옵션을 참조하십시오.
고급 인쇄 설정 마이그레이션
PDFFilePrint의 app.config 키를 사용하는 애플리케이션의 경우 IronPDF의 강력한 타입 PrinterSettings로 마이그레이션하는 방법은 다음과 같습니다:
//PDFFilePrintapproach — settings live in app.config and are read via
// Properties.Settings.Default. To override at runtime you mutate Settings.Default
// before instantiating FilePrint:
// Properties.Settings.Default.PrinterName = "HP LaserJet";
// Properties.Settings.Default.Copies = 3;
// new FilePrint("document.pdf", null).Print();
//
//IronPDF equivalent — pass a System.Drawing.Printing.PrinterSettings per call:
using IronPdf;
using System.Drawing.Printing;
var pdf = PdfDocument.FromFile("document.pdf");
var settings = new PrinterSettings
{
PrinterName = "HP LaserJet",
Copies = 3,
FromPage = 1,
ToPage = 5,
PrintRange = PrintRange.SomePages
};
pdf.GetPrintDocument(settings).Print();
//PDFFilePrintapproach — settings live in app.config and are read via
// Properties.Settings.Default. To override at runtime you mutate Settings.Default
// before instantiating FilePrint:
// Properties.Settings.Default.PrinterName = "HP LaserJet";
// Properties.Settings.Default.Copies = 3;
// new FilePrint("document.pdf", null).Print();
//
//IronPDF equivalent — pass a System.Drawing.Printing.PrinterSettings per call:
using IronPdf;
using System.Drawing.Printing;
var pdf = PdfDocument.FromFile("document.pdf");
var settings = new PrinterSettings
{
PrinterName = "HP LaserJet",
Copies = 3,
FromPage = 1,
ToPage = 5,
PrintRange = PrintRange.SomePages
};
pdf.GetPrintDocument(settings).Print();
Imports IronPdf
Imports System.Drawing.Printing
'PDFFilePrintapproach — settings live in app.config and are read via
' Properties.Settings.Default. To override at runtime you mutate Settings.Default
' before instantiating FilePrint:
' Properties.Settings.Default.PrinterName = "HP LaserJet"
' Properties.Settings.Default.Copies = 3
' new FilePrint("document.pdf", null).Print()
'
'IronPDF equivalent — pass a System.Drawing.Printing.PrinterSettings per call:
Dim pdf = PdfDocument.FromFile("document.pdf")
Dim settings As New PrinterSettings With {
.PrinterName = "HP LaserJet",
.Copies = 3,
.FromPage = 1,
.ToPage = 5,
.PrintRange = PrintRange.SomePages
}
pdf.GetPrintDocument(settings).Print()
조용한 모드
//PDFFilePrintis always silent — there is no print-dialog code path.
//IronPDF is silent by default. Pass true explicitly to show the print dialog:
pdf.Print(); // silent
pdf.Print(true); // shows print dialog
//PDFFilePrintis always silent — there is no print-dialog code path.
//IronPDF is silent by default. Pass true explicitly to show the print dialog:
pdf.Print(); // silent
pdf.Print(true); // shows print dialog
' PDFFilePrintis always silent — there is no print-dialog code path.
' IronPDF is silent by default. Pass true explicitly to show the print dialog:
pdf.Print() ' silent
pdf.Print(True) ' shows print dialog
이동 후 새로운 기능
IronPDF로 마이그레이션한 후, PDFFilePrint가 제공할 수 없는 기능을 획득합니다:
한 단계로 생성 및 인쇄
using IronPdf;
using System.Drawing.Printing;
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf("<h1>Invoice #12345</h1><p>Thank you for your order.</p>");
var settings = new PrinterSettings { PrinterName = "Office Printer" };
pdf.GetPrintDocument(settings).Print();
using IronPdf;
using System.Drawing.Printing;
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf("<h1>Invoice #12345</h1><p>Thank you for your order.</p>");
var settings = new PrinterSettings { PrinterName = "Office Printer" };
pdf.GetPrintDocument(settings).Print();
Imports IronPdf
Imports System.Drawing.Printing
Dim renderer As New ChromePdfRenderer()
Dim pdf = renderer.RenderHtmlAsPdf("<h1>Invoice #12345</h1><p>Thank you for your order.</p>")
Dim settings As New PrinterSettings With {.PrinterName = "Office Printer"}
pdf.GetPrintDocument(settings).Print()
PDF 병합
var pdf1 = PdfDocument.FromFile("document1.pdf");
var pdf2 = PdfDocument.FromFile("document2.pdf");
var merged = PdfDocument.Merge(pdf1, pdf2);
merged.SaveAs("merged.pdf");
var pdf1 = PdfDocument.FromFile("document1.pdf");
var pdf2 = PdfDocument.FromFile("document2.pdf");
var merged = PdfDocument.Merge(pdf1, pdf2);
merged.SaveAs("merged.pdf");
Dim pdf1 = PdfDocument.FromFile("document1.pdf")
Dim pdf2 = PdfDocument.FromFile("document2.pdf")
Dim merged = PdfDocument.Merge(pdf1, pdf2)
merged.SaveAs("merged.pdf")
워터마크
var pdf = PdfDocument.FromFile("document.pdf");
pdf.ApplyWatermark("<h1 style='color:red; opacity:0.3;'>CONFIDENTIAL</h1>");
pdf.SaveAs("watermarked.pdf");
var pdf = PdfDocument.FromFile("document.pdf");
pdf.ApplyWatermark("<h1 style='color:red; opacity:0.3;'>CONFIDENTIAL</h1>");
pdf.SaveAs("watermarked.pdf");
Dim pdf = PdfDocument.FromFile("document.pdf")
pdf.ApplyWatermark("<h1 style='color:red; opacity:0.3;'>CONFIDENTIAL</h1>")
pdf.SaveAs("watermarked.pdf")
비밀번호 보호
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SecuritySettings.UserPassword = "userpassword";
pdf.SecuritySettings.OwnerPassword = "ownerpassword";
pdf.SaveAs("secured.pdf");
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SecuritySettings.UserPassword = "userpassword";
pdf.SecuritySettings.OwnerPassword = "ownerpassword";
pdf.SaveAs("secured.pdf");
Dim pdf = renderer.RenderHtmlAsPdf(html)
pdf.SecuritySettings.UserPassword = "userpassword"
pdf.SecuritySettings.OwnerPassword = "ownerpassword"
pdf.SaveAs("secured.pdf")
텍스트 추출
var pdf = PdfDocument.FromFile("document.pdf");
string text = pdf.ExtractAllText();
var pdf = PdfDocument.FromFile("document.pdf");
string text = pdf.ExtractAllText();
Dim pdf = PdfDocument.FromFile("document.pdf")
Dim text As String = pdf.ExtractAllText()
중요한 마이그레이션 노트
클래스 패턴 변경
PDFFilePrint는 단일 Print() 메서드가 있는 작은 FilePrint 클래스를 사용하며, app.config에 의해 구동됩니다. IronPDF는 렌더링, 문서 조작 및 인쇄를 별개의 유형으로 분리합니다:
// PDFFilePrint: load + silent print (settings come from app.config)
Properties.Settings.Default.PrinterName = "HP LaserJet";
var fileprint = new FilePrint(path, null);
fileprint.Print();
// IronPDF: PdfDocument for load/manipulate, PrinterSettings for print options
var pdf = PdfDocument.FromFile(path);
var settings = new PrinterSettings { PrinterName = "HP LaserJet" };
pdf.GetPrintDocument(settings).Print();
//IronPDF can also create PDFs from HTML —PDFFilePrintcannot
var renderer = new ChromePdfRenderer();
var newPdf = renderer.RenderHtmlAsPdf(html);
newPdf.SaveAs(path);
// PDFFilePrint: load + silent print (settings come from app.config)
Properties.Settings.Default.PrinterName = "HP LaserJet";
var fileprint = new FilePrint(path, null);
fileprint.Print();
// IronPDF: PdfDocument for load/manipulate, PrinterSettings for print options
var pdf = PdfDocument.FromFile(path);
var settings = new PrinterSettings { PrinterName = "HP LaserJet" };
pdf.GetPrintDocument(settings).Print();
//IronPDF can also create PDFs from HTML —PDFFilePrintcannot
var renderer = new ChromePdfRenderer();
var newPdf = renderer.RenderHtmlAsPdf(html);
newPdf.SaveAs(path);
' PDFFilePrint: load + silent print (settings come from app.config)
Properties.Settings.Default.PrinterName = "HP LaserJet"
Dim fileprint = New FilePrint(path, Nothing)
fileprint.Print()
' IronPDF: PdfDocument for load/manipulate, PrinterSettings for print options
Dim pdf = PdfDocument.FromFile(path)
Dim settings = New PrinterSettings With {.PrinterName = "HP LaserJet"}
pdf.GetPrintDocument(settings).Print()
' IronPDF can also create PDFs from HTML — PDFFilePrint cannot
Dim renderer = New ChromePdfRenderer()
Dim newPdf = renderer.RenderHtmlAsPdf(html)
newPdf.SaveAs(path)
메소드 / 설정 이름 변경
//PDFFilePrint→ IronPDF
new FilePrint(path, null) → PdfDocument.FromFile(path)
fileprint.Print() → pdf.Print() // silent default
Properties.Settings.Default.PrinterName = "X" → new PrinterSettings { PrinterName = "X" }
Properties.Settings.Default.Copies = 3 → new PrinterSettings { Copies = 3 }
Properties.Settings.Default.PaperName = "A4" → settings.DefaultPageSettings.PaperSize = ...
//PDFFilePrinthas no native HTML/URL/merge/watermark methods — these are IronPDF-only.
//PDFFilePrint→ IronPDF
new FilePrint(path, null) → PdfDocument.FromFile(path)
fileprint.Print() → pdf.Print() // silent default
Properties.Settings.Default.PrinterName = "X" → new PrinterSettings { PrinterName = "X" }
Properties.Settings.Default.Copies = 3 → new PrinterSettings { Copies = 3 }
Properties.Settings.Default.PaperName = "A4" → settings.DefaultPageSettings.PaperSize = ...
//PDFFilePrinthas no native HTML/URL/merge/watermark methods — these are IronPDF-only.
' PDFFilePrint→ IronPDF
PdfDocument.FromFile(path)
' pdf.Print() // silent default
pdf.Print()
' new PrinterSettings { PrinterName = "X" }
Dim printerSettings As New PrinterSettings With {
.PrinterName = "X"
}
' new PrinterSettings { Copies = 3 }
printerSettings.Copies = 3
' settings.DefaultPageSettings.PaperSize = ...
settings.DefaultPageSettings.PaperSize = New PaperSize("A4", 827, 1169)
' PDFFilePrinthas no native HTML/URL/merge/watermark methods — these are IronPDF-only.
예외 처리
// PDFFilePrint: failures bubble up from PdfiumViewer as plain exceptions
try {
new FilePrint(path, null).Print();
}
catch (Exception ex) {
// 아니요 granular error type — log the message and inner exception.
}
// IronPDF: typed exception hierarchy
try {
pdf.Print();
}
catch (IronPdf.Exceptions.IronPdfException ex) {
// Granular error details
}
// PDFFilePrint: failures bubble up from PdfiumViewer as plain exceptions
try {
new FilePrint(path, null).Print();
}
catch (Exception ex) {
// 아니요 granular error type — log the message and inner exception.
}
// IronPDF: typed exception hierarchy
try {
pdf.Print();
}
catch (IronPdf.Exceptions.IronPdfException ex) {
// Granular error details
}
Imports IronPdf.Exceptions
' PDFFilePrint: failures bubble up from PdfiumViewer as plain exceptions
Try
Dim filePrint As New FilePrint(path, Nothing)
filePrint.Print()
Catch ex As Exception
' 아니요 granular error type — log the message and inner exception.
End Try
' IronPDF: typed exception hierarchy
Try
pdf.Print()
Catch ex As IronPdfException
' Granular error details
End Try
외부 실행 파일 없음
두 라이브러리는 NuGet 패키지로 제공됩니다. 번들링하거나 제거할 PDFFilePrint.exe은 없습니다 —PDFFilePrint쪽에서는 dotnet remove package PDFFilePrint이면 충분합니다. IronPDF도 마찬가지로 restore 시 네이티브 종속성을 해결하는 IronPdf 패키지를 통해 자체 포함되어 있습니다.
기능 비교 요약
| 기능 | PDFFilePrint | IronPDF |
|---|---|---|
| 기본 인쇄 | ✓ | ✓ |
| 무음 인쇄 | ✓ (항상 조용함) | ✓ |
| 여러 복사본 | ✓ (app.config을 통해) | ✓ |
| 페이지 범위 | 드라이버 디폴트만 | ✓ |
| 양면 | 드라이버 디폴트만 | ✓ |
| HTML에서 생성 | ✗ | ✓ |
| URL에서 생성 | ✗ | ✓ |
| PDF 병합 | ✗ | ✓ |
| PDF 분할 | ✗ | ✓ |
| 워터마크 추가 | ✗ | ✓ |
| 텍스트 추출 | ✗ | ✓ |
| 암호 보호 | ✗ | ✓ |
| 디지털 서명 | ✗ | ✓ |
| 크로스 플랫폼 | ✗ (윈도우즈 / net461) | ✓ |
| 네이티브 .NET API | ✓ (작은 표면적) | ✓ |
마이그레이션 체크리스트
사전 마이그레이션
- 모든
using PDFFilePrint;및new FilePrint(...)호출 위치 찾기 - 현재의
app.config설정 문서화 (PrinterName,PaperName,Copies,PrintToFile,DefaultPrintToDirectory) - 환경 간에 사용되는 프린터 이름 식별
- 런타임에
Properties.Settings.Default를 변형시키는 코드를 주의하여 기록하기 - (HTML/URL 렌더링, 병합, 워터마크, 보안 등의 새로운 기능에 대한) 기회를 식별합니다 -IronPDF라이센스 키를 받으세요
패키지 변경 사항
PDFFilePrintNuGet 패키지 제거:dotnet remove package PDFFilePrintIronPdfNuGet Install-Package:dotnet add package IronPdfusing PDFFilePrint;을using IronPdf;로 교체 (필요한 곳에using System.Drawing.Printing;추가)
코드 변경 사항
- 시작 시 라이선스 키 구성 추가
new FilePrint(path, null)을PdfDocument.FromFile(path)로 교체- 프린터/복사/용지 설정을
app.config에서System.Drawing.Printing.PrinterSettings로 이관 - 조용한 기본 프린터 출력을 위해
pdf.Print()을 사용하거나, 명시적 옵션을 위해pdf.GetPrintDocument(settings).Print()을 사용 Print()호출을 이전에 일반적인 예외를 잡았던 위치에try/catch IronPdfException로 감싸기- HTML/URL/병합/워터마크 기능(이전 PDFFilePrint에서 제공하지 않았던 것)은
ChromePdfRenderer와PdfDocument조작 API를 사용
마이그레이션 이후
-PDFFilePrint전용 키를 app.config에서 제거
- 모든 대상 프린터에서 인쇄 테스트
- 적용 가능한 경우 크로스 플랫폼 테스트를 수행합니다 (리눅스 인쇄는 CUPS가 필요함)
- 필요한 경우 새로운 기능(워터마크, 보안, 병합)을 추가합니다
- 문서 업데이트

