Altbilgi içeriğine atla
GEçIş KıLAVUZLARı

Pdfium'dan IronPDF'e C# ile Nasıl Geçilir

Pdfium.NET'ten IronPDF'e geçmek, .NET PDF iş akışınızı yerel ikili bağımlılıklara sahip bir görüntüleme odaklı kütüphaneden, oluşturma, manipülasyon ve görüntüleme işlevlerini platformdan bağımsız karmaşıklık olmaksızın ele alabilen kapsamlı bir PDF çözümüne taşır. Bu kılavuz, yerel bağımlılık yönetimini ortadan kaldırarak ve Pdfium'un sağlayamayacağı yetenekler ekleyerek tam adım adım bir geçiş yolu sağlar.

Pdfium'dan IronPDF'e Neden Geçmeli

Pdfium.NET'i Anlamak

Pdfium.NET, Google'ın PDFium kütüphanesinin bir .NET sarmalayıcısıdır ve PDF belgelerini görüntülemede verimliliği ve hızı ile tanınır. C# uygulamaları içinde PDF görüntüleme detaylarına dalan geliştiriciler için önemli bir kütüphane haline gelmiştir ve .NET ortamlarındaki PDF içeriğini yüksek doğrulukla yeniden kopyalar.

Ancak, görüntülemedeki ustalığına rağmen, Pdfium.NET'in PDF belgeleri oluşturma ve manipüle etme yetenekleri sınırlıdır. Yeni PDF'ler oluşturma veya mevcutları değiştirme üzerinde daha az vurgu ile esas olarak PDF içeriğini doğru bir şekilde görüntülemesi gereken uygulamalar için inşa edilmiştir.

Önemli Pdfium Sınırlamaları

  1. Sadece Görüntüleme Odaklı: HTML, görüntü veya programlı olarak PDF oluşturamaz. Pdfium'un yetenekleri PDF'leri görüntüleme ve render ile sınırlıdır.

  2. PDF Manipülasyonu Yok: PDF içeriğini birleştiremez, ayıramaz veya değiştiremez. PDF birleştirme yerel olarak desteklenmez—iTextSharp veya PdfSharp gibi başka bir kütüphane kullanmanız gerekecektir.

  3. Yerel İkili Bağımlılıklar: Platforma özel PDFium ikilileri gerektirir. Geliştiricilerin yerel PDFium ikililerini yönetmesi gerekir, bu dağıtım ve yayma sırasında karmaşıklık ekleyen bir asktir.

  4. Dağıtım Karmaşıklığı: Platform başına x86, x64 ve çalışma zamanı klasörleri ile yerel DLL'leri paketlemek ve yönetmek gerekir.

  5. Sınırlı Metin Çıkarma: Biçimlendirme olmadan temel metin çıkarma. Metin çıkarma Pdfium.NET ile ek çalışma gerektirir.

  6. HTML'den PDF'e Yok: Web içeriğini PDF'e dönüştüremez. HTML'den PDF'e dönüştürme Pdfium.NET'te yerel olarak desteklenmez.

  7. Üstbilgi/Altbilgi Yok: Sayfa numaraları veya yinelenen içerik ekleyemez.

  8. Filigranlar Yok: Belgeleri üst üste bindirmelerle damgalayamaz.

  9. Form Desteği Yok: PDF formları dolduramaz veya okuyamaz.

  10. Güvenlik Özellikleri Yok: PDF'leri şifreleyemez veya parola ile koruyamaz.

Pdfium veIronPDFKarşılaştırması

Bağlam Pdfium.NET IronPDF
Birincil Odak Renderlama/görüntüleme Tam PDF çözümü
Görüntüleme Doğruluğu Yüksek doğrulukta görüntüleme Yüksek, özellikle HTML/CSS/JS için
PDF Oluşturma ✓(HTML, URL, görüntüler)
PDF Manipulasyonu ✓(birleştirme, bölme, düzenleme)
HTML to PDF ✓(Chromium motoru)
Filigranlar
Başlıklar/Altbilgiler
Form Doldurma
Güvenlik
Yerel Bağımlılıklar Gerekli Hiçbiri (tamamen yönetilen)
Çapraz Platform Karmaşık kurulum Otomatik
Dağıtım Kolaylığı Yerel bağımlılıklar nedeniyle karmaşık Daha kolay; less dependency complication

.NET 10 ve C# 14'ü 2025 ve 2026 yılları boyunca benimsemeyi planlayan ekipler için IronPDF, yerel ikili yönetimini ortadan kaldırırken kapsamlı PDF oluşturma ve manipülasyon özellikleri ekleyen tamamen yönetilen bir temel sağlar.


Başlamadan Önce

Önkoşullar

  1. .NET Ortamı: .NET Framework 4.6.2+ veya .NET Core 3.1+ / .NET 5/6/7/8/9+
  2. NuGet Erişimi: NuGet paketlerini yükleme yeteneği
  3. IronPDF Lisansı: Lisans anahtarınızı ironpdf.com adresinden edinin

NuGet Paket Değişiklikleri

# Remove Pdfium packages
dotnet remove package Pdfium.NET
dotnet remove package Pdfium.Net.SDK
dotnet remove package PdfiumViewer

# Install IronPDF
dotnet add package IronPdf
# Remove Pdfium packages
dotnet remove package Pdfium.NET
dotnet remove package Pdfium.Net.SDK
dotnet remove package PdfiumViewer

# Install IronPDF
dotnet add package IronPdf
SHELL

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"
$vbLabelText   $csharpLabel

Pdfium Kullanımını Belirleyin

# Find Pdfium usage
grep -r "Pdfium\|PdfDocument\.Load\|\.Render\(" --include="*.cs" .

# Find native binary references
grep -r "pdfium\.dll\|pdfium\.so\|pdfium\.dylib" --include="*.csproj" --include="*.config" .

# Find platform-specific code
grep -r "#if.*64\|WIN32\|WIN64\|LINUX\|OSX" --include="*.cs" .
# Find Pdfium usage
grep -r "Pdfium\|PdfDocument\.Load\|\.Render\(" --include="*.cs" .

# Find native binary references
grep -r "pdfium\.dll\|pdfium\.so\|pdfium\.dylib" --include="*.csproj" --include="*.config" .

# Find platform-specific code
grep -r "#if.*64\|WIN32\|WIN64\|LINUX\|OSX" --include="*.cs" .
SHELL

API Referansının Tamamı

Namespace Değişiklikleri

// Pdfium.NET
using Pdfium;
using Pdfium.Net;
using PdfiumViewer;

// IronPDF
using IronPdf;
using IronPdf.Rendering;
using IronPdf.Editing;
// Pdfium.NET
using Pdfium;
using Pdfium.Net;
using PdfiumViewer;

// IronPDF
using IronPdf;
using IronPdf.Rendering;
using IronPdf.Editing;
Imports Pdfium
Imports Pdfium.Net
Imports PdfiumViewer

Imports IronPdf
Imports IronPdf.Rendering
Imports IronPdf.Editing
$vbLabelText   $csharpLabel

Temel Sınıf Eşlemeleri

Pdfium.NET IronPDF
PdfDocument PdfDocument
PdfPage PdfPage
PdfPageCollection PdfPageCollection
(mevcut değil) ChromePdfRenderer
(mevcut değil) HtmlHeaderFooter

Belge Yükleme Haritaları

Pdfium.NET IronPDF
PdfDocument.Load(path) PdfDocument.FromFile(path)
PdfDocument.Load(stream) PdfDocument.FromStream(stream)
PdfDocument.Load(bytes) PdfDocument.FromBinaryData(bytes)
new PdfDocument(path) PdfDocument.FromFile(path)

Belge Özellikleri Haritalamaları

Pdfium.NET IronPDF
document.PageCount document.PageCount
document.Pages document.Pages
document.Pages[index] document.Pages[index]
document.GetPageSize(index) document.Pages[index].Width/Height

Metin Çıkarma Haritalamaları

Pdfium.NET IronPDF
document.GetPdfText(pageIndex) document.Pages[index].Text
(manuel döngü) document.ExtractAllText()
page.GetTextBounds() page.Text

Belgeleri Kaydetme Haritalamaları

Pdfium.NET IronPDF
document.Save(path) document.SaveAs(path)
document.Save(stream) document.Stream
(mevcut değil) document.BinaryData

Sayfa Görüntüleme Haritalamaları

Pdfium.NET IronPDF
page.Render(width, height) pdf.RasterizeToImageFiles(path, dpi)
page.Render(width, height, flags) DPI parametresi
document.Render(index, width, height) pdf.RasterizeToImageFiles()
page.RenderToScale(scale) DPI: 72 * scale

Pdfium'de Mevcut Olmayan Yeni Özellikler

IronPDFÖzelliği Tanım
ChromePdfRenderer.RenderHtmlAsPdf() HTML'den Oluşturma
ChromePdfRenderer.RenderUrlAsPdf() URL'den Oluşturma
ChromePdfRenderer.RenderHtmlFileAsPdf() HTML dosyasından oluşturma
PdfDocument.Merge() PDF'leri birleştir
pdf.CopyPages() Sayfa çıkar
pdf.RemovePages() Sayfa sil
pdf.InsertPdf() Belirli bir konumda PDF ekle
pdf.ApplyWatermark() Filigran ekleme
pdf.AddHtmlHeaders() Üstbilgi ekle
pdf.AddHtmlFooters() Altbilgi ekle
pdf.SecuritySettings Parola koruması
pdf.SignWithDigitalSignature() Dijital imzalar
pdf.Form Form doldurma

Kod Geçiş Örnekleri

Örnek 1: PDF'den Metin Çıkarma

Önce (Pdfium):

// NuGet: Install-Package PdfiumViewer
using PdfiumViewer;
using System;
using System.IO;
using System.Text;

class Program
{
    static void Main()
    {
        string pdfPath = "document.pdf";

        using (var document = PdfDocument.Load(pdfPath))
        {
            StringBuilder text = new StringBuilder();

            for (int i = 0; i < document.PageCount; i++)
            {
                // Note: PdfiumViewer has limited text extraction capabilities
                // Text extraction requires additional work with Pdfium.NET
                string pageText = document.GetPdfText(i);
                text.AppendLine(pageText);
            }

            Console.WriteLine(text.ToString());
        }
    }
}
// NuGet: Install-Package PdfiumViewer
using PdfiumViewer;
using System;
using System.IO;
using System.Text;

class Program
{
    static void Main()
    {
        string pdfPath = "document.pdf";

        using (var document = PdfDocument.Load(pdfPath))
        {
            StringBuilder text = new StringBuilder();

            for (int i = 0; i < document.PageCount; i++)
            {
                // Note: PdfiumViewer has limited text extraction capabilities
                // Text extraction requires additional work with Pdfium.NET
                string pageText = document.GetPdfText(i);
                text.AppendLine(pageText);
            }

            Console.WriteLine(text.ToString());
        }
    }
}
Imports PdfiumViewer
Imports System
Imports System.IO
Imports System.Text

Module Program
    Sub Main()
        Dim pdfPath As String = "document.pdf"

        Using document = PdfDocument.Load(pdfPath)
            Dim text As New StringBuilder()

            For i As Integer = 0 To document.PageCount - 1
                ' Note: PdfiumViewer has limited text extraction capabilities
                ' Text extraction requires additional work with Pdfium.NET
                Dim pageText As String = document.GetPdfText(i)
                text.AppendLine(pageText)
            Next

            Console.WriteLine(text.ToString())
        End Using
    End Sub
End Module
$vbLabelText   $csharpLabel

Sonra (IronPDF):

// NuGet: Install-Package IronPdf
using IronPdf;
using System;

class Program
{
    static void Main()
    {
        string pdfPath = "document.pdf";

        var pdf = PdfDocument.FromFile(pdfPath);
        string text = pdf.ExtractAllText();

        Console.WriteLine(text);
    }
}
// NuGet: Install-Package IronPdf
using IronPdf;
using System;

class Program
{
    static void Main()
    {
        string pdfPath = "document.pdf";

        var pdf = PdfDocument.FromFile(pdfPath);
        string text = pdf.ExtractAllText();

        Console.WriteLine(text);
    }
}
Imports IronPdf
Imports System

Class Program
    Shared Sub Main()
        Dim pdfPath As String = "document.pdf"

        Dim pdf = PdfDocument.FromFile(pdfPath)
        Dim text As String = pdf.ExtractAllText()

        Console.WriteLine(text)
    End Sub
End Class
$vbLabelText   $csharpLabel

Buradaki fark önemlidir. Pdfium, her sayfada GetPdfText(pageIndex) ile manuel bir döngü, StringBuilder oluşturma ve doğru bertaraf için using ifadesini yönetme gerektirir. Kod notları "PdfiumViewer'ın sınırlı metin çıkarma yeteneklerine sahip olduğunu" ve "metin çıkarmanın ek çalışma gerektirdiğini" belirtiyor.

IronPDF bu süreci üç satıra indirir: PdfDocument.FromFile() ile yükle, ExtractAllText() ile çıkar ve çıktı al. ExtractAllText() yöntemi, daha gelişmiş metin çıkarma yetenekleri ile tüm sayfaları otomatik olarak işler. Sayfa başına çıkarıma ihtiyaçınız varsa, pdf.Pages[index].Text kullanabilirsiniz. metin çıkarma dökümanlarına ek seçenekler için bakın.

Örnek 2: PDF Birleştirme

Önce (Pdfium):

// NuGet: Install-Package PdfiumViewer
using PdfiumViewer;
using System;
using System.IO;
using System.Collections.Generic;

// Note: PdfiumViewer does not have native PDF merging functionality
// You would need to use additional libraries or implement custom logic
class Program
{
    static void Main()
    {
        List<string> pdfFiles = new List<string> 
        { 
            "document1.pdf", 
            "document2.pdf", 
            "document3.pdf" 
        };

        // PdfiumViewer is primarily for rendering/viewing
        // PDF merging is not natively supported
        // You would need to use another library like iTextSharp or PdfSharp

        Console.WriteLine("PDF merging not natively supported in PdfiumViewer");
    }
}
// NuGet: Install-Package PdfiumViewer
using PdfiumViewer;
using System;
using System.IO;
using System.Collections.Generic;

// Note: PdfiumViewer does not have native PDF merging functionality
// You would need to use additional libraries or implement custom logic
class Program
{
    static void Main()
    {
        List<string> pdfFiles = new List<string> 
        { 
            "document1.pdf", 
            "document2.pdf", 
            "document3.pdf" 
        };

        // PdfiumViewer is primarily for rendering/viewing
        // PDF merging is not natively supported
        // You would need to use another library like iTextSharp or PdfSharp

        Console.WriteLine("PDF merging not natively supported in PdfiumViewer");
    }
}
Imports PdfiumViewer
Imports System
Imports System.IO
Imports System.Collections.Generic

' Note: PdfiumViewer does not have native PDF merging functionality
' You would need to use additional libraries or implement custom logic
Class Program
    Shared Sub Main()
        Dim pdfFiles As New List(Of String) From {
            "document1.pdf",
            "document2.pdf",
            "document3.pdf"
        }

        ' PdfiumViewer is primarily for rendering/viewing
        ' PDF merging is not natively supported
        ' You would need to use another library like iTextSharp or PdfSharp

        Console.WriteLine("PDF merging not natively supported in PdfiumViewer")
    End Sub
End Class
$vbLabelText   $csharpLabel

Sonra (IronPDF):

// NuGet: Install-Package IronPdf
using IronPdf;
using System;
using System.Collections.Generic;

class Program
{
    static void Main()
    {
        List<string> pdfFiles = new List<string> 
        { 
            "document1.pdf", 
            "document2.pdf", 
            "document3.pdf" 
        };

        var pdf = PdfDocument.Merge(pdfFiles);
        pdf.SaveAs("merged.pdf");

        Console.WriteLine("PDFs merged successfully");
    }
}
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
using System.Collections.Generic;

class Program
{
    static void Main()
    {
        List<string> pdfFiles = new List<string> 
        { 
            "document1.pdf", 
            "document2.pdf", 
            "document3.pdf" 
        };

        var pdf = PdfDocument.Merge(pdfFiles);
        pdf.SaveAs("merged.pdf");

        Console.WriteLine("PDFs merged successfully");
    }
}
Imports IronPdf
Imports System
Imports System.Collections.Generic

Module Program
    Sub Main()
        Dim pdfFiles As New List(Of String) From {
            "document1.pdf",
            "document2.pdf",
            "document3.pdf"
        }

        Dim pdf = PdfDocument.Merge(pdfFiles)
        pdf.SaveAs("merged.pdf")

        Console.WriteLine("PDFs merged successfully")
    End Sub
End Module
$vbLabelText   $csharpLabel

Bu örnek önemli bir yetenek boşluğunu öne çıkarır. Pdfium PDF'leri birleştiremez - kod açıkça "PdfiumViewer'da PDF birleştirme yerel olarak desteklenmez" der ve "iTextSharp veya PdfSharp gibi başka bir kütüphane kullanmanız gerekecektir."

IronPDF, dosya yolu listesini doğrudan kabul eden statik PdfDocument.Merge() yöntemi ile yerel bir birleştirme sağlar. Sonuç, SaveAs() ile kaydettiğiniz yeni bir PdfDocument olur. PDF'leri birleştirme ve bölme hakkında daha fazla bilgi edinin.

Örnek 3: HTML'den PDF'e Dönüştürme

Önce (Pdfium):

// NuGet: Install-Package PdfiumViewer
using PdfiumViewer;
using System.IO;
using System.Drawing.Printing;

// Note: PdfiumViewer is primarily for viewing/rendering PDFs, not creating them from HTML
// For HTML to PDF with Pdfium.NET, you would need additional libraries
// This example shows a limitation of Pdfium.NET
class Program
{
    static void Main()
    {
        // Pdfium.NET does not have native HTML to PDF conversion
        // You would need to use a separate library to convert HTML to PDF
        // then use Pdfium for manipulation
        string htmlContent = "<h1>Hello World</h1>";

        // This functionality is not directly available in Pdfium.NET
        Console.WriteLine("HTML to PDF conversion not natively supported in Pdfium.NET");
    }
}
// NuGet: Install-Package PdfiumViewer
using PdfiumViewer;
using System.IO;
using System.Drawing.Printing;

// Note: PdfiumViewer is primarily for viewing/rendering PDFs, not creating them from HTML
// For HTML to PDF with Pdfium.NET, you would need additional libraries
// This example shows a limitation of Pdfium.NET
class Program
{
    static void Main()
    {
        // Pdfium.NET does not have native HTML to PDF conversion
        // You would need to use a separate library to convert HTML to PDF
        // then use Pdfium for manipulation
        string htmlContent = "<h1>Hello World</h1>";

        // This functionality is not directly available in Pdfium.NET
        Console.WriteLine("HTML to PDF conversion not natively supported in Pdfium.NET");
    }
}
Imports PdfiumViewer
Imports System.IO
Imports System.Drawing.Printing

' Note: PdfiumViewer is primarily for viewing/rendering PDFs, not creating them from HTML
' For HTML to PDF with Pdfium.NET, you would need additional libraries
' This example shows a limitation of Pdfium.NET
Class Program
    Shared Sub Main()
        ' Pdfium.NET does not have native HTML to PDF conversion
        ' You would need to use a separate library to convert HTML to PDF
        ' then use Pdfium for manipulation
        Dim htmlContent As String = "<h1>Hello World</h1>"

        ' This functionality is not directly available in Pdfium.NET
        Console.WriteLine("HTML to PDF conversion not natively supported in Pdfium.NET")
    End Sub
End Class
$vbLabelText   $csharpLabel

Sonra (IronPDF):

// NuGet: Install-Package IronPdf
using IronPdf;
using System;

class Program
{
    static void Main()
    {
        var renderer = new ChromePdfRenderer();
        string htmlContent = "<h1>Hello World</h1>";

        var pdf = renderer.RenderHtmlAsPdf(htmlContent);
        pdf.SaveAs("output.pdf");

        Console.WriteLine("PDF created successfully");
    }
}
// NuGet: Install-Package IronPdf
using IronPdf;
using System;

class Program
{
    static void Main()
    {
        var renderer = new ChromePdfRenderer();
        string htmlContent = "<h1>Hello World</h1>";

        var pdf = renderer.RenderHtmlAsPdf(htmlContent);
        pdf.SaveAs("output.pdf");

        Console.WriteLine("PDF created successfully");
    }
}
Imports IronPdf
Imports System

Class Program
    Shared Sub Main()
        Dim renderer = New ChromePdfRenderer()
        Dim htmlContent As String = "<h1>Hello World</h1>"

        Dim pdf = renderer.RenderHtmlAsPdf(htmlContent)
        pdf.SaveAs("output.pdf")

        Console.WriteLine("PDF created successfully")
    End Sub
End Class
$vbLabelText   $csharpLabel

Bu örnek en önemli yetenek farkını gösterir. Pdfium açıkça belirtir ki "HTML'den PDF'e dönüşüm Pdfium.NET'te yerel olarak desteklenmez" ve "HTML'den PDF'e dönüştürme için ayrı bir kütüphane kullanmanız gerekir."

IronPDF, HTML, CSS ve JavaScript'in doğru render edilmesi için dahili olarak bir Chromium motoru kullanan ChromePdfRenderer aracılığıyla yerel HTML'den PDF'ye dönüşüm sağlar. RenderHtmlAsPdf() yöntemi, HTML dizelerini doğrudan PDF belgelerine dönüştürür.IronPDFayrıca RenderUrlAsPdf() ile URL'leri ve RenderHtmlFileAsPdf() ile HTML dosyalarını render edebilir. Kapsamlı örnekler için HTML'den PDF'e döndürme belgesine bakın.


Yerel Bağımlılıkların Kaldırılması

Pdfium'dan IronPDF'e geçmenin en önemli avantajlarından biri, yerel ikili yönetiminin ortadan kaldırılmasıdır.

Önce (Pdfium) - Karmaşık Dağıtım

MyApp/
├── bin/
│   ├── MyApp.dll
│   ├── Pdfium.NET.dll
│   ├── x86/
│   │   └── pdfium.dll
│   └── x64/
│       └── pdfium.dll
├── çalışma zamanları/
│   ├── win-x86/yerel/
│   │   └── pdfium.dll
│   └── win-x64/yerel/
│       └── pdfium.dll

Sonra (IronPDF) - Temiz Dağıtım

MyApp/
├── bin/
│   ├── MyApp.dll
│   └── IronPdf.dll  # Her şey dahil

Yerel İkili Başvuruların Kaldırılması

# Delete native PDFium binaries
rm -rf x86/ x64/ runtimes/

# Remove from .csproj
# Delete any <Content Include="pdfium.dll" /> entries
# Delete any <None Include="x86/pdfium.dll" /> entries
# Delete native PDFium binaries
rm -rf x86/ x64/ runtimes/

# Remove from .csproj
# Delete any <Content Include="pdfium.dll" /> entries
# Delete any <None Include="x86/pdfium.dll" /> entries
SHELL

Kritik Geçiş Notları

Ölçekle DPI Dönüşümü

Pdfium ölçek faktörlerini kullanır;IronPDFDPI kullanır:

// Formula:IronPDFDPI = 72 × Pdfium scale
// Pdfium scale 2.0 →IronPDFDPI 144
pdf.RasterizeToImageFiles("*.png", DPI: 144);
// Formula:IronPDFDPI = 72 × Pdfium scale
// Pdfium scale 2.0 →IronPDFDPI 144
pdf.RasterizeToImageFiles("*.png", DPI: 144);
' Formula: IronPDFDPI = 72 × Pdfium scale
' Pdfium scale 2.0 → IronPDFDPI 144
pdf.RasterizeToImageFiles("*.png", DPI:=144)
$vbLabelText   $csharpLabel

Belge Yükleme Yöntemi Değişikliği

// Pdfium
PdfDocument.Load(path)

// IronPDF
PdfDocument.FromFile(path)
// Pdfium
PdfDocument.Load(path)

// IronPDF
PdfDocument.FromFile(path)
$vbLabelText   $csharpLabel

Kaydetme Yöntemi Değişikliği

// Pdfium
document.Save(path)

// IronPDF
pdf.SaveAs(path)
// Pdfium
document.Save(path)

// IronPDF
pdf.SaveAs(path)
$vbLabelText   $csharpLabel

Atma Deseni Basitleştirilmesi

// Pdfium: Gerekli explicit disposal
using (var document = PdfDocument.Load(path))
using (var page = document.Pages[0])
using (var bitmap = page.Render(1024, 768))
{
    bitmap.Save("output.png");
}

// IronPDF: Simplified
var pdf = PdfDocument.FromFile(path);
pdf.RasterizeToImageFiles("output.png");
// Pdfium: Gerekli explicit disposal
using (var document = PdfDocument.Load(path))
using (var page = document.Pages[0])
using (var bitmap = page.Render(1024, 768))
{
    bitmap.Save("output.png");
}

// IronPDF: Simplified
var pdf = PdfDocument.FromFile(path);
pdf.RasterizeToImageFiles("output.png");
Imports PdfiumViewer

' Pdfium: Gerekli explicit disposal
Using document = PdfDocument.Load(path)
    Using page = document.Pages(0)
        Using bitmap = page.Render(1024, 768)
            bitmap.Save("output.png")
        End Using
    End Using
End Using

' IronPDF: Simplified
Dim pdf = PdfDocument.FromFile(path)
pdf.RasterizeToImageFiles("output.png")
$vbLabelText   $csharpLabel

Platforma Özgü Kodların Kaldırılması

// Pdfium: Gerekli platform detection
# if WIN64
    // Load x64 pdfium.dll
# else
    // Load x86 pdfium.dll
# endif

// IronPDF: Remove all platform-specific code
// Just use the API directly
// Pdfium: Gerekli platform detection
# if WIN64
    // Load x64 pdfium.dll
# else
    // Load x86 pdfium.dll
# endif

// IronPDF: Remove all platform-specific code
// Just use the API directly
$vbLabelText   $csharpLabel

Özellik Karsilastirma Ozeti

Özellik Pdfium.NET IronPDF
PDF Yükle
Resim Olarak Çizim
Metin Çıkarma ✓(temel) ✓(ileri)
Sayfa Bilgisi
HTML'den Oluşturma
URL'den Oluşturma
PDF'leri birleştir
PDF'leri Böl
Filigran Ekleme
Üstbilgi/Altbilgi
Form Doldurma
Dijital İmzalar
Şifre Koruması
Yerel Bağımlılıklar Gerekli None
Çapraz Platform Karmaşık Otomatik
Bellek Yönetimi Manuel atma Basitleştirilmiş

Goc Kontrol Listesi

Geçiş Öncesi

  • Kod tabanında tüm Pdfium kullanımını tespit edin
  • Mevcut işleme boyutları/ölçekleri belgelenmiş
  • Projede yerel ikili konumlarını listeleyin
  • Platforma özgü yükleme kodunu kontrol edin
  • PDF oluşturma ihtiyaçlarını (şu anda ayrı araçlar mı kullanılıyor?) belirleyin
  • Dönüşüm için atma desenlerini gözden geçirin -IronPDFlisans anahtarını edinin

Paket Değişiklikleri

  • Pdfium.NET, Pdfium.Net.SDK, PdfiumViewer NuGet paketlerini kaldırın
  • x86/, x64/, runtimes/ klasörlerinden yerel pdfium.dll ikililerini silin
  • Platforma özgü koşullu derlemeyi kaldırın
  • Yerel ikili başvuruları kaldırmak için .csproj'u güncelleyin
  • IronPdf NuGet paketini kurun: dotnet add package IronPdf

Kod Değişiklikleri

  • Başlangıçta lisans anahtarı yapılandırması ekleyin
  • PdfDocument.Load() öğesini PdfDocument.FromFile() ile değiştirin
  • document.Save() öğesini pdf.SaveAs() ile değiştirin
  • document.GetPdfText(i) döngülerini pdf.ExtractAllText() ile değiştirin
  • Ölçek faktörlerini DPI değerlerine dönüştürün (DPI = 72 × ölçek)
  • Atılacak desenleri basitleştirin (iç içe using ifadelerini kaldırın)
  • Platforma özgü kodları kaldırın

Geçişten Sonra

  • İşleme çıktı kalitesini test edin
  • Metin çıkarım sonuçlarını karşılaştırın
  • Platformlar arası dağıtımı test edin
  • Yeni yetenekler ekleyin (HTML'den PDF'e, birleştirme, filigranlar, güvenlik)
  • Belgeleri güncelleyin

Curtis Chau
Teknik Yazar

Curtis Chau, Bilgisayar Bilimleri alanında lisans derecesine sahiptir (Carleton Üniversitesi) ve Node.js, TypeScript, JavaScript ve React konularında uzmanlaşmış ön uç geliştirme üzerine uzmanlaşmıştır. Kullanıcı dostu ve estetik açıdan hoş arayüzler tasarlamaya tutkuyla bağlı olan Curtis, modern çerç...

Daha Fazlasını Oku

Iron Destek Ekibi

Haftanın 5 günü, 24 saat çevrimiçiyiz.
Sohbet
E-posta
Beni Ara