푸터 콘텐츠로 바로가기
마이그레이션 가이드

C#에서 MuPDF에서 IronPDF로 마이그레이션하는 방법

MuPDF에서 IronPDF로 마이그레이션해야 하는 이유

MuPDF의 문제점

MuPDF는 강력한 PDF 툴킷이지만, 이중 AGPL/상업용 라이선스(Artifex)와 렌더링 우선 설계로 인해 상업용 HTML 중심 애플리케이션을 구축하는 .NET 개발자들에게 실질적인 마찰을 초래합니다. 두 가지 주요 .NET 래퍼가 존재합니다: MuPDFCore (커뮤니티, arklumpus, AGPL-3.0) 및 MuPDF.NET (Artifex의 공식 C# 바인딩, PyMuPDF를 반영).

  1. AGPL 라이선스 함정: MuPDF와 그 래퍼는 기본적으로 AGPL-3.0으로 제공됩니다. AGPL 코드를 사용하여 클로즈드 소스 제품을 배포하려면 AGPL로 오픈 소싱하거나 Artifex에서 상업용 라이센스를 구매해야 합니다(가격은 견적 기반, 공개 안 됨).

  2. 렌더링 우선 집중: MuPDF.NET 병합, 수정, 서명 및 워터마크를 삽입할 수 있지만(Pymupdf를 반영) 대부분의 API와 도구는 보기와 구조화된 텍스트 추출에 중점을 두고 있으며, HTML 중심의 문서 생성에는 중점을 두고 있지 않습니다.

  3. HTML-PDF 엔진 없음: MuPDF.NET이나 MuPDFCore 중 어느 것도 HTML/CSS 엔진을 제공하지 않습니다. HTML에서 PDF를 생성하려면 별도의 브라우저 엔진(Chromeium, wkhtmltopdf, PrinceXML)을 호출해야 합니다.

  4. 네이티브 종속성: 두 래퍼 모두 MuPDFCore.NativeAssets / MuPDF.NativeAssets 패키지를 per-RID 바이너리(win-x64, linux-x64, osx-x64)와 함께 제공합니다. 크로스 플랫폼 배포가 가능하지만 Docker 이미지에는 일치하는 네이티브 패키지와 기본 이미지(glibc 대 musl)가 필요합니다.

  5. HTML 워터마크/머리글/쿠리글 없음: 삽입 작업은 페이지별 이미지 및 텍스트 기반입니다; Chromium 기반 렌더러에서 노출하는 방식으로 {page}/{total-pages} 템플릿 엔진은 없습니다.

  6. C 상호운용성 표면: 래퍼는 C 라이브러리에 매핑되는 컨텍스트/문서 수명을 노출하며, 폐기 순서가 중요하고 네이티브 충돌은 전체 프로세스를 중단시킬 수 있으며, 큰 문서에 대한 마샬링 비용은 상당합니다.

MuPDF와IronPDF비교

기능 MuPDF IronPDF
라이선스 AGPL-3.0 또는 견적 기반 상업용 (Artifex) 공개된 가격정보를 따름 상업용
주된 초점 렌더링, 구조적 텍스트, 저레벨 툴킷 HTML 중심의 생성 + 조작
HTML to PDF 지원하지 않음 (HTML 엔진 없음) 전체 Chromium 엔진
PDF 생성 페이지 수준으로만 (텍스트/이미지/벡터 삽입) HTML, URL, 이미지
PDF 조작 MuPDF.NET에서 지원됨 (InsertPdf, Select, DeletePage) 지원됨 (Merge, CopyPages, RemovePages)
종속성 네이티브MuPDF+ RID 네이티브 자산 관리 래퍼 + 번들된 Chromium
플랫폼 지원 윈/리눅스/macOS 토종자산 활용 윈/리눅스/macOS/Docker
비동기 지원 대부분 동기적; MuPDFCore에서 몇 개의 비동기적 기능 렌더러와 문서 전체에 비동기 API
.NET 통합 C 라이브러리를 둘러싸는 P/Invoke 래퍼 .NET 래퍼 + 네이티브 Chromium

IronPDF는 네이티브 상호작용 복잡성 없이 최신 .NET 버전 전역에서 관리되는 .NET 라이브러리로 실행됩니다.


마이그레이션 복잡성 평가

기능별 예상 노력

기능 마이그레이션 복잡성
문서 로딩 매우 낮음
텍스트 추출 매우 낮음
PDF 병합 낮음
이미지 렌더링 낮음
HTML to PDF N/A (새로운 기능)
보안/워터마크 N/A (새로운 기능)

패러다임 전환

이MuPDF마이그레이션에 있어서의 근본적인 변화는 렌더링 전용 뷰어에서 완전한 PDF 솔루션:으로 입니다.

MuPDF.NET:  Document → doc[i] → GetText / GetPixmap / InsertPdf
MuPDFCore: MuPDFContext → MuPDFDocument → 페이지[i] → 렌더/이미지저장
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.com에서 라이선스 키를 획득하세요

NuGet 패키지 변경 사항

# RemoveMuPDFpackages (whichever wrapper you used)
dotnet remove package MuPDF.NET
dotnet remove package MuPDFCore
dotnet remove package MuPDFCore.NativeAssets.Linux
dotnet remove package MuPDFCore.NativeAssets.MacOS
dotnet remove package MuPDFCore.NativeAssets.Windows
dotnet remove package MuPDF.NativeAssets

# Install IronPDF
dotnet add package IronPdf
# RemoveMuPDFpackages (whichever wrapper you used)
dotnet remove package MuPDF.NET
dotnet remove package MuPDFCore
dotnet remove package MuPDFCore.NativeAssets.Linux
dotnet remove package MuPDFCore.NativeAssets.MacOS
dotnet remove package MuPDFCore.NativeAssets.Windows
dotnet remove package MuPDF.NativeAssets

# Install IronPDF
dotnet add package IronPdf
SHELL

배포에서 네이티브MuPDF바이너리도 제거하세요:

  • mupdf.dll, libmupdf.so, 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 Document(path) (MuPDF.NET) / new MuPDFDocument(ctx, path) (MuPDFCore) PdfDocument.FromFile(path)
new Document("pdf", stream) (MuPDF.NET) PdfDocument.FromStream(stream)
doc.Close() / Dispose() pdf.Dispose()

페이지 액세스

MuPDF IronPDF
doc.PageCount (MuPDF.NET) / document.Pages.Count (MuPDFCore) pdf.PageCount
doc[index] (MuPDF.NET) / document.Pages[index] (MuPDFCore) pdf.Pages[index]
doc[i].GetText() / structured-text 반복 (MuPDFCore) page.Text

텍스트 추출

MuPDF IronPDF
루프 반복 doc[i].GetText() pdf.ExtractAllText()

PDF 생성 (MuPDF에서 사용 불가)

MuPDF IronPDF
(HTML 엔진 아님) ChromePdfRenderer.RenderHtmlAsPdf(html)
(HTML 엔진 아님) ChromePdfRenderer.RenderUrlAsPdf(url)

PDF 조작

MuPDF IronPDF
docA.InsertPdf(docB) (MuPDF.NET) PdfDocument.Merge(pdf1, pdf2)
페이지 당 page.InsertImage(...) (이미지/텍스트 도장만) pdf.ApplyWatermark(html)
doc.Save(path, encryption: ..., ownerPw: ..., userPw: ...) 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 to PDFconversion 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 to PDFconversion");
    }
}
// NuGet: Install-Package MuPDF.NET
using MuPDFCore;
using System.IO;

class Program
{
    static void Main()
    {
        //MuPDFdoesn't supportHTML to PDFconversion 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 to PDFconversion");
    }
}
Imports MuPDFCore
Imports System.IO

Class Program
    Shared Sub Main()
        'MuPDF doesn't support HTML to 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 to 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로 전혀 변환할 수 없습니다.MuPDF코드는 HTML-to-PDF 변환이 MuPDF에서 제공하지 않는 기능이기 때문에 NotSupportedException을 명시적으로 던집니다. MuPDF에 이 기능이 필요했다면, wkhtmltopdf와 같은 별도의 라이브러리 또는 브라우저 엔진을 사용하고, 결과 PDF를 MuPDF로 로드하여 시청해야 했습니다.

IronPDF의 ChromePdfRenderer은 전체 CSS3, JavaScript 및 최신 웹 표준 지원을 통해 HTML을 렌더링하는 전체 Chromium 엔진을 사용합니다. RenderHtmlAsPdf() 메서드는 HTML 문자열을 직접 허용합니다. URL 렌더링 및 HTML 파일 변환 포함 추가 렌더링 옵션에 대해서는 HTML에서 PDF로 문서를 참조하십시오.

예제 2: 텍스트 추출

이전 (MuPDF):

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

class Program
{
    static void Main()
    {
        Document doc = new Document("input.pdf");

        StringBuilder allText = new StringBuilder();

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

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

class Program
{
    static void Main()
    {
        Document doc = new Document("input.pdf");

        StringBuilder allText = new StringBuilder();

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

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

Module Program
    Sub Main()
        Dim doc As New Document("input.pdf")

        Dim allText As New StringBuilder()

        For i As Integer = 0 To doc.PageCount - 1
            Dim pageText As String = doc(i).GetText()
            allText.AppendLine(pageText)
        Next

        Console.WriteLine(allText.ToString())
    End Sub
End Module
$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.NET 접근 방식은 Document을 열고, for 루프를 사용하여 doc.PageCount을 반복 처리하고, 각 페이지에 대해 doc[i].GetText()을 호출하며, StringBuilder을 사용하여 텍스트를 빌드합니다.

IronPDF은 이를 세 줄로 줄입니다: 문서를 PdfDocument.FromFile()와 함께 로드하고, ExtractAllText()를 호출하고, 결과를 출력합니다. 수동 반복 없음, StringBuilder 없음. PDF에서 텍스트 추출에 대해 더 알아보기.

예제 3: 여러 PDFs 병합하기

이전 (MuPDF):

// NuGet: Install-Package MuPDF.NET
using MuPDF.NET;

class Program
{
    static void Main()
    {
        Document doc1 = new Document("file1.pdf");
        Document doc2 = new Document("file2.pdf");

        // Append every page of doc2 to the end of doc1.
        doc1.InsertPdf(doc2);

        doc1.Save("merged.pdf");
    }
}
// NuGet: Install-Package MuPDF.NET
using MuPDF.NET;

class Program
{
    static void Main()
    {
        Document doc1 = new Document("file1.pdf");
        Document doc2 = new Document("file2.pdf");

        // Append every page of doc2 to the end of doc1.
        doc1.InsertPdf(doc2);

        doc1.Save("merged.pdf");
    }
}
Imports MuPDF.NET

Class Program
    Shared Sub Main()
        Dim doc1 As New Document("file1.pdf")
        Dim doc2 As New Document("file2.pdf")

        ' Append every page of doc2 to the end of doc1.
        doc1.InsertPdf(doc2)

        doc1.Save("merged.pdf")
    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.NET은 PyMuPDF의 insert_pdf()를 반영하여 Document.InsertPdf을 통해 병합을 지원하며, 한 문서의 모든 페이지를 다른 문서에 제자리에서 추가합니다. MuPDFCore는 이에 상응하는 고수준 병합 API를 제공하지 않습니다.

IronPDF의 정적 PdfDocument.Merge() 메서드는 여러 PDF 문서를 받아 하나의 병합된 문서를 반환하며, 입력된 문서는 그대로 둡니다. 많은 문서를 병합하려면 목록: 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 패턴 간소화

MuPDFCore는 명시적인 MuPDFContext가 필요합니다; MuPDF.NET은 이를 숨기지만 여전히 Close() / Dispose()가 필요합니다:

// MuPDFCore: explicit context required
using (var context = new MuPDFContext())
using (var document = new MuPDFDocument(context, "input.pdf"))
{
    // Work with document
}

// MuPDF.NET: implicit context, manual close
Document doc = new Document("input.pdf");
try { /* work */ } finally { doc.Close(); }

// IronPDF: simpler pattern
var pdf = PdfDocument.FromFile("input.pdf");
// Work with pdf
// MuPDFCore: explicit context required
using (var context = new MuPDFContext())
using (var document = new MuPDFDocument(context, "input.pdf"))
{
    // Work with document
}

// MuPDF.NET: implicit context, manual close
Document doc = new Document("input.pdf");
try { /* work */ } finally { doc.Close(); }

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

' MuPDFCore: explicit context required
Using context As New MuPDFContext()
    Using document As New MuPDFDocument(context, "input.pdf")
        ' Work with document
    End Using
End Using

' MuPDF.NET: implicit context, manual close
Dim doc As New Document("input.pdf")
Try
    ' work
Finally
    doc.Close()
End Try

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

페이지 반복 패턴 변경

MuPDF는 명시적인 페이지 수를 포함한 인덱스 기반 반복을 사용합니다:

// MuPDF.NET
for (int i = 0; i < doc.PageCount; i++)
{
    var pageText = doc[i].GetText();
}

// MuPDFCore
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.NET
for (int i = 0; i < doc.PageCount; i++)
{
    var pageText = doc[i].GetText();
}

// MuPDFCore
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;
}
Imports MuPDF.NET
Imports MuPDFCore
Imports IronPDF

' MuPDF.NET
For i As Integer = 0 To doc.PageCount - 1
    Dim pageText = doc(i).GetText()
Next

' MuPDFCore
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 (no HTML header/footer template in MuPDF)
var renderer = new ChromePdfRenderer();
renderer.RenderingOptions.HtmlHeader = new HtmlHeaderFooter
{
    HtmlFragment = "<div style='text-align:center;'>Document Title</div>",
    MaxHeight = 25
};
renderer.RenderingOptions.HtmlFooter = new HtmlHeaderFooter
{
    HtmlFragment = "<div style='text-align:center;'>Page {page} of {total-pages}</div>",
    MaxHeight = 25
};
//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 (no HTML header/footer template in MuPDF)
var renderer = new ChromePdfRenderer();
renderer.RenderingOptions.HtmlHeader = new HtmlHeaderFooter
{
    HtmlFragment = "<div style='text-align:center;'>Document Title</div>",
    MaxHeight = 25
};
renderer.RenderingOptions.HtmlFooter = new HtmlHeaderFooter
{
    HtmlFragment = "<div style='text-align:center;'>Page {page} of {total-pages}</div>",
    MaxHeight = 25
};
Imports System

' 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 (no HTML header/footer template in MuPDF)
Dim renderer As New ChromePdfRenderer()
renderer.RenderingOptions.HtmlHeader = New HtmlHeaderFooter With {
    .HtmlFragment = "<div style='text-align:center;'>Document Title</div>",
    .MaxHeight = 25
}
renderer.RenderingOptions.HtmlFooter = New HtmlHeaderFooter With {
    .HtmlFragment = "<div style='text-align:center;'>Page {page} of {total-pages}</div>",
    .MaxHeight = 25
}
$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: 찾기 누락된 InsertPdf

문제: MuPDF.NET의 Document.InsertPdf (PyMuPDF의 insert_pdf를 반영)는 IronPDF에 직접 해당하는 이름이 없으며, MuPDFCore는 고급 병합을 전혀 노출하지 않습니다.

해결책: 정적 PdfDocument.Merge() 사용:

// MuPDF.NET
docA.InsertPdf(docB);

// IronPDF
var merged = PdfDocument.Merge(pdf1, pdf2);
// MuPDF.NET
docA.InsertPdf(docB);

// IronPDF
var merged = PdfDocument.Merge(pdf1, pdf2);
$vbLabelText   $csharpLabel

마이그레이션 체크리스트

사전 마이그레이션

  • 코드베이스 내MuPDF사용 전부 목록화
  • 모든 렌더링 작업 문서화 (DPI, 스케일 팩터)
  • PDF 생성 요구 사항 식별 (현재 외부 도구 사용)
  • 텍스트 추출 요구 사항 목록화
  • 네이티브 바이너리 처리를 위한 배포 스크립트 검토 -IronPDF라이센스 키를 받으세요

패키지 변경 사항

  • MuPDF.NET 패키지 제거
  • MuPDFCore 패키지 제거
  • MuPDFCore.NativeAssets.* / MuPDF.NativeAssets 패키지 제거
  • IronPdf NuGet Install-Package: dotnet add package IronPdf
  • 네임스페이스 가져오기 업데이트

코드 변경 사항

  • 시작 시 라이선스 키 구성 추가
  • Document (MuPDF.NET) / MuPDFDocument (MuPDFCore)를 PdfDocument.FromFile()로 교체
  • doc.PageCount / document.Pages.Countpdf.PageCount으로 교체
  • doc[i].GetText()page.Text 또는 pdf.ExtractAllText()로 교체
  • Document.InsertPdf 호출을 PdfDocument.Merge()로 교체
  • 명시적 컨텍스트/폐기 보일러플레이트 제거
  • 필요한 경우 PDF 생성 코드 추가 (HTML to PDF)

마이그레이션 이후

  • 프로젝트에서 네이티브MuPDF바이너리 제거
  • Docker 파일을 업데이트하여MuPDF설치 제거
  • 플랫폼 특유의 런타임 폴더 제거
  • 렌더링된 출력 비교 회귀 테스트 실행
  • 모든 대상 플랫폼(Windows, Linux, macOS)에서 테스트
  • 새로운 기능 추가 고려(워터마크, 보안, 헤더/푸터)

참고해 주세요MuPDF, MuPDF.NET 및 wkhtmltopdf는 각자의 소유자에 의해 등록된 상표입니다. 이 사이트는 Artifex Software 또는 wkhtmltopdf와 관계가 없으며, 해당 회사의 승인을 받지 않았습니다. 모든 제품명, 로고 및 브랜드는 해당 소유자의 자산입니다. 비교는 정보 제공 목적으로만 사용되며, 작성 시점에 공개적으로 이용 가능한 정보를 반영합니다.

Curtis Chau
기술 문서 작성자

커티스 차우는 칼턴 대학교에서 컴퓨터 과학 학사 학위를 취득했으며, Node.js, TypeScript, JavaScript, React를 전문으로 하는 프론트엔드 개발자입니다. 직관적이고 미적으로 뛰어난 사용자 인터페이스를 만드는 데 열정을 가진 그는 최신 프레임워크를 활용하고, 잘 구성되고 시각적으로 매력적인 매뉴얼을 제작하는 것을 즐깁니다.

커티스는 개발 분야 외에도 사물 인터넷(IoT)에 깊은 관심을 가지고 있으며, 하드웨어와 소프트웨어를 통합하는 혁신적인 방법을 연구합니다. 여가 시간에는 게임을 즐기거나 디스코드 봇을 만들면서 기술에 대한 애정과 창의성을 결합합니다.

아이언 서포트 팀

저희는 주 5일, 24시간 온라인으로 운영합니다.
채팅
이메일
전화해