フッターコンテンツにスキップ
移行ガイド

C#でPdfiumからIronPDFに移行する方法

Pdfium.NETからIronPDFに移行することで、.NET PDFワークフローはネイティブバイナリ依存のレンダリングに特化したライブラリから、プラットフォーム固有の複雑さなしに作成、操作、レンダリングを処理する包括的なPDFソリューションに移行します。 このガイドでは、Pdfiumでは提供できない機能を追加しながら、ネイティブの依存性管理を排除する完全でステップバイステップの移行パスを提供します。

なぜPdfiumからIronPDFに移行するのか

Pdfium.NETを理解する

Pdfium.NETは、GoogleのPDFiumライブラリ for .NETラッパーで、PDF文書のレンダリングにおける効率性とスピードで有名です。 C#アプリケーション内でのPDFレンダリングの複雑さを掘り下げている開発者にとって重要なライブラリとして登場し、.NET環境でPDFコンテンツの忠実度の高い複製を提供します。

しかし、Pdfium.NETはレンダリングに長けているものの、PDF文書の作成と操作には限界があります。 主に、PDFコンテンツを正確に表示する必要があり、PDFの修正や新規作成にはあまり重点を置いていないアプリケーション向けに作られています。

重要な Pdfium の制限事項

1.レンダリングのみに焦点: HTML、画像、またはプログラムから PDF を作成することはできません。 Pdfiumの機能は、PDFの表示とレンダリングに制限されています。

  1. PDF 操作不可: PDF コンテンツを結合、分割、または変更することはできません。 iTextSharpやPdfSharpのような別のライブラリを使用する必要があります。

3.ネイティブ バイナリ依存関係:プラットフォーム固有の PDFium バイナリが必要です。 開発者はPDFiumのネイティブバイナリを管理する必要がありますが、これはデプロイや配布の際に複雑さを増す側面があります。

4.展開の複雑さ:プラットフォームごとにネイティブ DLL を x86、x64、およびランタイム フォルダーにバンドルして管理する必要があります。

5.限定的なテキスト抽出:書式設定なしの基本的なテキスト抽出。 テキスト抽出には、Pdfium.NETを使用する必要があります。

  1. HTML から PDF への変換不可: Web コンテンツを PDF に変換できません。 HTMLからPDFへの変換は、Pdfium.NETではネイティブにサポートされていません。

7.ヘッダー/フッターなし:ページ番号や繰り返しコンテンツを追加できません。

8.透かしなし:オーバーレイ付きの文書にスタンプを押すことはできません。

9.フォームのサポートなし: PDF フォームに入力したり読み取ったりできません。

10.セキュリティ機能なし: PDF を暗号化したりパスワードで保護したりできません。

PdfiumとIronPdfの比較

アスペクト Pdfium.NET IronPDF
主な焦点 レンダリング/ビューイング 完全なPDFソリューション
レンダリング忠実度 忠実度の高いレンダリング 特にHTML/CSS/JSについては、高いレベルが求められます。
PDFの作成 (HTML, URL, 画像)
PDF操作 マージ、分割、編集
HTMLからPDFへ Chromium エンジン
ウォーターマーク
ヘッダー/フッター
フォーム入力
セキュリティ
ネイティブの依存関係 必須 なし(フルマネージド)
クロスプラットフォーム 複雑なセットアップ 自動翻訳
展開のしやすさ ネイティブの依存関係が複雑 より簡単に; 依存関係の複雑さを軽減

2025年と2026年まで.NET 10とC# 14の採用を計画しているチームにとって、IronPDFは包括的なPDFの作成と操作機能を追加しながら、ネイティブのバイナリ管理を排除する完全な管理基盤を提供します。


始める前に

前提条件

  1. .NET環境: .NET Framework 4.6.2+ または.NET Core 3.1+ / .NET 5/6/7/8/9+
  2. NuGetアクセス: NuGetパッケージをインストールする機能
  3. IronPDFライセンス: IronPDFからライセンスキーを取得します。

NuGetパッケージの変更

# 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

ライセンス構成

// 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の使用法を特定する

# 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 リファレンス

名前空間の変更

// 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

コア クラス マッピング

Pdfium.NET IronPDF
PdfDocument PdfDocument
PdfPage PdfPage
PdfPageCollection PdfPageCollection
(利用できません) ChromePdfRenderer
(利用できません) HtmlHeaderFooter

ドキュメント読み込みマッピング

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)

ドキュメント プロパティのマッピング

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

テキスト抽出マッピング

Pdfium.NET IronPDF
document.GetPdfText(pageIndex) document.Pages[index].Text
(マニュアルループ) document.ExtractAllText()
page.GetTextBounds() page.Text

ドキュメント マッピングの保存

Pdfium.NET IronPDF
document.Save(path) document.SaveAs(path)
document.Save(stream) document.Stream
(利用できません) document.BinaryData

ページ レンダリング マッピング

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

Pdfiumでは利用できない新機能

IronPDFの特徴 翻訳内容
ChromePdfRenderer.RenderHtmlAsPdf() HTMLから作成
ChromePdfRenderer.RenderUrlAsPdf() URLから作成
ChromePdfRenderer.RenderHtmlFileAsPdf() HTMLファイルから作成
PdfDocument.Merge() PDFの結合
pdf.CopyPages() ページの抜粋
pdf.RemovePages() ページの削除
pdf.InsertPdf() 位置にPDFを挿入
pdf.ApplyWatermark() 透かしの追加
pdf.AddHtmlHeaders() ヘッダーの追加
pdf.AddHtmlFooters() フッターの追加
pdf.SecuritySettings パスワード保護
pdf.SignWithDigitalSignature() デジタル署名
pdf.Form フォーム入力

コード移行の例

例1: PDFからのテキスト抽出

翻訳前 (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

翻訳後(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

ここでの違いは重要です。 Pdfium では、GetPdfText(pageIndex) を使用して各ページを手動でループし、StringBuilder を構築し、using ステートメントを管理して適切に破棄する必要があります。 コードには、"PdfiumViewerのテキスト抽出機能には制限があります"、"テキスト抽出には追加作業が必要です "と書かれています。

IronPDF はこれを 3 行に簡素化します: PdfDocument.FromFile() でロードし、ExtractAllText() で抽出し、出力します。 ExtractAllText() メソッドは、より高度なテキスト抽出機能を使用してすべてのページを自動的に処理します。 ページごとの抽出が必要な場合は、pdf.Pages[index].Text を使用できます。 追加オプションについては、テキスト抽出のドキュメントを参照してください。

例 2: PDF のマージ

翻訳前 (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

翻訳後(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

この例は、基本的な機能のギャップを浮き彫りにしています。PdfiumはPDFをマージすることができません。コードには "PDFマージはPdfiumViewerではネイティブにサポートされていません。"、"iTextSharpやPdfSharpのような別のライブラリを使用する必要があります。"と明記されています。

IronPDF は、ファイル パスのリストを直接受け入れる静的な PdfDocument.Merge() メソッドを使用してネイティブ マージを提供します。 結果は新しい PdfDocument となり、SaveAs() とともに保存されます。 PDFのマージと分割については、こちらをご覧ください。

例3: HTMLからPDFへの変換

翻訳前 (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

翻訳後(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

この例は、最も大きな能力の違いを示しています。 Pdfiumは、"HTMLからPDFへの変換は、Pdfium.NETではネイティブにサポートされていません。"と "HTMLをPDFに変換するには、別のライブラリを使用する必要があります。"と明確に述べています。

IronPDF は、HTML、CSS、 JavaScriptを正確にレンダリングするために内部で Chromium エンジンを使用する ChromePdfRenderer を通じてネイティブの HTML から PDF への変換を提供します。 RenderHtmlAsPdf() メソッドは、HTML 文字列を直接 PDF ドキュメントに変換します。IronPDFは、RenderUrlAsPdf() を含む URL や、RenderHtmlFileAsPdf() を含む HTML ファイルもレンダリングできます。 包括的な例については、HTML to PDF documentationを参照してください。


ネイティブ依存性の除去

PdfiumからIronPdfへの移行の最も大きな利点の一つは、ネイティブのバイナリ管理が不要になることです。

ビフォア (Pdfium) - 複雑なデプロイメント

MyApp/
├── ビン/
│ ├──MyApp.dll
│ ├──Pdfium.NET.dll
│ ├── x86/
│ └── pdfium.dll
│ └── x64/
└─ pdfium.dll
ランタイム
│ ├── win-x86/native/
│ └── pdfium.dll
│ └── win-x64/native/
└─ pdfium.dll

翻訳後 (IronPDF) - クリーンなデプロイメント

MyApp/
├── ビン/
│ ├──MyApp.dll
│ └─ IronPdf.dll # 含まれるものすべて

ネイティブ バイナリ参照の削除

# 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

重要な移行に関する注意事項

スケールからDPIへの変換

Pdfiumはスケールファクターを使用しています; IronPDFはDPIを使用しています:

// 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

ドキュメント読み込み方法の変更

// Pdfium
PdfDocument.Load(path)

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

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

保存メソッドの変更

// Pdfium
document.Save(path)

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

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

廃棄パターンの簡略化

// Pdfium:必須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:必須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 Pdfium
Imports IronPDF

' Pdfium: 必須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

プラットフォーム固有のコードの削除

// Pdfium:必須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:必須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
#If WIN64 Then
    ' Load x64 pdfium.dll
#Else
    ' Load x86 pdfium.dll
#End If

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

機能比較の概要

フィーチャー Pdfium.NET IronPDF
PDFを読み込む
画像にレンダリング
テキストの抽出 基本 上級
ページ情報
HTMLから作成
URLから作成
PDFのマージ
PDFの分割
透かしの追加
ヘッダー/フッター
フォーム入力
デジタル署名
パスワード保護
ネイティブの依存関係 必須 なし
クロスプラットフォーム 複雑 自動翻訳
メモリ管理 マニュアルの廃棄 簡略化

移行チェックリスト

移行前

  • コードベース内のすべてのPdfiumの使用状況を特定する
  • 現在使用されているレンダリング寸法/スケールを文書化する
  • プロジェクト内のネイティブバイナリの場所を一覧表示する
  • プラットフォーム固有の読み込みコードを確認する
  • PDF 作成のニーズを特定します (現在別のツールを使用していますか?)
  • 転換のための廃棄パターンを確認する
  • IronPDFライセンスキーを取得する

パッケージの変更

  • PdfiumViewer NuGetパッケージを削除します
  • x86/、x64/、runtimes/ フォルダからネイティブ pdfium.dll バイナリを削除します。
  • プラットフォーム固有の条件付きコンパイルを削除
  • .csproj を更新してネイティブバイナリ参照を削除します
  • IronPdf NuGetパッケージをインストールします: dotnet add package IronPdf

コードの変更

  • 起動時にライセンスキー設定を追加する
  • PdfDocument.Load()PdfDocument.FromFile() に置き換えます
  • document.Save()pdf.SaveAs() に置き換えます
  • document.GetPdfText(i) ループを pdf.ExtractAllText() に置き換えます
  • スケール係数をDPI値に変換します(DPI = 72 × スケール)
  • 破棄パターンを簡素化する(ネストされた using ステートメントを削除する)
  • プラットフォーム固有のコードを削除する

移行後

  • レンダリング出力品質のテスト
  • テキスト抽出結果を比較する
  • クロスプラットフォーム展開のテスト
  • 新しい機能の追加(HTMLからPDFへの変換、結合、透かし、セキュリティ)
  • ドキュメントの更新

カーティス・チャウ
テクニカルライター

Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。

開発以外にも、CurtisはIoT(Internet of Things)への強い関心を持ち、ハードウェアとソフトウェアの統合方法を模索しています。余暇には、ゲームをしたりDiscordボットを作成したりして、技術に対する愛情と創造性を組み合わせています。

アイアンサポートチーム

私たちは週5日、24時間オンラインで対応しています。
チャット
メール
電話してね