PDFFilePrint'ten IronPDF'e C# ile Nasıl Geçilir
PDFFilePrint'den IronPDF'e geçmek, sınırlı yetenekleri olan yazdırma odaklı bir yardımcı programdan, tek bir birleşik API'de oluşturma, manipülasyon ve yazdırmayı yöneten kapsamlı bir PDF kütüphanesine geçerek, .NET PDF iş akışınızı dönüştürür. Bu kılavuz, komut satırı bağımlılıklarını ortadan kaldırırken PDF oluşturma ve manipülasyon yeteneklerini ekleyen, PDFFilePrint'in sağlayamayacağı eksiksiz, adım adım bir geçiş yolu sağlar.
Neden PDFFilePrint'ten IronPDF'e Geçmeli
PDFFilePrint'i Anlamak
PDFFilePrint, C# uygulamalarından PDF belgeleri yazdırmak için özel olarak tasarlanmış pratik bir araçtır. Hedefli PDF yazdırma görevleri için iyi hizmet etse de, işlevselliği belge işlemenin sadece bir yönüyle sınırlıdır. PDFFilePrint'in başlıca cazibesi, PDF belgelerini yazdırma deneyimi sağlama konusundaki basitliği – tek bir odak noktasına sahiptir. Ancak, bu dar firma, kapsamlı belge yönetim sistemleri için önemli sınırlamalar yaratır.
KritikPDFFilePrintSınırlamaları
-
Sadece Yazdırma Odaklı: PDFFilePrint'in işlevselliği yazdırma ile sınırlıdır. PDF belgelerini oluşturma veya değiştirme yetenekleri yoktur, daha kapsamlı belge yönetim sistemleri için sınırlayıcı olabilir.
-
Komut Satırı Bağlantısı: Genellikle
Process.Start()çağrıları ile komut satırı işlemlerine dayanarak, PDFFilePrint, daha sağlam API'ler gerektiren uygulamalara sorunsuz entegrasyon için ihtiyaçları karşılamayabilir. -
Sadece Windows: Windows yazdırma sistemlerine yoğun bir şekilde dayandığı için, diğer işletim sistemlerini kullanan ortamlar için en iyi seçim olmayabilir.
-
.NET Entegrasyonu Yok: Yerel API yok, NuGet paketi yok ve bazı kullanım desenlerinde IntelliSense desteği yok.
-
Harici Süreç Yönetimi: Süreç yaşam döngüsü, çıkış kodları ve stdout/stderr'dan hata ayıklama işlemlerini yönetmelisiniz.
-
Sınırlı Hata İşleme: Hataları tespit etmek, yerel istisnalar yerine standart çıktı ve hata akışlarını ayrıştırarak yapılır.
-
Dağıtım Karmaşıklığı: Komut satırı kullanım senaryolarında PDFFilePrint.exe'yi uygulama ile birlikte dağıtmanız gerekir.
- PDF Oluşturma Yok: Komut satırı modunda yalnızca mevcut belgeleri yazdırabilir, PDF oluşturamaz.
PDFFilePrint veIronPDFKarşılaştırması
| Bağlam | PDFFilePrint | IronPDF |
|---|---|---|
| Birincil Odak | PDF Yazdırma | Kapsamlı PDF API'si |
| Türü | Komut satırı yardımcı programı / Temel kütüphane | Yerel .NET kütüphanesi |
| Entegrasyon | Process.Start() / Temel API | Doğrudan API çağrıları |
| PDF Yazdırma | ✓ | ✓ |
| PDF Oluşturma | Sınırlı | ✓(HTML, URL, görüntüler) |
| PDF Manipulasyonu | ✗ | ✓(birleştirme, bölme, düzenleme) |
| Çapraz Platform | Yalnızca Windows | Windows, Linux, macOS |
| Hata İşleme | stdio/stderr ayrıştırma | Yerel istisnalar |
| IntelliSense | Sınırlı | Desteklenir |
| NuGet Paketi | Sınırlı | ✓ |
| Dokümantasyon | Temel | Geniş kapsamlı |
.NET 10 ve C# 14'ün 2025 ve 2026'ya kadar benimsenmesini planlayan takımlar için,IronPDFplatformlar arası destek ve aktif geliştirme ile PDFFilePrint'in mimari sınırlamalarını ele alarak kapsamlı bir temel sağlar.
Başlamadan Önce
Önkoşullar
- .NET Ortamı: .NET Framework 4.6.2+ veya .NET Core 3.1+ / .NET 5/6/7/8/9+
- NuGet Erişimi: NuGet paketlerini yükleme yeteneği
- IronPDF Lisansı: Lisans anahtarınızı ironpdf.com adresinden edinin
NuGet Paket Değişiklikleri
# RemovePDFFilePrintpackage (if installed via NuGet)
dotnet remove package PDFFilePrint
# If using command-line PDFFilePrint.exe, remove from deployment
# Delete bundled PDFFilePrint.exe from your project
# Install IronPDF
dotnet add package IronPdf
# RemovePDFFilePrintpackage (if installed via NuGet)
dotnet remove package PDFFilePrint
# If using command-line PDFFilePrint.exe, remove from deployment
# Delete bundled PDFFilePrint.exe from your project
# Install IronPDF
dotnet add package IronPdf
Lisans Yapılandırması
// 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"
PDFFilePrintKullanımını Belirleme
# FindPDFFilePrintreferences
grep -r "PDFFilePrint\|PDFFile\|CreateFromHtml\|CreateFromUrl" --include="*.cs" .
# Find command-line execution patterns
grep -r "ProcessStartInfo.*pdf\|Process.Start.*print" --include="*.cs" .
# Find batch scripts
find . -name "*.bat" -o -name "*.cmd" | xargs grep -l "PDFFilePrint"
# FindPDFFilePrintreferences
grep -r "PDFFilePrint\|PDFFile\|CreateFromHtml\|CreateFromUrl" --include="*.cs" .
# Find command-line execution patterns
grep -r "ProcessStartInfo.*pdf\|Process.Start.*print" --include="*.cs" .
# Find batch scripts
find . -name "*.bat" -o -name "*.cmd" | xargs grep -l "PDFFilePrint"
API Referansının Tamamı
Namespace Değişiklikleri
// PDFFilePrint
using PDFFilePrint;
using System.Diagnostics; // For command-line usage
// IronPDF
using IronPdf;
using IronPdf.Printing;
// PDFFilePrint
using PDFFilePrint;
using System.Diagnostics; // For command-line usage
// IronPDF
using IronPdf;
using IronPdf.Printing;
Imports PDFFilePrint
Imports System.Diagnostics ' For command-line usage
' IronPDF
Imports IronPdf
Imports IronPdf.Printing
Temel Sınıf Eşlemeleri
| PDFFilePrint | IronPDF |
|---|---|
new PDFFile() |
new ChromePdfRenderer() |
new PDFFile() |
PdfDocument.FromFile() |
PDFFile |
PdfDocument |
PDF Oluşturma Yöntemi Haritaları
| PDFFilePrint | IronPDF |
|---|---|
pdf.CreateFromHtml(html) |
renderer.RenderHtmlAsPdf(html) |
pdf.CreateFromUrl(url) |
renderer.RenderUrlAsPdf(url) |
pdf.SaveToFile(path) |
pdf.SaveAs(path) |
PDF Yükleme ve Yazdırma Haritaları
| PDFFilePrint | IronPDF |
|---|---|
pdf.LoadFromFile(path) |
PdfDocument.FromFile(path) |
pdf.Print(printerName) |
pdf.Print(printerName) |
pdf.Print("Default Printer") |
pdf.Print() |
Yazdırma Ayarları Haritaları (Komut Satırından API'ye)
| PDFFilePrintBayrağı | IronPDFPrintSettings Özelliği |
|---|---|
-printer "Name" |
PrinterName |
-copies N |
NumberOfCopies |
-silent |
ShowPrintDialog = false |
-pages "1-5" |
FromPage, ToPage |
-orientation landscape |
PaperOrientation |
-duplex |
Duplex |
-collate |
Collate |
PDFFilePrint'te Olmayan Yeni Yetkinlikler
| IronPDFÖzelliği | Tanım |
|---|---|
PdfDocument.Merge() |
Birden çok PDF birleştirme |
pdf.CopyPages() |
Belirli sayfaları çıkarma |
pdf.ApplyWatermark() |
Filigran ekleme |
pdf.SecuritySettings |
Parola koruması |
pdf.ExtractAllText() |
Metin içeriğini çıkar |
pdf.RasterizeToImageFiles() |
Görüntülere dönüştürme |
pdf.SignWithDigitalSignature() |
Dijital imzalar |
Kod Geçiş Örnekleri
Örnek 1: HTML'den PDF'e Dönüştürme
Önce (PDFFilePrint):
// NuGet: Install-Package PDFFilePrint
using System;
using PDFFilePrint;
class Program
{
static void Main()
{
var pdf = new PDFFile();
string htmlContent = "<html><body><h1>Hello World</h1></body></html>";
pdf.CreateFromHtml(htmlContent);
pdf.SaveToFile("output.pdf");
}
}
// NuGet: Install-Package PDFFilePrint
using System;
using PDFFilePrint;
class Program
{
static void Main()
{
var pdf = new PDFFile();
string htmlContent = "<html><body><h1>Hello World</h1></body></html>";
pdf.CreateFromHtml(htmlContent);
pdf.SaveToFile("output.pdf");
}
}
Imports System
Imports PDFFilePrint
Module Program
Sub Main()
Dim pdf As New PDFFile()
Dim htmlContent As String = "<html><body><h1>Hello World</h1></body></html>"
pdf.CreateFromHtml(htmlContent)
pdf.SaveToFile("output.pdf")
End Sub
End Module
Sonra (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
Buradaki temel fark API desenidir. PDFFilePrint, CreateFromHtml() ve SaveToFile() yöntemleri ile tek bir PDFFile sınıfını kullanır. IronPDF, belge nesnesinden işleme sürecini ayırır—ChromePdfRenderer, HTML'den PDF'ye dönüşümü gerçekleştirir ve ardından PdfDocument nesnesi döndürülür, ki daha sonra SaveAs() ile kaydedersiniz.
Bu ayrım önemli avantajlar sağlar: Dönüşüm öncesinde işleyici üzerinde işleme seçeneklerini yapılandırabilirsiniz ve döndürülen PdfDocument, kaydetmeden önce manipüle edilebilir (filigran eklenebilir, diğer PDF'lerle birleştirilebilir, güvenlik eklenebilir). Daha fazla işleme seçeneği için HTML'den PDF'ye dokümantasyonuna bakın.
Örnek 2: URL'den PDF'e Dönüştürme
Önce (PDFFilePrint):
// NuGet: Install-Package PDFFilePrint
using System;
using PDFFilePrint;
class Program
{
static void Main()
{
var pdf = new PDFFile();
pdf.CreateFromUrl("https://www.example.com");
pdf.SaveToFile("webpage.pdf");
}
}
// NuGet: Install-Package PDFFilePrint
using System;
using PDFFilePrint;
class Program
{
static void Main()
{
var pdf = new PDFFile();
pdf.CreateFromUrl("https://www.example.com");
pdf.SaveToFile("webpage.pdf");
}
}
Imports System
Imports PDFFilePrint
Class Program
Shared Sub Main()
Dim pdf As New PDFFile()
pdf.CreateFromUrl("https://www.example.com")
pdf.SaveToFile("webpage.pdf")
End Sub
End Class
Sonra (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, aynı PDFFile sınıfı üzerinde CreateFromUrl() kullanır. IronPDF, karmaşık CSS3, JavaScript ve modern web özelliklerinin doğru bir şekilde işlenmesi için modern bir Chromium motorunu kullanan, özel bir RenderUrlAsPdf() yöntemini ChromePdfRenderer üzerinde kullanır. Çizim kalitesi öngörülebilirdir ve Chrome tarayıcısında gördüğünüzle eşleşir. Daha fazla bilgi için URL'den PDF'ye dönüştürme hakkında bilgi edinin.
Örnek 3: PDF Yazdırma
Önce (PDFFilePrint):
// NuGet: Install-Package PDFFilePrint
using System;
using PDFFilePrint;
class Program
{
static void Main()
{
var pdf = new PDFFile();
pdf.LoadFromFile("document.pdf");
pdf.Print("Default Printer");
Console.WriteLine("PDF sent to printer");
}
}
// NuGet: Install-Package PDFFilePrint
using System;
using PDFFilePrint;
class Program
{
static void Main()
{
var pdf = new PDFFile();
pdf.LoadFromFile("document.pdf");
pdf.Print("Default Printer");
Console.WriteLine("PDF sent to printer");
}
}
Imports System
Imports PDFFilePrint
Module Program
Sub Main()
Dim pdf As New PDFFile()
pdf.LoadFromFile("document.pdf")
pdf.Print("Default Printer")
Console.WriteLine("PDF sent to printer")
End Sub
End Module
Sonra (IronPDF):
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class Program
{
static void Main()
{
var pdf = PdfDocument.FromFile("document.pdf");
pdf.Print();
Console.WriteLine("PDF sent to printer");
}
}
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class Program
{
static void Main()
{
var pdf = PdfDocument.FromFile("document.pdf");
pdf.Print();
Console.WriteLine("PDF sent to printer");
}
}
Imports IronPdf
Imports System
Class Program
Shared Sub Main()
Dim pdf = PdfDocument.FromFile("document.pdf")
pdf.Print()
Console.WriteLine("PDF sent to printer")
End Sub
End Class
Bu örnek, PDF yükleme ve yazdırmada temel bir mimari farkı göstermektedir. PDFFilePrint, ardından LoadFromFile() ve sonra Print(printerName) gelen new PDFFile() kullanır. IronPDF, doğrudan yüklemek için statik fabrika metodu PdfDocument.FromFile() kullanır, ardından varsayılan yazıcıyı (veya bir yazıcı adı geçirebilirsiniz) kullanan Print() gelir.
Temel gecis değişiklikleri:
new PDFFile()+LoadFromFile(path)→PdfDocument.FromFile(path)Print("Default Printer")→Print()(varsayılan yazıcı otomatiktir)
Gelişmiş yazdırma ayarları için IronPDF, bir PrintSettings sınıfı sağlar. yazdırma belgelerine bakın, gelişmiş seçenekler için.
Gelişmiş Baskı Ayarları Geçişi
PDFFilePrint'in komut satırı bayraklarını kullanan uygulamalar için, IronPDF'in PrintSettings'ne geçiş yapmanız şöyle olur:
//PDFFilePrintcommand-line approach:
// PDFFilePrint.exe -silent -copies 3 -printer "HP LaserJet" -pages "1-5" "document.pdf"
//IronPDFequivalent:
using IronPdf;
var pdf = PdfDocument.FromFile("document.pdf");
var settings = new PrintSettings
{
ShowPrintDialog = false, // -silent
NumberOfCopies = 3, // -copies 3
PrinterName = "HP LaserJet", // -printer "HP LaserJet"
FromPage = 1, // -pages "1-5"
ToPage = 5
};
pdf.Print(settings);
//PDFFilePrintcommand-line approach:
// PDFFilePrint.exe -silent -copies 3 -printer "HP LaserJet" -pages "1-5" "document.pdf"
//IronPDFequivalent:
using IronPdf;
var pdf = PdfDocument.FromFile("document.pdf");
var settings = new PrintSettings
{
ShowPrintDialog = false, // -silent
NumberOfCopies = 3, // -copies 3
PrinterName = "HP LaserJet", // -printer "HP LaserJet"
FromPage = 1, // -pages "1-5"
ToPage = 5
};
pdf.Print(settings);
Imports IronPdf
Dim pdf = PdfDocument.FromFile("document.pdf")
Dim settings As New PrintSettings With {
.ShowPrintDialog = False, ' -silent
.NumberOfCopies = 3, ' -copies 3
.PrinterName = "HP LaserJet", ' -printer "HP LaserJet"
.FromPage = 1, ' -pages "1-5"
.ToPage = 5
}
pdf.Print(settings)
Gizli Mod Bayrak Dönüşümü
Gizli baskı için ters mantığı unutmayın:
// PDFFilePrint: -silent flag enables silent mode
// IronPDF: ShowPrintDialog = false (false = silent)
var settings = new PrintSettings { ShowPrintDialog = false };
// PDFFilePrint: -silent flag enables silent mode
// IronPDF: ShowPrintDialog = false (false = silent)
var settings = new PrintSettings { ShowPrintDialog = false };
' PDFFilePrint: -silent flag enables silent mode
' IronPDF: ShowPrintDialog = false (false = silent)
Dim settings As New PrintSettings With {.ShowPrintDialog = False}
Geçiş Sonrası Yeni Özellikler
IronPDF'e geçtikten sonra, PDFFilePrint'in sağlayamayacağı yeteneklere sahip olursunuz:
Tek Adımda Oluştur ve Yazdır
using IronPdf;
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf("<h1>Invoice #12345</h1><p>Thank you for your order.</p>");
pdf.Print("Office Printer");
using IronPdf;
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf("<h1>Invoice #12345</h1><p>Thank you for your order.</p>");
pdf.Print("Office Printer");
Imports IronPdf
Dim renderer As New ChromePdfRenderer()
Dim pdf = renderer.RenderHtmlAsPdf("<h1>Invoice #12345</h1><p>Thank you for your order.</p>")
pdf.Print("Office Printer")
PDF Birleştirme
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")
Filigranlar
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")
Şifre Koruması
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")
Metin Çıkarma
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()
Kritik Geçiş Notları
Sınıf Deseni Değişikliği
PDFFilePrint, her şey için tek bir PDFFile sınıfı kullanır;IronPDFsorumlulukları ayırır:
// PDFFilePrint: Single class
var pdf = new PDFFile();
pdf.CreateFromHtml(html);
pdf.SaveToFile(path);
// IronPDF: Renderer for creation, Document for manipulation
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs(path);
// PDFFilePrint: Single class
var pdf = new PDFFile();
pdf.CreateFromHtml(html);
pdf.SaveToFile(path);
// IronPDF: Renderer for creation, Document for manipulation
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs(path);
' PDFFilePrint: Single class
Dim pdf1 = New PDFFile()
pdf1.CreateFromHtml(html)
pdf1.SaveToFile(path)
' IronPDF: Renderer for creation, Document for manipulation
Dim renderer = New ChromePdfRenderer()
Dim pdf2 = renderer.RenderHtmlAsPdf(html)
pdf2.SaveAs(path)
Yöntem Adlandırma Değişiklikleri
//PDFFilePrint→ IronPDF
CreateFromHtml() → RenderHtmlAsPdf()
CreateFromUrl() → RenderUrlAsPdf()
LoadFromFile() → PdfDocument.FromFile()
SaveToFile() → SaveAs()
Print(printerName) → Print(printerName) or Print()
//PDFFilePrint→ IronPDF
CreateFromHtml() → RenderHtmlAsPdf()
CreateFromUrl() → RenderUrlAsPdf()
LoadFromFile() → PdfDocument.FromFile()
SaveToFile() → SaveAs()
Print(printerName) → Print(printerName) or Print()
'PDFFilePrint→ IronPDF
RenderHtmlAsPdf() → RenderHtmlAsPdf()
RenderUrlAsPdf() → RenderUrlAsPdf()
PdfDocument.FromFile() → PdfDocument.FromFile()
SaveAs() → SaveAs()
Print(printerName) → Print(printerName) or Print()
Çıkış Kodundan İstisna Yakalamaya Geçiş
Komut satırıPDFFilePrintkullanılıyorsa:
// PDFFilePrint: Check process exit code
if (process.ExitCode != 0) {
var error = process.StandardError.ReadToEnd();
throw new Exception($"Print failed: {error}");
}
// IronPDF: Use try-catch
try {
pdf.Print();
}
catch (Exception ex) {
// Handle error with full exception details
}
// PDFFilePrint: Check process exit code
if (process.ExitCode != 0) {
var error = process.StandardError.ReadToEnd();
throw new Exception($"Print failed: {error}");
}
// IronPDF: Use try-catch
try {
pdf.Print();
}
catch (Exception ex) {
// Handle error with full exception details
}
' PDFFilePrint: Check process exit code
If process.ExitCode <> 0 Then
Dim error = process.StandardError.ReadToEnd()
Throw New Exception($"Print failed: {error}")
End If
' IronPDF: Use try-catch
Try
pdf.Print()
Catch ex As Exception
' Handle error with full exception details
End Try
Harici Bağımlılıkları Kaldır
Komut satırı PDFFilePrint'i kullanıyorsanız, eklenmiş çalıştırılabilir dosyayı kaldırın:
// Before: Required external executable
private readonly string _pdfFilePrintPath = @"C:\tools\PDFFilePrint.exe";
// After: No external dependencies
//IronPDFis fully self-contained via NuGet
// Before: Required external executable
private readonly string _pdfFilePrintPath = @"C:\tools\PDFFilePrint.exe";
// After: No external dependencies
//IronPDFis fully self-contained via NuGet
' Before: Required external executable
Private ReadOnly _pdfFilePrintPath As String = "C:\tools\PDFFilePrint.exe"
' After: No external dependencies
'IronPDF is fully self-contained via NuGet
Özellik Karsilastirma Ozeti
| Özellik | PDFFilePrint | IronPDF |
|---|---|---|
| Temel baskı | ✓ | ✓ |
| Gizli baskı | ✓ | ✓ |
| Birden fazla kopya | ✓ | ✓ |
| Sayfa aralığı | ✓ | ✓ |
| Çift yönlü | Değişken | ✓ |
| HTML'den Oluşturma | Sınırlı | ✓ |
| URL'den Oluşturma | Sınırlı | ✓ |
| PDF'leri birleştir | ✗ | ✓ |
| PDF'leri Böl | ✗ | ✓ |
| Filigran ekleme | ✗ | ✓ |
| Metin çıkar | ✗ | ✓ |
| Parola koruması | ✗ | ✓ |
| Dijital imzalar | ✗ | ✓ |
| Çok platformlu | ✗ | ✓ |
| Yerel .NET API | Sınırlı | ✓ |
Goc Kontrol Listesi
Geçiş Öncesi
- Kod tabanındaki tümPDFFilePrintreferanslarını bulun
- Kullanılan mevcut yöntemleri belgeleyin (CreateFromHtml, CreateFromUrl, Print, vb.)
- Farklı ortamlarda kullanılan yazıcı adlarını belirleyin
- Process.Start şablonu kullanılıyorsa herhangi bir komut satırı argümanını listeleyin
- Yeni özellikler için fırsatları belirleyin (birleştirme, filigranlar, güvenlik) -IronPDFlisans anahtarını edinin
Paket Değişiklikleri
PDFFilePrintNuGet paketini kaldırın- Dağıtımda eklenen PDFFilePrint.exe'yi kaldırın (uygulanabilir ise)
IronPdfNuGet paketini yükleyin:dotnet add package IronPdf- Ad alanı eklerini güncelleyin
Kod Değişiklikleri
- Başlangıçta lisans anahtarı yapılandırması ekleyin
new PDFFile()+CreateFromHtml()'iChromePdfRenderer.RenderHtmlAsPdf()ile değiştirinnew PDFFile()+CreateFromUrl()'iChromePdfRenderer.RenderUrlAsPdf()ile değiştirinLoadFromFile()'iPdfDocument.FromFile()ile değiştirinSaveToFile()'iSaveAs()ile değiştirin- Gerektiği gibi
Print()çağrılarını güncelleyin - Çıkış kodu kontrollerini istisna yakalama ile değiştirin (uygulanabilir ise)
Geçişten Sonra
- PDFFilePrint.exe'yi kaynak kontrolünden çıkarın
- Derleme skriptleriniPDFFilePrintkopyalamasını kaldıracak şekilde güncelleyin
- Tüm hedef yazıcılarda baskıyı test edin
- Uygulanabilir ise platformlar arası test edin
- Gerektiğinde yeni özellikler ekleyin (filigranlar, güvenlik)
- Belgeleri güncelleyin

