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

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

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

MuPDFの課題

MuPDFは優れたPDFレンダラーですが、そのAGPLライセンスとレンダリングのみにフォーカスしているため、商用アプリケーションを構築する.NET開発者には大きな制限があります:

  1. AGPL ライセンスの罠:MuPDFのバイラル ライセンスでは、アプリケーション全体を AGPL の下でオープン ソース化するか、不透明なコンタクト セールス価格の高価な商用ライセンスを購入する必要があります。

2.レンダリングのみに焦点:MuPDFはビューア/レンダラーであり、HTML からの PDF 作成、ドキュメント生成ワークフロー、フォームの入力、透かしやヘッダー/フッターの追加用に設計されていません。

  1. HTML をサポートしていません:MuPDFは HTML から PDF への直接変換をサポートしていません。 HTMLをサポートされている形式に変換するには、まず別のライブラリを使用する必要があります。これは基本的な制限です-MuPDFは主にPDFレンダラー/ビューアです。

4.ネイティブ依存関係:プラットフォーム固有のバイナリは、Windows、Linux、macOS では手動で管理する必要があります。 Dockerのデプロイは、ネイティブライブラリの要件によって複雑になり、デプロイのパッケージングには課題が生じます。

5.操作の制限: PDF の結合/分割、ページの回転や並べ替え、透かしや注釈、デジタル署名などのサポートが組み込まれていません。

  1. C 相互運用性の複雑さ:ネイティブ バインディングにより、メモリ管理の問題、プラットフォーム固有のバグ、およびマーシャリングのオーバーヘッドが発生します。

MuPDFとIronPDFの比較

フィーチャー MuPDF IronPDF
ライセンス AGPL(ウィルス性)または高価な商用 透明性のある価格設定
主な対象 レンダリング/ビューイング 完全なPDFソリューション
HTMLからPDFへ サポートされていません フルChromiumエンジン
PDF作成 サポートされていません HTML、URL、画像
PDF操作 制限的 完成(マージ、分割、編集)
依存関係 ネイティブバイナリ 完全管理
プラットフォームサポート プラットフォームごとのマニュアル 自動翻訳
非同期サポート 制限的 完全なasync/await
.NET統合 C# 相互接続 .NET ネイティブ

2025年と2026年まで.NET 10とC# 14の採用を計画しているチームにとって、IronPDFはネイティブのインターオプを複雑にすることなく、完全に管理された.NETライブラリとして将来を保証する基盤を提供します。


マイグレーションの複雑さの評価

機能別の見積もり作業

フィーチャー 移行の複雑さ
ドキュメントの読み込み 低レベル
テキスト抽出 低レベル
PDFマージ 低レベル
画像レンダリング 低レベル
HTMLからPDFへ 該当なし(新機能)
セキュリティ/ウォーターマーク 該当なし(新機能)

パラダイムシフト

このMuPDF移行における基本的な変化は、レンダリングのみのビューアから完全な PDF ソリューションへの変化です。

MuPDF:   MuPDFContext → MuPDFDocument → ページ反復 → レンダー/抽出のみ
IronPDF:PdfDocument.FromFile() → フル操作 → 作成/編集/マージ/セキュア

始める前に

前提条件

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

NuGetパッケージの変更

# RemoveMuPDFpackages
dotnet remove package MuPDF.NET
dotnet remove package MuPDFCore
dotnet remove package MuPDFCore.MuPDFWrapper

# Install IronPDF
dotnet add package IronPdf
# RemoveMuPDFpackages
dotnet remove package MuPDF.NET
dotnet remove package MuPDFCore
dotnet remove package MuPDFCore.MuPDFWrapper

# Install IronPDF
dotnet add package IronPdf
SHELL

また、配置からネイティブMuPDFバイナリを削除してください:

  • libmupdf.dylib を削除します
  • プラットフォーム固有のフォルダを削除します (runtimes/*/native/)
  • Dockerファイルを更新してMuPDFのインストールを削除する

ライセンス構成

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

MuPDFの使用法を特定する

# Find allMuPDFreferences
grep -r "MuPDF\|MuPDFCore\|MuPDFDocument" --include="*.cs" .
# Find allMuPDFreferences
grep -r "MuPDF\|MuPDFCore\|MuPDFDocument" --include="*.cs" .
SHELL

完全な API リファレンス

ドキュメントの読み込み

MuPDF IronPDF
new MuPDFDocument(path) PdfDocument.FromFile(path)
new MuPDFDocument(stream) PdfDocument.FromStream(stream)
document.Dispose() pdf.Dispose()

ページへのアクセス

MuPDF IronPDF
document.Pages.Count pdf.PageCount
document.Pages[index] pdf.Pages[index]
page.GetText() page.Text

テキスト抽出

MuPDF IronPDF
document.Pages[i].GetText() をループします pdf.ExtractAllText()

PDF作成 (MuPDFでは利用できません)

MuPDF IronPDF
(サポートされていません) ChromePdfRenderer.RenderHtmlAsPdf(html)
(サポートされていません) ChromePdfRenderer.RenderUrlAsPdf(url)

PDFの操作 (MuPDFでの制限付き)

MuPDF IronPDF
マニュアルページのコピーループ PdfDocument.Merge(pdf1, pdf2)
(サポートされていません) pdf.ApplyWatermark(html)
(サポートされていません) pdf.SecuritySettings

コード移行の例

例 1: HTML から PDF への変換 (MuPDF ではできません)

翻訳前 (MuPDF):

// NuGet: Install-Package MuPDF.NET
using MuPDFCore;
using System.IO;

class Program
{
    static void Main()
    {
        //MuPDFdoesn't supportHTMLからPDFへconversion directly
        // You would need to use another library to convert HTML to a supported format first
        // This is a limitation -MuPDFis primarily a PDF renderer/viewer

        // Alternative: Use a browser engine or intermediate conversion
        string html = "<html><body><h1>Hello World</h1></body></html>";

        // Not natively supported in MuPDF
        throw new NotSupportedException("MuPDF does not support directHTMLからPDFへconversion");
    }
}
// NuGet: Install-Package MuPDF.NET
using MuPDFCore;
using System.IO;

class Program
{
    static void Main()
    {
        //MuPDFdoesn't supportHTMLからPDFへconversion directly
        // You would need to use another library to convert HTML to a supported format first
        // This is a limitation -MuPDFis primarily a PDF renderer/viewer

        // Alternative: Use a browser engine or intermediate conversion
        string html = "<html><body><h1>Hello World</h1></body></html>";

        // Not natively supported in MuPDF
        throw new NotSupportedException("MuPDF does not support directHTMLからPDFへconversion");
    }
}
Imports MuPDFCore
Imports System.IO

Class Program
    Shared Sub Main()
        'MuPDF doesn't support HTMLからPDFへ conversion directly
        ' You would need to use another library to convert HTML to a supported format first
        ' This is a limitation - MuPDF is primarily a PDF renderer/viewer

        ' Alternative: Use a browser engine or intermediate conversion
        Dim html As String = "<html><body><h1>Hello World</h1></body></html>"

        ' Not natively supported in MuPDF
        Throw New NotSupportedException("MuPDF does not support direct HTMLからPDFへ conversion")
    End Sub
End Class
$vbLabelText   $csharpLabel

翻訳後(IronPDF):

// NuGet: Install-Package IronPdf
using IronPdf;

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

        var pdf = renderer.RenderHtmlAsPdf(html);
        pdf.SaveAs("output.pdf");
    }
}
// NuGet: Install-Package IronPdf
using IronPdf;

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

        var pdf = renderer.RenderHtmlAsPdf(html);
        pdf.SaveAs("output.pdf");
    }
}
Imports IronPdf

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

        Dim pdf = renderer.RenderHtmlAsPdf(html)
        pdf.SaveAs("output.pdf")
    End Sub
End Class
$vbLabelText   $csharpLabel

この例では、MuPDFの最も重要な制限である、HTMLをPDFにまったく変換できないことを強調しています。 HTML から PDF への変換はMuPDFが提供する機能ではないため、MuPDF コードは明示的に NotSupportedException をスローします。 MuPDFでこの機能が必要な場合、wkhtmltopdfのような別のライブラリやブラウザエンジンを使用し、その後MuPDFで結果のPDFを読み込んで表示する必要がありました。

IronPDF の ChromePdfRenderer は完全な Chromium エンジンを使用して、完全な CSS3、 JavaScript、および最新の Web 標準のサポートを備えた HTML をレンダリングします。 RenderHtmlAsPdf() メソッドは HTML 文字列を直接受け入れます。 URLレンダリングやHTMLファイル変換を含むその他のレンダリングオプションについては、HTML to PDF documentationを参照してください。

例2: テキスト抽出

翻訳前 (MuPDF):

// NuGet: Install-Package MuPDF.NET
using MuPDFCore;
using System;
using System.Text;

class Program
{
    static void Main()
    {
        using (MuPDFDocument document = new MuPDFDocument("input.pdf"))
        {
            StringBuilder allText = new StringBuilder();

            for (int i = 0; i < document.Pages.Count; i++)
            {
                string pageText = document.Pages[i].GetText();
                allText.AppendLine(pageText);
            }

            Console.WriteLine(allText.ToString());
        }
    }
}
// NuGet: Install-Package MuPDF.NET
using MuPDFCore;
using System;
using System.Text;

class Program
{
    static void Main()
    {
        using (MuPDFDocument document = new MuPDFDocument("input.pdf"))
        {
            StringBuilder allText = new StringBuilder();

            for (int i = 0; i < document.Pages.Count; i++)
            {
                string pageText = document.Pages[i].GetText();
                allText.AppendLine(pageText);
            }

            Console.WriteLine(allText.ToString());
        }
    }
}
Imports MuPDFCore
Imports System
Imports System.Text

Class Program
    Shared Sub Main()
        Using document As New MuPDFDocument("input.pdf")
            Dim allText As New StringBuilder()

            For i As Integer = 0 To document.Pages.Count - 1
                Dim pageText As String = document.Pages(i).GetText()
                allText.AppendLine(pageText)
            Next

            Console.WriteLine(allText.ToString())
        End Using
    End Sub
End Class
$vbLabelText   $csharpLabel

翻訳後(IronPDF):

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

class Program
{
    static void Main()
    {
        var pdf = PdfDocument.FromFile("input.pdf");
        string text = pdf.ExtractAllText();

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

class Program
{
    static void Main()
    {
        var pdf = PdfDocument.FromFile("input.pdf");
        string text = pdf.ExtractAllText();

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

Class Program
    Shared Sub Main()
        Dim pdf = PdfDocument.FromFile("input.pdf")
        Dim text As String = pdf.ExtractAllText()

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

MuPDF アプローチでは、MuPDFDocument を使用して using ブロックを作成し、for ループを使用して document.Pages.Count を手動で反復処理し、ページごとに document.Pages[i].GetText() を呼び出し、StringBuilder を使用してテキストを構築する必要があります。 これは単純なテキスト抽出のための12行のコードです。

IronPDF はこれを 3 行に短縮します。ドキュメントを PdfDocument.FromFile() で読み込み、ExtractAllText() を呼び出し、結果を印刷します。 この単純な操作では、手動の反復処理、StringBuilder、using ブロックによる明示的なリソース管理は必要ありません。 PDF からのテキスト抽出について詳しく学びます。

例3: 複数のPDFをマージする

翻訳前 (MuPDF):

// NuGet: Install-Package MuPDF.NET
using MuPDFCore;
using System.IO;

class Program
{
    static void Main()
    {
        using (MuPDFDocument doc1 = new MuPDFDocument("file1.pdf"))
        using (MuPDFDocument doc2 = new MuPDFDocument("file2.pdf"))
        {
            // Create a new document
            using (MuPDFDocument mergedDoc = MuPDFDocument.Create())
            {
                // Copy pages from first document
                for (int i = 0; i < doc1.Pages.Count; i++)
                {
                    mergedDoc.CopyPage(doc1, i);
                }

                // Copy pages from second document
                for (int i = 0; i < doc2.Pages.Count; i++)
                {
                    mergedDoc.CopyPage(doc2, i);
                }

                mergedDoc.Save("merged.pdf");
            }
        }
    }
}
// NuGet: Install-Package MuPDF.NET
using MuPDFCore;
using System.IO;

class Program
{
    static void Main()
    {
        using (MuPDFDocument doc1 = new MuPDFDocument("file1.pdf"))
        using (MuPDFDocument doc2 = new MuPDFDocument("file2.pdf"))
        {
            // Create a new document
            using (MuPDFDocument mergedDoc = MuPDFDocument.Create())
            {
                // Copy pages from first document
                for (int i = 0; i < doc1.Pages.Count; i++)
                {
                    mergedDoc.CopyPage(doc1, i);
                }

                // Copy pages from second document
                for (int i = 0; i < doc2.Pages.Count; i++)
                {
                    mergedDoc.CopyPage(doc2, i);
                }

                mergedDoc.Save("merged.pdf");
            }
        }
    }
}
Imports MuPDFCore
Imports System.IO

Class Program
    Shared Sub Main()
        Using doc1 As New MuPDFDocument("file1.pdf"),
              doc2 As New MuPDFDocument("file2.pdf")

            ' Create a new document
            Using mergedDoc As MuPDFDocument = MuPDFDocument.Create()
                ' Copy pages from first document
                For i As Integer = 0 To doc1.Pages.Count - 1
                    mergedDoc.CopyPage(doc1, i)
                Next

                ' Copy pages from second document
                For i As Integer = 0 To doc2.Pages.Count - 1
                    mergedDoc.CopyPage(doc2, i)
                Next

                mergedDoc.Save("merged.pdf")
            End Using
        End Using
    End Sub
End Class
$vbLabelText   $csharpLabel

翻訳後(IronPDF):

// NuGet: Install-Package IronPdf
using IronPdf;

class Program
{
    static void Main()
    {
        var pdf1 = PdfDocument.FromFile("file1.pdf");
        var pdf2 = PdfDocument.FromFile("file2.pdf");

        var merged = PdfDocument.Merge(pdf1, pdf2);
        merged.SaveAs("merged.pdf");
    }
}
// NuGet: Install-Package IronPdf
using IronPdf;

class Program
{
    static void Main()
    {
        var pdf1 = PdfDocument.FromFile("file1.pdf");
        var pdf2 = PdfDocument.FromFile("file2.pdf");

        var merged = PdfDocument.Merge(pdf1, pdf2);
        merged.SaveAs("merged.pdf");
    }
}
Imports IronPdf

Class Program
    Shared Sub Main()
        Dim pdf1 = PdfDocument.FromFile("file1.pdf")
        Dim pdf2 = PdfDocument.FromFile("file2.pdf")

        Dim merged = PdfDocument.Merge(pdf1, pdf2)
        merged.SaveAs("merged.pdf")
    End Sub
End Class
$vbLabelText   $csharpLabel

MuPDFのマージ操作は特に冗長です。 両方のソース ドキュメントをネストされた using ブロックで開き、MuPDFDocument.Create() で新しい空のドキュメントを作成し、CopyPage() を呼び出して最初のドキュメントの各ページを反復処理し、CopyPage() を呼び出して 2 番目のドキュメントの各ページを反復処理し、最後に保存する必要があります。 複雑なネストを含む20行以上のコードです。

IronPDF の静的 PdfDocument.Merge() メソッドは複数の PDF ドキュメントを受け入れ、単一の結合されたドキュメントを返します。 作業全体は4行の読みやすいコードです。 多数のドキュメントを結合する場合は、リストを渡すことができます: PdfDocument.Merge(pdfList)。 その他のオプションについては、PDFのマージと分割のドキュメントを参照してください。


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

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

MuPDFにはプラットフォーム固有のネイティブライブラリが必要です。 IronPDFに移行した後、すべてのMuPDFネイティブバイナリを削除してください:

# Delete native libraries
rm -f mupdf*.dll libmupdf*.so libmupdf*.dylib

# Remove runtime folders
rm -rf runtimes/*/native/

# Update Docker files to removeMuPDFinstallation
# Delete native libraries
rm -f mupdf*.dll libmupdf*.so libmupdf*.dylib

# Remove runtime folders
rm -rf runtimes/*/native/

# Update Docker files to removeMuPDFinstallation
SHELL

IronPdfは完全に管理された.NETコードです。プラットフォーム間で管理するネイティブバイナリはありません。

簡略化された Dispose パターン

MuPDFは、明示的なコンテキストと文書管理を必要とします:

// MuPDF: Nested using blocks required
using (MuPDFDocument document = new MuPDFDocument("input.pdf"))
{
    // Work with document
}

// IronPDF: Simpler pattern
var pdf = PdfDocument.FromFile("input.pdf");
// Work with pdf
// MuPDF: Nested using blocks required
using (MuPDFDocument document = new MuPDFDocument("input.pdf"))
{
    // Work with document
}

// IronPDF: Simpler pattern
var pdf = PdfDocument.FromFile("input.pdf");
// Work with pdf
Imports MuPDF

Using document As New MuPDFDocument("input.pdf")
    ' Work with document
End Using

Dim pdf = PdfDocument.FromFile("input.pdf")
' Work with pdf
$vbLabelText   $csharpLabel

ページの反復パターンの変更

MuPDFは、ページ数を明示したインデックスベースの反復を使用します:

// MuPDF
for (int i = 0; i < document.Pages.Count; i++)
{
    var pageText = document.Pages[i].GetText();
}

//IronPDF(foreach supported)
foreach (var page in pdf.Pages)
{
    var pageText = page.Text;
}
// MuPDF
for (int i = 0; i < document.Pages.Count; i++)
{
    var pageText = document.Pages[i].GetText();
}

//IronPDF(foreach supported)
foreach (var page in pdf.Pages)
{
    var pageText = page.Text;
}
' MuPDF
For i As Integer = 0 To document.Pages.Count - 1
    Dim pageText = document.Pages(i).GetText()
Next

' IronPDF (foreach supported)
For Each page In pdf.Pages
    Dim pageText = page.Text
Next
$vbLabelText   $csharpLabel

新しい機能が利用可能です

IronPDFに移行した後は、MuPDFでは提供できない機能を得ることができます:

//PDF作成from HTML (not possible in MuPDF)
var pdf = renderer.RenderHtmlAsPdf("<h1>Hello</h1>");

// Watermarks (not possible in MuPDF)
pdf.ApplyWatermark("<div style='color:red;opacity:0.3;'>DRAFT</div>");

// Password Protection (not possible in MuPDF)
pdf.SecuritySettings.OwnerPassword = "admin";
pdf.SecuritySettings.UserPassword = "user";

// Headers and Footers (not possible in MuPDF)
pdf.AddTextHeader("Document Title");
pdf.AddTextFooter("Page {page} of {total-pages}");
//PDF作成from HTML (not possible in MuPDF)
var pdf = renderer.RenderHtmlAsPdf("<h1>Hello</h1>");

// Watermarks (not possible in MuPDF)
pdf.ApplyWatermark("<div style='color:red;opacity:0.3;'>DRAFT</div>");

// Password Protection (not possible in MuPDF)
pdf.SecuritySettings.OwnerPassword = "admin";
pdf.SecuritySettings.UserPassword = "user";

// Headers and Footers (not possible in MuPDF)
pdf.AddTextHeader("Document Title");
pdf.AddTextFooter("Page {page} of {total-pages}");
' PDF作成from HTML (not possible in MuPDF)
Dim pdf = renderer.RenderHtmlAsPdf("<h1>Hello</h1>")

' Watermarks (not possible in MuPDF)
pdf.ApplyWatermark("<div style='color:red;opacity:0.3;'>DRAFT</div>")

' Password Protection (not possible in MuPDF)
pdf.SecuritySettings.OwnerPassword = "admin"
pdf.SecuritySettings.UserPassword = "user"

' Headers and Footers (not possible in MuPDF)
pdf.AddTextHeader("Document Title")
pdf.AddTextFooter("Page {page} of {total-pages}")
$vbLabelText   $csharpLabel

トラブルシューティング

問題 1: MuPDFDocument が見つかりません

問題: MuPDFDocument クラスがIronPDFに存在しません。

解決策: PdfDocument.FromFile() を使用します。

// MuPDF
using (MuPDFDocument document = new MuPDFDocument("input.pdf"))

// IronPDF
var pdf = PdfDocument.FromFile("input.pdf");
// MuPDF
using (MuPDFDocument document = new MuPDFDocument("input.pdf"))

// IronPDF
var pdf = PdfDocument.FromFile("input.pdf");
Imports MuPDF
Imports IronPDF

Using document As New MuPDFDocument("input.pdf")
End Using

Dim pdf = PdfDocument.FromFile("input.pdf")
$vbLabelText   $csharpLabel

課題2:Pages.Countが見つかりません

問題: document.Pages.Count パターンが機能しません。

解決策: pdf.PageCount を使用します。

// MuPDF
for (int i = 0; i < document.Pages.Count; i++)

// IronPDF
for (int i = 0; i < pdf.PageCount; i++)
// Or use: foreach (var page in pdf.Pages)
// MuPDF
for (int i = 0; i < document.Pages.Count; i++)

// IronPDF
for (int i = 0; i < pdf.PageCount; i++)
// Or use: foreach (var page in pdf.Pages)
' MuPDF
For i As Integer = 0 To document.Pages.Count - 1

' IronPDF
For i As Integer = 0 To pdf.PageCount - 1
' Or use: For Each page In pdf.Pages
$vbLabelText   $csharpLabel

問題 3: GetText() が見つかりません

問題: page.GetText() メソッドが存在しません。

解決策: page.Text プロパティまたは pdf.ExtractAllText() を使用します。

// MuPDF
string pageText = document.Pages[i].GetText();

// IronPDF
string pageText = pdf.Pages[i].Text;
// Or for all text:
string allText = pdf.ExtractAllText();
// MuPDF
string pageText = document.Pages[i].GetText();

// IronPDF
string pageText = pdf.Pages[i].Text;
// Or for all text:
string allText = pdf.ExtractAllText();
' MuPDF
Dim pageText As String = document.Pages(i).GetText()

' IronPDF
Dim pageText As String = pdf.Pages(i).Text
' Or for all text:
Dim allText As String = pdf.ExtractAllText()
$vbLabelText   $csharpLabel

課題4:コピーページが見つかりません

問題:マージ用の手動ページコピーパターン。

解決策:静的 PdfDocument.Merge() を使用します:

// MuPDF
mergedDoc.CopyPage(doc1, i);

// IronPDF
var merged = PdfDocument.Merge(pdf1, pdf2);
// MuPDF
mergedDoc.CopyPage(doc1, i);

// IronPDF
var merged = PdfDocument.Merge(pdf1, pdf2);
' MuPDF
mergedDoc.CopyPage(doc1, i)

' IronPDF
Dim merged = PdfDocument.Merge(pdf1, pdf2)
$vbLabelText   $csharpLabel

移行チェックリスト

移行前

  • コードベース内のすべてのMuPDFの使用状況をインベントリする
  • すべてのレンダリング操作(DPI、スケール係数)を文書化する
  • PDF 作成のニーズを特定する (現在は外部ツールを使用)
  • テキスト抽出要件をリストする
  • ネイティブバイナリ処理のデプロイメントスクリプトを確認する
  • IronPDFライセンスキーを取得する

パッケージの変更

  • MuPDF.NET パッケージを削除します
  • MuPDFCore パッケージを削除します
  • MuPDFCore.MuPDFWrapper パッケージを削除します
  • IronPdf NuGetパッケージをインストールします: dotnet add package IronPdf
  • 名前空間のインポートを更新する

コードの変更

  • 起動時にライセンスキー設定を追加する
  • MuPDFDocumentPdfDocument.FromFile() に置き換えます
  • document.Pages.Countpdf.PageCount に置き換えます
  • page.GetText()page.Text または pdf.ExtractAllText() に置き換えます。
  • 手動の CopyPage ループを PdfDocument.Merge() に置き換えます
  • コンテキスト管理用のネストされた using ブロックを削除します
  • 必要に応じて PDF 作成コードを追加します (HTML から PDF)

移行後

  • プロジェクトからネイティブMuPDFバイナリを削除する
  • Dockerファイルを更新してMuPDFのインストールを削除する
  • プラットフォーム固有のランタイムフォルダを削除する
  • レンダリングされた出力を比較する回帰テストを実行する
  • すべてのターゲットプラットフォーム(Windows、Linux、macOS)でテスト
  • 新しい機能(透かし、セキュリティ、ヘッダー/フッター)の追加を検討する

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

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

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

アイアンサポートチーム

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