C#でSyncfusion PDFからIronPDFへ移行する方法
Full Comparison
Looking for a detailed feature-by-feature breakdown? See how IronPDF stacks up against Syncfusion PDF on pricing, HTML support, and licensing.
Syncfusion PDF FrameworkからIronPDFに移行することで、PDF生成ワークフローは、大規模なスイートにバンドルされた座標ベースのグラフィックスAPIから、最新のChromiumレンダリングを備えたスタンドアロンのHTML/CSSファーストライブラリに変わります。 このガイドは、スイートのみのライセンス、複雑な展開要件、および座標ベースの位置決めを排除する、完全で段階的な移行パスを提供します。
なぜSyncfusion PDFからIronPDFへ移行するのか
SyncfusionのPDFフレームワークを理解する
Syncfusion PDF Frameworkは、C#を使用してPDFドキュメントを作成、編集、保護するための幅広い機能を提供する包括的なライブラリです。 SyncfusionのEssential Studioの一部として提供され、複数のプラットフォームにわたって1000以上のコンポーネントが含まれています。
しかし、最も大きな欠点の1つは、単体で購入できないことです; 開発者は、Syncfusionのコンポーネント一式を購入する必要があります。 この要件は、PDFの機能だけに関心のあるチームにとっては面倒なものです。特に、このバンドルには、自分たちのプロジェクトには不要なツールが含まれている可能性があるからです。
バンドルライセンスの問題
Syncfusionのライセンスモデルは、PDF機能のみを必要とするチームにとって大きな課題となります:
- Suiteのみの購入: PDFライブラリを単独で購入することはできません。Essential Studio全体を購入する必要があります。 2.コミュニティライセンスの制限:無料プランでは、収益が100万ドル未満かつ開発者が5人未満である必要があります。 3.複雑な展開ライセンス: Web、デスクトップ、サーバーの展開ごとに異なるライセンス 4.毎年更新が必要:年間費用がかかるサブスクリプションモデル 5.開発者ごとの価格設定:コストはチームの規模に応じて比例して増加します 6.スイートの肥大化:必要のないコンポーネントが1000個以上含まれている
SyncfusionPDFとIronPDFの比較
| アスペクト | シンクフュージョンPDF | IronPDF |
|---|---|---|
| 購入モデル | スイートバンドルのみ | スタンドアロン |
| ライセンスについて | 複雑な階層 | 開発者ごとのシンプルな |
| コミュニティの制限 | <$1M AND <5 devs | 無料トライアル、その後ライセンス |
| デプロイメント | 複数のライセンスタイプ | 1つのライセンスで |
| APIスタイル | 座標ベースのグラフィック | HTML/CSSファースト |
| HTMLのサポート。 | BlinkBinariesが必要です | ネイティブChromium |
| CSSサポート | 制限的 | フルCSS3/フレックスボックス/グリッド |
| 依存関係について | 複数のパッケージ | 単一のNuGet |
| スイートの要件 | はい(スイート全体) | なし |
| PDFにフォーカス。 | 幅広い; より大きなスイートの一部 | 狭い; PDFフォーカス |
IronPDFはPDF機能をスタンドアロン製品として提供することで、より焦点を絞ったアプローチを提供します。 この違いは、コストの検討と統合の容易さの両方に大きく影響します。
2025年と2026年まで.NET 10とC# 14の採用を計画しているチームにとって、IronPDFのスタンドアロンライセンスとHTML/CSSファーストのアプローチは、スイートに依存することなく柔軟性を提供します。
始める前に
前提条件
- .NET環境: .NET Framework 4.6.2+ または.NET Core 3.1+ / .NET 5/6/7/8/9+
- NuGetアクセス: NuGetパッケージをインストールする機能
- IronPDFライセンス: IronPDFからライセンスキーを取得します。
NuGetパッケージの変更
# Remove Syncfusion packages
dotnet remove package Syncfusion.Pdf.Net.Core
dotnet remove package Syncfusion.HtmlToPdfConverter.Net.Windows
dotnet remove package Syncfusion.Licensing
# Install IronPDF
dotnet add package IronPdf
# Remove Syncfusion packages
dotnet remove package Syncfusion.Pdf.Net.Core
dotnet remove package Syncfusion.HtmlToPdfConverter.Net.Windows
dotnet remove package Syncfusion.Licensing
# Install IronPDF
dotnet add package IronPdf
ライセンス構成
シンクフュージョン:
// Must register before any Syncfusion calls
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR-SYNCFUSION-KEY");
// Must register before any Syncfusion calls
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR-SYNCFUSION-KEY");
' Must register before any Syncfusion calls
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR-SYNCFUSION-KEY")
IronPDF:
// One-time at startup
IronPdf.License.LicenseKey = "YOUR-IRONPDF-KEY";
// One-time at startup
IronPdf.License.LicenseKey = "YOUR-IRONPDF-KEY";
' One-time at startup
IronPdf.License.LicenseKey = "YOUR-IRONPDF-KEY"
完全な API リファレンス
名前空間の変更
// Before: Syncfusion PDF
using Syncfusion.Pdf;
using Syncfusion.Pdf.Graphics;
using Syncfusion.Pdf.Parsing;
using Syncfusion.HtmlConverter;
using Syncfusion.Drawing;
// After: IronPDF
using IronPdf;
using IronPdf.Rendering;
// Before: Syncfusion PDF
using Syncfusion.Pdf;
using Syncfusion.Pdf.Graphics;
using Syncfusion.Pdf.Parsing;
using Syncfusion.HtmlConverter;
using Syncfusion.Drawing;
// After: IronPDF
using IronPdf;
using IronPdf.Rendering;
Imports IronPdf
Imports IronPdf.Rendering
コア API マッピング
| Syncfusion | IronPDF |
|---|---|
PdfDocument |
ChromePdfRenderer |
PdfLoadedDocument |
PdfDocument.FromFile() |
HtmlToPdfConverter |
ChromePdfRenderer |
graphics.DrawString() |
HTMLテキスト要素 |
graphics.DrawImage() |
<img> タグ |
PdfGrid |
HTML <table> |
PdfStandardFont |
CSS font-family |
PdfBrushes.Black |
CSS color: black |
document.Security |
pdf.SecuritySettings |
PdfTextExtractor |
pdf.ExtractAllText() |
ImportPageRange() |
PdfDocument.Merge() |
document.Save(stream) |
pdf.SaveAs(path) |
document.Close(true) |
不要 |
コード移行の例
例1: HTML/URLからPDFへの変換
翻訳前 (Syncfusion PDF):
// NuGet: Install-Package Syncfusion.Pdf.Net.Core
using Syncfusion.HtmlConverter;
using Syncfusion.Pdf;
using System.IO;
class Program
{
static void Main()
{
// Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
// Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.example.com");
// Save the document
FileStream fileStream = new FileStream("Output.pdf", FileMode.Create);
document.Save(fileStream);
document.Close(true);
fileStream.Close();
}
}
// NuGet: Install-Package Syncfusion.Pdf.Net.Core
using Syncfusion.HtmlConverter;
using Syncfusion.Pdf;
using System.IO;
class Program
{
static void Main()
{
// Initialize HTML to PDF converter
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
// Convert URL to PDF
PdfDocument document = htmlConverter.Convert("https://www.example.com");
// Save the document
FileStream fileStream = new FileStream("Output.pdf", FileMode.Create);
document.Save(fileStream);
document.Close(true);
fileStream.Close();
}
}
Imports Syncfusion.HtmlConverter
Imports Syncfusion.Pdf
Imports System.IO
Module Program
Sub Main()
' Initialize HTML to PDF converter
Dim htmlConverter As New HtmlToPdfConverter()
' Convert URL to PDF
Dim document As PdfDocument = htmlConverter.Convert("https://www.example.com")
' Save the document
Dim fileStream As New FileStream("Output.pdf", FileMode.Create)
document.Save(fileStream)
document.Close(True)
fileStream.Close()
End Sub
End Module
翻訳後(IronPDF):。
// NuGet: Install-Package IronPdf
using IronPdf;
class Program
{
static void Main()
{
// Create a PDF from a URL
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderUrlAsPdf("https://www.example.com");
// Save the PDF
pdf.SaveAs("Output.pdf");
}
}
// NuGet: Install-Package IronPdf
using IronPdf;
class Program
{
static void Main()
{
// Create a PDF from a URL
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderUrlAsPdf("https://www.example.com");
// Save the PDF
pdf.SaveAs("Output.pdf");
}
}
Imports IronPdf
Class Program
Shared Sub Main()
' Create a PDF from a URL
Dim renderer = New ChromePdfRenderer()
Dim pdf = renderer.RenderUrlAsPdf("https://www.example.com")
' Save the PDF
pdf.SaveAs("Output.pdf")
End Sub
End Class
この例は、基本的なAPIの違いを示しています。シンクフュージョンPDFには、HtmlToPdfConverter インスタンスが必要です。Convert() を呼び出して、PdfDocument を返し、次に手動で FileStream を作成し、保存して、ドキュメントとストリームの両方を閉じます。
IronPDF は、わずか 3 行のコード内で ChromePdfRenderer と RenderUrlAsPdf() を使用します。 FileStream 管理や Close() 呼び出しは不要です。IronPDFはクリーンアップを自動的に処理します。 包括的な例については、HTML to PDF documentationを参照してください。
例2:テキストからPDFを作成する
翻訳前 (Syncfusion PDF):
// NuGet: Install-Package Syncfusion.Pdf.Net.Core
using Syncfusion.Pdf;
using Syncfusion.Pdf.Graphics;
using Syncfusion.Drawing;
using System.IO;
class Program
{
static void Main()
{
// Create a new PDF document
PdfDocument document = new PdfDocument();
// Add a page
PdfPage page = document.Pages.Add();
// Create a font
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
// Draw text
page.Graphics.DrawString("Hello, World!", font, PdfBrushes.Black, new PointF(10, 10));
// Save the document
FileStream fileStream = new FileStream("Output.pdf", FileMode.Create);
document.Save(fileStream);
document.Close(true);
fileStream.Close();
}
}
// NuGet: Install-Package Syncfusion.Pdf.Net.Core
using Syncfusion.Pdf;
using Syncfusion.Pdf.Graphics;
using Syncfusion.Drawing;
using System.IO;
class Program
{
static void Main()
{
// Create a new PDF document
PdfDocument document = new PdfDocument();
// Add a page
PdfPage page = document.Pages.Add();
// Create a font
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
// Draw text
page.Graphics.DrawString("Hello, World!", font, PdfBrushes.Black, new PointF(10, 10));
// Save the document
FileStream fileStream = new FileStream("Output.pdf", FileMode.Create);
document.Save(fileStream);
document.Close(true);
fileStream.Close();
}
}
Imports Syncfusion.Pdf
Imports Syncfusion.Pdf.Graphics
Imports Syncfusion.Drawing
Imports System.IO
Module Program
Sub Main()
' Create a new PDF document
Dim document As New PdfDocument()
' Add a page
Dim page As PdfPage = document.Pages.Add()
' Create a font
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
' Draw text
page.Graphics.DrawString("Hello, World!", font, PdfBrushes.Black, New PointF(10, 10))
' Save the document
Dim fileStream As New FileStream("Output.pdf", FileMode.Create)
document.Save(fileStream)
document.Close(True)
fileStream.Close()
End Sub
End Module
翻訳後(IronPDF):。
// NuGet: Install-Package IronPdf
using IronPdf;
using IronPdf.Rendering;
class Program
{
static void Main()
{
// Create a PDF from HTML string
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf("<h1>Hello, World!</h1>");
// Save the document
pdf.SaveAs("Output.pdf");
}
}
// NuGet: Install-Package IronPdf
using IronPdf;
using IronPdf.Rendering;
class Program
{
static void Main()
{
// Create a PDF from HTML string
var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf("<h1>Hello, World!</h1>");
// Save the document
pdf.SaveAs("Output.pdf");
}
}
Imports IronPdf
Imports IronPdf.Rendering
Class Program
Shared Sub Main()
' Create a PDF from HTML string
Dim renderer As New ChromePdfRenderer()
Dim pdf = renderer.RenderHtmlAsPdf("<h1>Hello, World!</h1>")
' Save the document
pdf.SaveAs("Output.pdf")
End Sub
End Class
Syncfusion PDFは座標ベースのグラフィックモデルを使用しています。 PdfDocument を作成し、PdfPage を追加し、PdfFontFamily.Helvetica を使用して PdfFont を作成し、次に明示的な座標 (new PointF(10, 10))、フォント、およびブラシ (PdfBrushes.Black) を使用して page.Graphics.DrawString() を呼び出します。 最後に、FileStream の作成と破棄を管理します。
IronPdfはHTML/CSSファーストのアプローチを採用しています。 Instead of coordinates, you write <h1>Hello, World!</h1> and let CSS handle positioning, fonts, and colors. このアプローチは、よりシンプルで保守性が高く、開発者がすでに持っているスキルを活用できます。 詳しくは、チュートリアルをご覧ください。
例 3: PDF ドキュメントをマージする
翻訳前 (Syncfusion PDF):
// NuGet: Install-Package Syncfusion.Pdf.Net.Core
using Syncfusion.Pdf;
using Syncfusion.Pdf.Parsing;
using System.IO;
class Program
{
static void Main()
{
// Load the first PDF document
FileStream stream1 = new FileStream("Document1.pdf", FileMode.Open, FileAccess.Read);
PdfLoadedDocument loadedDocument1 = new PdfLoadedDocument(stream1);
// Load the second PDF document
FileStream stream2 = new FileStream("Document2.pdf", FileMode.Open, FileAccess.Read);
PdfLoadedDocument loadedDocument2 = new PdfLoadedDocument(stream2);
// Merge the documents
PdfDocument finalDocument = new PdfDocument();
finalDocument.ImportPageRange(loadedDocument1, 0, loadedDocument1.Pages.Count - 1);
finalDocument.ImportPageRange(loadedDocument2, 0, loadedDocument2.Pages.Count - 1);
// Save the merged document
FileStream outputStream = new FileStream("Merged.pdf", FileMode.Create);
finalDocument.Save(outputStream);
// Close all documents
finalDocument.Close(true);
loadedDocument1.Close(true);
loadedDocument2.Close(true);
stream1.Close();
stream2.Close();
outputStream.Close();
}
}
// NuGet: Install-Package Syncfusion.Pdf.Net.Core
using Syncfusion.Pdf;
using Syncfusion.Pdf.Parsing;
using System.IO;
class Program
{
static void Main()
{
// Load the first PDF document
FileStream stream1 = new FileStream("Document1.pdf", FileMode.Open, FileAccess.Read);
PdfLoadedDocument loadedDocument1 = new PdfLoadedDocument(stream1);
// Load the second PDF document
FileStream stream2 = new FileStream("Document2.pdf", FileMode.Open, FileAccess.Read);
PdfLoadedDocument loadedDocument2 = new PdfLoadedDocument(stream2);
// Merge the documents
PdfDocument finalDocument = new PdfDocument();
finalDocument.ImportPageRange(loadedDocument1, 0, loadedDocument1.Pages.Count - 1);
finalDocument.ImportPageRange(loadedDocument2, 0, loadedDocument2.Pages.Count - 1);
// Save the merged document
FileStream outputStream = new FileStream("Merged.pdf", FileMode.Create);
finalDocument.Save(outputStream);
// Close all documents
finalDocument.Close(true);
loadedDocument1.Close(true);
loadedDocument2.Close(true);
stream1.Close();
stream2.Close();
outputStream.Close();
}
}
Imports Syncfusion.Pdf
Imports Syncfusion.Pdf.Parsing
Imports System.IO
Class Program
Shared Sub Main()
' Load the first PDF document
Dim stream1 As New FileStream("Document1.pdf", FileMode.Open, FileAccess.Read)
Dim loadedDocument1 As New PdfLoadedDocument(stream1)
' Load the second PDF document
Dim stream2 As New FileStream("Document2.pdf", FileMode.Open, FileAccess.Read)
Dim loadedDocument2 As New PdfLoadedDocument(stream2)
' Merge the documents
Dim finalDocument As New PdfDocument()
finalDocument.ImportPageRange(loadedDocument1, 0, loadedDocument1.Pages.Count - 1)
finalDocument.ImportPageRange(loadedDocument2, 0, loadedDocument2.Pages.Count - 1)
' Save the merged document
Dim outputStream As New FileStream("Merged.pdf", FileMode.Create)
finalDocument.Save(outputStream)
' Close all documents
finalDocument.Close(True)
loadedDocument1.Close(True)
loadedDocument2.Close(True)
stream1.Close()
stream2.Close()
outputStream.Close()
End Sub
End Class
翻訳後(IronPDF):。
// NuGet: Install-Package IronPdf
using IronPdf;
using System.Collections.Generic;
class Program
{
static void Main()
{
// Load PDF documents
var pdf1 = PdfDocument.FromFile("Document1.pdf");
var pdf2 = PdfDocument.FromFile("Document2.pdf");
// Merge PDFs
var merged = PdfDocument.Merge(new List<PdfDocument> { pdf1, pdf2 });
// Save the merged document
merged.SaveAs("Merged.pdf");
}
}
// NuGet: Install-Package IronPdf
using IronPdf;
using System.Collections.Generic;
class Program
{
static void Main()
{
// Load PDF documents
var pdf1 = PdfDocument.FromFile("Document1.pdf");
var pdf2 = PdfDocument.FromFile("Document2.pdf");
// Merge PDFs
var merged = PdfDocument.Merge(new List<PdfDocument> { pdf1, pdf2 });
// Save the merged document
merged.SaveAs("Merged.pdf");
}
}
Imports IronPdf
Imports System.Collections.Generic
Class Program
Shared Sub Main()
' Load PDF documents
Dim pdf1 = PdfDocument.FromFile("Document1.pdf")
Dim pdf2 = PdfDocument.FromFile("Document2.pdf")
' Merge PDFs
Dim merged = PdfDocument.Merge(New List(Of PdfDocument) From {pdf1, pdf2})
' Save the merged document
merged.SaveAs("Merged.pdf")
End Sub
End Class
PDFをマージする際のコントラストは劇的です。シンクフュージョンPDFでは、各入力ドキュメントに対して FileStream オブジェクトを作成し、それらを PdfLoadedDocument としてロードし、新しい PdfDocument を作成し、各ソースの開始インデックスと終了インデックスを使用して ImportPageRange() を呼び出し、出力 FileStream を作成し、 6 つの個別のオブジェクト (outputStream) を閉じる必要があります。
IronPDF は、各 PDF をロードするために PdfDocument.FromFile() を使用し、ドキュメントのリストを受け入れる静的な PdfDocument.Merge() メソッドを使用します。 ストリーム管理、手動でのページ範囲計算、クローズコールはありません。
API哲学の主な相違点
座標ベース vs HTML/CSSファースト
Syncfusion PDFは、従来のPDFライブラリから受け継いだ座標ベースのグラフィックモデルを使用しています:
// Syncfusion: マニュアル positioning
page.Graphics.DrawString("Text", font, PdfBrushes.Black, new PointF(100, 200));
page.Graphics.DrawRectangle(brush, new RectangleF(50, 50, 200, 100));
// Syncfusion: マニュアル positioning
page.Graphics.DrawString("Text", font, PdfBrushes.Black, new PointF(100, 200));
page.Graphics.DrawRectangle(brush, new RectangleF(50, 50, 200, 100));
' Syncfusion: マニュアル positioning
page.Graphics.DrawString("Text", font, PdfBrushes.Black, New PointF(100, 200))
page.Graphics.DrawRectangle(brush, New RectangleF(50, 50, 200, 100))
IronPDFはレイアウトにHTML/CSSを使用しています:
// IronPDF: CSS-based positioning
var html = @"
<div style='margin: 50px; padding: 20px; border: 1px solid black;'>
<p style='color: black;'>Text</p>
</div>";
var pdf = renderer.RenderHtmlAsPdf(html);
// IronPDF: CSS-based positioning
var html = @"
<div style='margin: 50px; padding: 20px; border: 1px solid black;'>
<p style='color: black;'>Text</p>
</div>";
var pdf = renderer.RenderHtmlAsPdf(html);
' IronPDF: CSS-based positioning
Dim html As String = "
<div style='margin: 50px; padding: 20px; border: 1px solid black;'>
<p style='color: black;'>Text</p>
</div>"
Dim pdf = renderer.RenderHtmlAsPdf(html)
HTML/CSSのアプローチは、ウェブ開発者にとってより直感的で、メンテナンスが容易で、異なるページサイズでも一貫した結果をもたらします。
ストリーム管理と自動クリーンアップの比較
Syncfusion PDFには、明示的なストリームとドキュメント廃棄が必要です:
// Syncfusion: マニュアル cleanup
FileStream fileStream = new FileStream("Output.pdf", FileMode.Create);
document.Save(fileStream);
document.Close(true);
fileStream.Close();
// Syncfusion: マニュアル cleanup
FileStream fileStream = new FileStream("Output.pdf", FileMode.Create);
document.Save(fileStream);
document.Close(true);
fileStream.Close();
' Syncfusion: マニュアル cleanup
Dim fileStream As New FileStream("Output.pdf", FileMode.Create)
document.Save(fileStream)
document.Close(True)
fileStream.Close()
IronPDFは自動的にクリーンアップを行います:
// IronPDF:自動翻訳cleanup
pdf.SaveAs("Output.pdf");
// IronPDF:自動翻訳cleanup
pdf.SaveAs("Output.pdf");
' IronPDF:自動翻訳cleanup
pdf.SaveAs("Output.pdf")
機能比較
| フィーチャー | シンクフュージョンPDF | IronPDF |
|---|---|---|
| スタンダロンの購入 | なし(スイートのみ) | はい |
| ライセンスについて | コミュニティ制限付き商用 | 簡易商用 |
| HTMLからPDFへ | BlinkBinariesが必要です | ネイティブChromium |
| CSS3のサポート。 | 制限的 | フル(フレックスボックス、グリッド) |
| APIスタイル | 座標ベースのグラフィック | HTML/CSSファースト |
| ストリーム管理 | マニュアル | 自動翻訳 |
| 依存関係について | 複数のパッケージ | 単一のNuGet |
| 展開の複雑さ | 複雑な | ストレート |
移行チェックリスト
移行前
- コードベース内のすべてのSyncfusion PDFの使用状況をインベントリする
- ライセンスコストと展開要件を文書化する
PdfGraphics、およびHtmlToPdfConverterの使用箇所を識別します- IronPDFからIronPDFライセンスキーを取得します
コードの更新
- Syncfusion パッケージを削除します (
Syncfusion.Licensing) IronPdfNuGetパッケージをインストールします- 名前空間のインポートを更新します (
using Syncfusion.Pdf;→using IronPdf;) Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense()をIronPdf.License.LicenseKey = "..."に置き換えますHtmlToPdfConverter.Convert()をChromePdfRenderer.RenderUrlAsPdf()またはRenderHtmlAsPdf()に置き換えます。PdfDocument+Pages.Add()+Graphics.DrawString()をChromePdfRenderer.RenderHtmlAsPdf()に置き換えますPdfLoadedDocumentをPdfDocument.FromFile()に置き換えますImportPageRange()をPdfDocument.Merge()に置き換えますdocument.Save(stream)をpdf.SaveAs(path)に置き換えます- すべての
stream.Close()呼び出しを削除します PdfGridを HTML<table>要素に置き換えますPdfStandardFontを CSSfont-familyに置き換えますPdfBrushesを CSScolorプロパティに置き換えます
テスティング
- PDF出力の視覚的な比較
- CSS レンダリングの改善を検証 (flexbox、グリッドが動作するようになりました)
- テストテキスト抽出
- テストのマージと分割
- パフォーマンス比較

