C#でGnostice PDFOneからIronPDFに移行する方法
Gnostice PDFOneからIronPDFへの移行は、あなた for .NET PDFワークフローを、座標ベースの、プラットフォームが分断されたアプローチから、最新のWeb標準を完全にサポートした、統一されたHTML/CSS駆動のソリューションに変えます。 このガイドでは、.NET開発者のために、CSS、JavaScript、メモリの安定性に関する文書化された制限を排除する、包括的で段階的な移行パスを提供します。
なぜGnostice PDFOneからIronPDFへ移行するのか
グノスティスのPDFOneチャレンジ
Gnostice PDFOneとDocument Studio .NETには、本番アプリケーションに影響する制限事項が十分に文書化されています:
1.外部 CSS のサポートなし:グノスティスPDFOneのドキュメントには、最新の Web から PDF への変換の基本要件である外部 CSS スタイルシートをサポートしていないことが明記されています。
-
JavaScript の実行なし: JavaScriptを必要とする動的コンテンツをレンダリングできないため、最新の Web アプリケーションを正確に変換することができません。
- HTML から PDF への直接変換機能はありません:グノスティスPDFOneには、HTML から PDF への直接変換機能はありません。 HTMLの変換にはDocument Studioを使用するか、手作業でHTML要素を解析してレンダリングする必要があります。
4.プラットフォームの断片化: WinForms、WPF、 ASP.NET、Xamarin 向けにそれぞれ異なる機能セットと API を持つ個別の製品が存在するため、複数のライセンスとコードベースが必要になる場合があります。
5.メモリ リークと安定性:ユーザー フォーラムと Stack Overflow では、画像の処理時に永続的なメモリ リーク、JPEG エラー #53、および StackOverflow 例外が発生することが報告されています。
6.右から左に書く Unicode がない:アラビア語、ヘブライ語、その他の RTL 言語は明示的にサポートされていません。これは、国際的なアプリケーションにとっては致命的です。
7.限定的なデジタル署名のサポート:これまで、Gnostice PDFOne ではデジタル署名が欠落しているか、信頼できませんでした。
8.座標ベースの API:多くの操作では、最新のレイアウト手法ではなく手動の X/Y 配置が必要であり、すべての要素の配置に対して正確な計算が必要です。
グノスティスPDFOneとIronPDFの比較
| アスペクト | グノスティスPDFOne | IronPDF |
|---|---|---|
| 外部CSS | サポートされていません | サポート対象 |
| JavaScriptの実行 | サポートされていません | フルChromiumエンジン |
| RTL言語 | サポートされていません | ユニコード完全対応 |
| デジタル署名 | 限定/欠落 | X509完全サポート |
| プラットフォーム | 断片化された製品 | 単一の統一ライブラリ |
| メモリの安定性 | 報告された問題 | 安定した管理体制 |
| HTMLからPDFへ | 基本的なこと、回避策が必要なこと | Chrome品質のレンダリング |
| 学習曲線 | 複雑なAPI | シンプルで直感的なAPI |
| モダンCSS(フレックスボックス、グリッド) | サポートされていません | CSS3をフルサポート |
| 画像処理 | 既知の問題 | 信頼性 |
2025年、2026年まで.NET 10とC# 14の採用を計画しているチームにとって、IronPDFはすべて for .NETプラットフォームで一貫して動作する統一されたライブラリで将来を見据えた基盤を提供します。
マイグレーションの複雑さの評価
機能別の見積もり作業
| フィーチャー | 移行の複雑さ |
|---|---|
| PDFの読み込み/保存 | 低レベル |
| PDFのマージ | 低レベル |
| PDFの分割 | 低レベル |
| テキスト抽出 | 低レベル |
| 透かし | 低レベル |
| ヘッダー/フッター | 低レベル |
| HTMLからPDFへ | 低レベル |
| 暗号化 | 中規模 |
| フォームフィールド | 中規模 |
| デジタル署名 | 低レベル |
得られる機能
Gnostice PDFOneからIronPdfに移行する際、以前は不可能だったこれらの機能が利用可能になります:
- 外部CSSスタイルシート
- JavaScriptの実行
- RTL言語サポート(アラビア語、ヘブライ語)
- CSSグリッドとフレックスボックス
- 信頼性の高いデジタル署名
- より良いメモリ管理
- 単一のコードベースによるクロスプラットフォームのサポート
始める前に
前提条件
- .NETバージョン: IronPDFは.NET Framework 4.6.2以降および.NET Core 2.0以降 / .NET 5/6/7/8/9以降をサポートしています。 2.ライセンスキー: IronPDFからIronPDFライセンスキーを取得します。 3.バックアップ:移行作業用のブランチを作成する
すべてのGnostice PDFOneの使用法を特定する
# Find all Gnostice references
grep -r "Gnostice\|PDFOne\|PDFDocument\|PDFPage\|DocExporter" --include="*.cs" .
# Find package references
grep -r "Gnostice\|PDFOne" --include="*.csproj" .
# Find all Gnostice references
grep -r "Gnostice\|PDFOne\|PDFDocument\|PDFPage\|DocExporter" --include="*.cs" .
# Find package references
grep -r "Gnostice\|PDFOne" --include="*.csproj" .
NuGetパッケージの変更
# RemoveグノスティスPDFOnepackages
dotnet remove package PDFOne.NET
dotnet remove package Gnostice.DocumentStudio.NET
dotnet remove package Gnostice.PDFOne.NET
dotnet remove package Gnostice.XtremeDocumentStudio.NET
# Install IronPDF
dotnet add package IronPdf
# RemoveグノスティスPDFOnepackages
dotnet remove package PDFOne.NET
dotnet remove package Gnostice.DocumentStudio.NET
dotnet remove package Gnostice.PDFOne.NET
dotnet remove package Gnostice.XtremeDocumentStudio.NET
# Install IronPDF
dotnet add package IronPdf
クイック スタート マイグレーション
ステップ 1: ライセンス構成の更新
ビフォア(グノスティスPDFOne):。
// Gnostice license often set via config or property
PDFOne.License.LicenseKey = "YOUR-GNOSTICE-LICENSE";
// Gnostice license often set via config or property
PDFOne.License.LicenseKey = "YOUR-GNOSTICE-LICENSE";
' Gnostice license often set via config or property
PDFOne.License.LicenseKey = "YOUR-GNOSTICE-LICENSE"
翻訳後(IronPDF):。
// Set once at application startup
IronPdf.License.LicenseKey = "YOUR-IRONPDF-LICENSE-KEY";
// Or in appsettings.json:
// { "IronPdf.License.LicenseKey": "YOUR-LICENSE-KEY" }
// Set once at application startup
IronPdf.License.LicenseKey = "YOUR-IRONPDF-LICENSE-KEY";
// Or in appsettings.json:
// { "IronPdf.License.LicenseKey": "YOUR-LICENSE-KEY" }
' Set once at application startup
IronPdf.License.LicenseKey = "YOUR-IRONPDF-LICENSE-KEY"
' Or in appsettings.json:
' { "IronPdf.License.LicenseKey": "YOUR-LICENSE-KEY" }
ステップ 2: 名前空間インポートを更新する
// Before (Gnostice PDFOne)
using Gnostice.PDFOne;
using Gnostice.PDFOne.Document;
using Gnostice.PDFOne.Graphics;
// After (IronPDF)
using IronPdf;
using IronPdf.Editing;
// Before (Gnostice PDFOne)
using Gnostice.PDFOne;
using Gnostice.PDFOne.Document;
using Gnostice.PDFOne.Graphics;
// After (IronPDF)
using IronPdf;
using IronPdf.Editing;
Imports IronPdf
Imports IronPdf.Editing
完全な API リファレンス
コア クラス マッピング
| グノスティスPDFOne | IronPDF | 翻訳内容 |
|---|---|---|
PDFDocument |
PdfDocument |
主なPDF文書クラス |
PDFPage |
PdfDocument.Pages[i] |
ページ表現 |
PDFFont |
CSSスタイリング | フォント仕様 |
PDFTextElement |
HTMLコンテンツ | テキスト内容 |
PDFImageElement |
HTML <img> タグ |
画像コンテンツ |
DocExporter |
ChromePdfRenderer |
HTML/URLからPDFへの変換 |
ドキュメント操作
| グノスティスPDFOne | IronPDF |
|---|---|
new PDFDocument() |
new PdfDocument() |
doc.Load(path) |
PdfDocument.FromFile(path) |
doc.Open() |
該当なし(自動) |
doc.Save(path) |
pdf.SaveAs(path) |
doc.Close() |
pdf.Dispose() |
doc.Pages.Count |
pdf.PageCount |
doc.Pages.Add() |
HTMLのレンダリングまたはマージ |
マージ操作
| グノスティスPDFOne | IronPDF |
|---|---|
doc.Append(otherDoc) |
PdfDocument.Merge(pdf1, pdf2) |
複数のAppend()呼び出し |
PdfDocument.Merge(list) |
コード移行の例
例1: HTMLからPDFへの変換
ビフォア(グノスティスPDFOne):。
// NuGet: Install-Package Gnostice.PDFOne.DLL
using Gnostice.PDFOne;
using Gnostice.PDFOne.Graphics;
using System;
class Program
{
static void Main()
{
PDFDocument doc = new PDFDocument();
doc.Open();
PDFPage page = doc.Pages.Add();
// PDFOne doesn't have directHTMLからPDFへconversion
// You need to use Document Studio for HTML conversion
// Or manually parse and render HTML elements
PDFTextElement textElement = new PDFTextElement();
textElement.Text = "Simple text conversion instead of HTML";
textElement.Draw(page, 10, 10);
doc.Save("output.pdf");
doc.Close();
}
}
// NuGet: Install-Package Gnostice.PDFOne.DLL
using Gnostice.PDFOne;
using Gnostice.PDFOne.Graphics;
using System;
class Program
{
static void Main()
{
PDFDocument doc = new PDFDocument();
doc.Open();
PDFPage page = doc.Pages.Add();
// PDFOne doesn't have directHTMLからPDFへconversion
// You need to use Document Studio for HTML conversion
// Or manually parse and render HTML elements
PDFTextElement textElement = new PDFTextElement();
textElement.Text = "Simple text conversion instead of HTML";
textElement.Draw(page, 10, 10);
doc.Save("output.pdf");
doc.Close();
}
}
Imports Gnostice.PDFOne
Imports Gnostice.PDFOne.Graphics
Imports System
Module Program
Sub Main()
Dim doc As New PDFDocument()
doc.Open()
Dim page As PDFPage = doc.Pages.Add()
' PDFOne doesn't have direct HTML to PDF conversion
' You need to use Document Studio for HTML conversion
' Or manually parse and render HTML elements
Dim textElement As New PDFTextElement()
textElement.Text = "Simple text conversion instead of HTML"
textElement.Draw(page, 10, 10)
doc.Save("output.pdf")
doc.Close()
End Sub
End Module
翻訳後(IronPDF):。
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class Program
{
static void Main()
{
var renderer = new ChromePdfRenderer();
string html = "<h1>Hello World</h1><p>This is HTML content.</p>";
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("output.pdf");
}
}
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
class Program
{
static void Main()
{
var renderer = new ChromePdfRenderer();
string html = "<h1>Hello World</h1><p>This is HTML content.</p>";
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("output.pdf");
}
}
Imports IronPdf
Imports System
Class Program
Shared Sub Main()
Dim renderer = New ChromePdfRenderer()
Dim html As String = "<h1>Hello World</h1><p>This is HTML content.</p>"
Dim pdf = renderer.RenderHtmlAsPdf(html)
pdf.SaveAs("output.pdf")
End Sub
End Class
その差は相当なものです:Gnostice PDFOneは、HTMLを直接PDFに変換することはできません。手作業でテキスト要素を作成し、座標で配置する必要があります。IronPDFの ChromePdfRenderer は、完全な CSS3 およびJavaScriptサポートによる直接的な HTML レンダリングを提供します。 レンダリングオプションについては、HTML to PDF documentationを参照してください。
例2: PDFファイルをマージする
ビフォア(グノスティスPDFOne):。
// NuGet: Install-Package Gnostice.PDFOne.DLL
using Gnostice.PDFOne;
using Gnostice.PDFOne.Document;
using System;
class Program
{
static void Main()
{
PDFDocument doc1 = new PDFDocument();
doc1.Load("document1.pdf");
PDFDocument doc2 = new PDFDocument();
doc2.Load("document2.pdf");
PDFDocument mergedDoc = new PDFDocument();
mergedDoc.Open();
mergedDoc.Append(doc1);
mergedDoc.Append(doc2);
mergedDoc.Save("merged.pdf");
doc1.Close();
doc2.Close();
mergedDoc.Close();
}
}
// NuGet: Install-Package Gnostice.PDFOne.DLL
using Gnostice.PDFOne;
using Gnostice.PDFOne.Document;
using System;
class Program
{
static void Main()
{
PDFDocument doc1 = new PDFDocument();
doc1.Load("document1.pdf");
PDFDocument doc2 = new PDFDocument();
doc2.Load("document2.pdf");
PDFDocument mergedDoc = new PDFDocument();
mergedDoc.Open();
mergedDoc.Append(doc1);
mergedDoc.Append(doc2);
mergedDoc.Save("merged.pdf");
doc1.Close();
doc2.Close();
mergedDoc.Close();
}
}
Imports Gnostice.PDFOne
Imports Gnostice.PDFOne.Document
Imports System
Module Program
Sub Main()
Dim doc1 As New PDFDocument()
doc1.Load("document1.pdf")
Dim doc2 As New PDFDocument()
doc2.Load("document2.pdf")
Dim mergedDoc As New PDFDocument()
mergedDoc.Open()
mergedDoc.Append(doc1)
mergedDoc.Append(doc2)
mergedDoc.Save("merged.pdf")
doc1.Close()
doc2.Close()
mergedDoc.Close()
End Sub
End Module
翻訳後(IronPDF):。
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
using System.Collections.Generic;
class Program
{
static void Main()
{
var pdf1 = PdfDocument.FromFile("document1.pdf");
var pdf2 = PdfDocument.FromFile("document2.pdf");
var merged = PdfDocument.Merge(pdf1, pdf2);
merged.SaveAs("merged.pdf");
}
}
// NuGet: Install-Package IronPdf
using IronPdf;
using System;
using System.Collections.Generic;
class Program
{
static void Main()
{
var pdf1 = PdfDocument.FromFile("document1.pdf");
var pdf2 = PdfDocument.FromFile("document2.pdf");
var merged = PdfDocument.Merge(pdf1, pdf2);
merged.SaveAs("merged.pdf");
}
}
Imports IronPdf
Imports System
Imports System.Collections.Generic
Module Program
Sub Main()
Dim pdf1 = PdfDocument.FromFile("document1.pdf")
Dim pdf2 = PdfDocument.FromFile("document2.pdf")
Dim merged = PdfDocument.Merge(pdf1, pdf2)
merged.SaveAs("merged.pdf")
End Sub
End Module
Gnostice PDFOneのアプローチでは、新しい文書を作成し、それを開き、ソース文書を別々に読み込み、それぞれを追加し、3つの文書すべてを手動で閉じる必要があります。IronPDFの静的 Merge メソッドは、適切なリソース管理を使用してこれを 3 行で処理します。 PDFのマージと分割については、こちらをご覧ください。
例3: PDFに透かしを追加する
ビフォア(グノスティスPDFOne):。
// NuGet: Install-Package Gnostice.PDFOne.DLL
using Gnostice.PDFOne;
using Gnostice.PDFOne.Graphics;
using System;
using System.Drawing;
class Program
{
static void Main()
{
PDFDocument doc = new PDFDocument();
doc.Load("input.pdf");
PDFFont font = new PDFFont(PDFStandardFont.Helvetica, 48);
foreach (PDFPage page in doc.Pages)
{
PDFTextElement watermark = new PDFTextElement();
watermark.Text = "CONFIDENTIAL";
watermark.Font = font;
watermark.Color = Color.FromArgb(128, 255, 0, 0);
watermark.RotationAngle = 45;
watermark.Draw(page, 200, 400);
}
doc.Save("watermarked.pdf");
doc.Close();
}
}
// NuGet: Install-Package Gnostice.PDFOne.DLL
using Gnostice.PDFOne;
using Gnostice.PDFOne.Graphics;
using System;
using System.Drawing;
class Program
{
static void Main()
{
PDFDocument doc = new PDFDocument();
doc.Load("input.pdf");
PDFFont font = new PDFFont(PDFStandardFont.Helvetica, 48);
foreach (PDFPage page in doc.Pages)
{
PDFTextElement watermark = new PDFTextElement();
watermark.Text = "CONFIDENTIAL";
watermark.Font = font;
watermark.Color = Color.FromArgb(128, 255, 0, 0);
watermark.RotationAngle = 45;
watermark.Draw(page, 200, 400);
}
doc.Save("watermarked.pdf");
doc.Close();
}
}
Imports Gnostice.PDFOne
Imports Gnostice.PDFOne.Graphics
Imports System
Imports System.Drawing
Module Program
Sub Main()
Dim doc As New PDFDocument()
doc.Load("input.pdf")
Dim font As New PDFFont(PDFStandardFont.Helvetica, 48)
For Each page As PDFPage In doc.Pages
Dim watermark As New PDFTextElement()
watermark.Text = "CONFIDENTIAL"
watermark.Font = font
watermark.Color = Color.FromArgb(128, 255, 0, 0)
watermark.RotationAngle = 45
watermark.Draw(page, 200, 400)
Next
doc.Save("watermarked.pdf")
doc.Close()
End Sub
End Module
翻訳後(IronPDF):。
// NuGet: Install-Package IronPdf
using IronPdf;
using IronPdf.Editing;
using System;
class Program
{
static void Main()
{
var pdf = PdfDocument.FromFile("input.pdf");
var watermark = new TextStamper()
{
Text = "CONFIDENTIAL",
FontSize = 48,
Opacity = 50,
Rotation = 45,
VerticalAlignment = VerticalAlignment.Middle,
HorizontalAlignment = HorizontalAlignment.Center
};
pdf.ApplyStamp(watermark);
pdf.SaveAs("watermarked.pdf");
}
}
// NuGet: Install-Package IronPdf
using IronPdf;
using IronPdf.Editing;
using System;
class Program
{
static void Main()
{
var pdf = PdfDocument.FromFile("input.pdf");
var watermark = new TextStamper()
{
Text = "CONFIDENTIAL",
FontSize = 48,
Opacity = 50,
Rotation = 45,
VerticalAlignment = VerticalAlignment.Middle,
HorizontalAlignment = HorizontalAlignment.Center
};
pdf.ApplyStamp(watermark);
pdf.SaveAs("watermarked.pdf");
}
}
Imports IronPdf
Imports IronPdf.Editing
Imports System
Module Program
Sub Main()
Dim pdf = PdfDocument.FromFile("input.pdf")
Dim watermark = New TextStamper() With {
.Text = "CONFIDENTIAL",
.FontSize = 48,
.Opacity = 50,
.Rotation = 45,
.VerticalAlignment = VerticalAlignment.Middle,
.HorizontalAlignment = HorizontalAlignment.Center
}
pdf.ApplyStamp(watermark)
pdf.SaveAs("watermarked.pdf")
End Sub
End Module
Gnostice PDFOne アプローチでは、PDFFont オブジェクトを作成し、ページを手動で反復処理し、座標 (200、400) を計算し、PDFTextElement オブジェクトのプロパティを設定する必要があります。IronPDFの TextStamper は、座標計算を必要とせず、自動的な中央揃えとページ適用を備えた宣言型構成を提供します。 追加のオプションについては、透かしのドキュメントを参照してください。
重要な移行に関する注意事項
座標ベースから HTML/CSS レイアウトへ
このGnostice PDFOne移行における最も重要なパラダイムシフトは、座標ベースのポジショニングからHTML/CSSレイアウトへの移行です:
// Gnostice PDFOne: Manual coordinate positioning
watermark.Draw(page, 200, 400); // X=200, Y=400
// IronPDF: Declarative alignment
watermark.VerticalAlignment = VerticalAlignment.Middle;
watermark.HorizontalAlignment = HorizontalAlignment.Center;
// Gnostice PDFOne: Manual coordinate positioning
watermark.Draw(page, 200, 400); // X=200, Y=400
// IronPDF: Declarative alignment
watermark.VerticalAlignment = VerticalAlignment.Middle;
watermark.HorizontalAlignment = HorizontalAlignment.Center;
' Gnostice PDFOne: Manual coordinate positioning
watermark.Draw(page, 200, 400) ' X=200, Y=400
' IronPDF: Declarative alignment
watermark.VerticalAlignment = VerticalAlignment.Middle
watermark.HorizontalAlignment = HorizontalAlignment.Center
フォント オブジェクトから CSS スタイリングへ
// Gnostice PDFOne
PDFFont font = new PDFFont(PDFStandardFont.Helvetica, 48);
watermark.Font = font;
//IronPDF- use CSS in HTML content
var html = "<span style='font-family: Helvetica, Arial, sans-serif; font-size: 48pt;'>Text</span>";
// Gnostice PDFOne
PDFFont font = new PDFFont(PDFStandardFont.Helvetica, 48);
watermark.Font = font;
//IronPDF- use CSS in HTML content
var html = "<span style='font-family: Helvetica, Arial, sans-serif; font-size: 48pt;'>Text</span>";
Imports Gnostice.PDFOne
' Gnostice PDFOne
Dim font As New PDFFont(PDFStandardFont.Helvetica, 48)
watermark.Font = font
' IronPDF- use CSS in HTML content
Dim html As String = "<span style='font-family: Helvetica, Arial, sans-serif; font-size: 48pt;'>Text</span>"
ページ索引
Gnostice PDFOneはしばしば1-indexedページを使用しますが、IronPDFは0-indexed(.NETの標準的な慣習)を使用します:
// Gnostice PDFOne: May use 1-indexed
var page = doc.Pages[1]; // First page
// IronPDF: 0-indexed
var page = pdf.Pages[0]; // First page
// Gnostice PDFOne: May use 1-indexed
var page = doc.Pages[1]; // First page
// IronPDF: 0-indexed
var page = pdf.Pages[0]; // First page
' Gnostice PDFOne: May use 1-indexed
Dim page = doc.Pages(1) ' First page
' IronPDF: 0-indexed
Dim page = pdf.Pages(0) ' First page
今すぐ使える機能
Gnostice PDFOneからIronPdfに移行した後、これらの以前は問題であった、あるいは不可能であった機能が利用可能になります: -外部CSS: Gnostice PDFOneで動作しなかったスタイルシートが正しくレンダリングされるようになりました
- JavaScriptコンテンツ:欠落していた動的コンテンツが表示されるようになりました
- RTL言語:アラビア語、ヘブライ語、その他の右から左に書く言語は正常に動作します
- CSS グリッドとフレックスボックス:最新のレイアウト技術が完全にサポートされています -デジタル署名:信頼性の高い X509 証明書署名
トラブルシューティング
問題 1: PDFTextElement が見つかりません
問題: PDFTextElement はIronPDFに存在しません。
解決策: HTML コンテンツまたは TextStamper を使用します。
// For new documents - render HTML
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf("<p>Your text here</p>");
// For existing documents - use stampers
var stamper = new TextStamper() { Text = "Added Text" };
pdf.ApplyStamp(stamper);
// For new documents - render HTML
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf("<p>Your text here</p>");
// For existing documents - use stampers
var stamper = new TextStamper() { Text = "Added Text" };
pdf.ApplyStamp(stamper);
Imports IronPdf
' For new documents - render HTML
Dim renderer As New ChromePdfRenderer()
Dim pdf = renderer.RenderHtmlAsPdf("<p>Your text here</p>")
' For existing documents - use stampers
Dim stamper As New TextStamper() With {.Text = "Added Text"}
pdf.ApplyStamp(stamper)
第2号: PDFFontオブジェクト
問題:グノスティスPDFOneは PDFFont オブジェクトを使用します。 IronPDFはCSSを使用しています。
ソリューション:
// Gnostice PDFOne
PDFFont font = new PDFFont(PDFStandardFont.Helvetica, 12);
//IronPDF- use CSS
var html = "<span style='font-family: Helvetica, Arial, sans-serif; font-size: 12pt;'>Text</span>";
// Gnostice PDFOne
PDFFont font = new PDFFont(PDFStandardFont.Helvetica, 12);
//IronPDF- use CSS
var html = "<span style='font-family: Helvetica, Arial, sans-serif; font-size: 12pt;'>Text</span>";
' Gnostice PDFOne
Dim font As New PDFFont(PDFStandardFont.Helvetica, 12)
' IronPDF- use CSS
Dim html = "<span style='font-family: Helvetica, Arial, sans-serif; font-size: 12pt;'>Text</span>"
問題 3:DocExporter が見つかりません
問題: DocExporter クラスがIronPDFに存在しません。
解決策: ChromePdfRenderer を使用します。
// Gnostice PDFOne
DocExporter exporter = new DocExporter();
exporter.Export(doc, "output.pdf", DocumentFormat.PDF);
// IronPDF
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlFileAsPdf("input.html");
pdf.SaveAs("output.pdf");
// Gnostice PDFOne
DocExporter exporter = new DocExporter();
exporter.Export(doc, "output.pdf", DocumentFormat.PDF);
// IronPDF
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlFileAsPdf("input.html");
pdf.SaveAs("output.pdf");
' Gnostice PDFOne
Dim exporter As New DocExporter()
exporter.Export(doc, "output.pdf", DocumentFormat.PDF)
' IronPDF
Dim renderer = New ChromePdfRenderer()
Dim pdf = renderer.RenderHtmlFileAsPdf("input.html")
pdf.SaveAs("output.pdf")
第4号: メモリの改善
問題:グノスティスPDFOneはメモリ リークを報告しました。
解決策:IronPDFは安定したメモリ管理を提供します。 適切な廃棄パターンを使用してください:
using (var pdf = PdfDocument.FromFile("large.pdf"))
{
// Process PDF
pdf.SaveAs("output.pdf");
} // Automatically disposed
using (var pdf = PdfDocument.FromFile("large.pdf"))
{
// Process PDF
pdf.SaveAs("output.pdf");
} // Automatically disposed
Imports PdfDocument
Using pdf = PdfDocument.FromFile("large.pdf")
' Process PDF
pdf.SaveAs("output.pdf")
End Using
移行チェックリスト
移行前
- コードベース内のすべてのグノスティスPDFOneの使用状況を一覧表示する
- 動作していなかった機能 (CSS、JS、RTL) に注意してください。今後は動作します。
- 比較テストのためにメモリの問題を文書化する
- IronPDFライセンスキーを取得する
- バージョン管理に移行ブランチを作成する
コードの移行
-グノスティスPDFOneNuGetパッケージを削除する
-IronPDFNuGetパッケージをインストールします: dotnet add package IronPdf
- 名前空間のインポートを更新する
- ライセンスキー設定の置き換え
PDFDocumentをPdfDocumentに変換しますDocExporterをChromePdfRendererに変換します- 座標ベースの描画をHTMLスタンプに置き換える
- CSS スタイルに
PDFFontを更新 doc.Append()をPdfDocument.Merge()に変換します
テスティング
- HTMLからPDFへの変換テスト
- 外部CSSが動作するようになったことを確認する
- JavaScriptに依存するコンテンツをテストする
- RTL言語をテストする(必要な場合)
- デジタル署名をテストします (現在利用可能)
- PDF結合のテスト
- 透かしのテスト
- メモリ使用量を比較する
移行後
-グノスティスPDFOneライセンスを削除します
- ドキュメントの更新
- Gnostice PDFOneの制限に対する回避策を削除 -IronPDFAPI についてチームをトレーニングする

