フッターコンテンツにスキップ
製品比較

IronPDF vs GemBox.Pdf: HTMLからPDFへの変換のための完全な.NET PDFライブラリ比較ガイド

開発する.NETアプリケーションがPDF生成および操作を必要とする場合、適切なC# PDFライブラリを選択することがプロジェクトの成功に大きく影響します。 この包括的な比較は、開発者が機能、パフォーマンス、価格設定、実際の使用ケースに基づいて、IronPDFとGemBox.Pdfという2つの著名な.NET PDFライブラリを検討するための情報を提供します。

クイック比較の概要

class="product__comprehensive-comparison-table">
class="table-container">
class="table-number">製品比較概要
class="table-title">.NET開発用IronPDFおよびGemBox.Pdfの機能比較
カテゴリ 機能/側面 IronPDF GemBox.Pdf 主要な利点
コアアーキテクチャ デザイン哲学 HTMLが中心、Chromeレンダリング PDFネイティブ操作 コンテキスト依存
APIの複雑さ RenderHtmlAsPdf()のようなシンプルなメソッド 低レベルのPDFオブジェクト IronPDF: 開発が迅速
学習曲線 1-2日が典型的 3-5日が典型的 IronPDF: より早く習得
プラットフォームサポート クロスプラットフォーム Windows, Linux, macOS, Docker Windows, Linux, macOS, Android, iOS GemBox: モバイルサポート
.NETバージョン .NET 10, 9, 8, 7, 6, 5, Core 3.1+, Framework 4.6.2+ .NET 6, Standard 2.0, Framework 3.5+ IronPDF: 最新の.NETサポート
クラウドプラットフォーム Azure/AWSに最適化 標準のクラウドサポート IronPDF: クラウド対応
HTML to PDF レンダリングエンジン Chrome V8フルエンジン 内蔵HTMLサポートなし* IronPDF: ネイティブHTML to PDF
CSS3/HTML5サポート 完全なサポート GemBox.Documentが必要 IronPDF: 現代のウェブ標準
JavaScript実行 完全なJavaScriptのサポート JavaScriptのサポートなし IronPDF: 動的コンテンツ
レンダリング速度 約125ms(通常) N/A(HTMLサポートなし) IronPDF: 高速レンダリング
開発者体験 コード例 100以上のすぐに使えるサンプル 100以上の例が利用可能 両方とも: 豊富なリソース
ドキュメンテーション チュートリアル、ハウツー、ビデオ APIドキュメンテーションに専念 IronPDF: 複数の学習パス
コンテンツ操作 PDFの結合/分割 内蔵メソッド 内蔵メソッド 両方とも: 標準機能
テキスト抽出 ユニコードサポート、OCR統合 ユニコードサポート、内蔵OCR GemBox: 内蔵OCR
フォームサポート HTMLフォームからPDFフォームへ 作成、入力、フラット化 コンテキスト依存
パフォーマンス指標 メモリ使用量 通常、10MB未満 低メモリフットプリント 両方とも: 効率的
スレッディングサポート ネイティブなasync/await最適化 スレッドセーフな操作 IronPDF: より良い非同期サポート
セキュリティ & 暗号化 暗号化レベル AES-256、カスタムハンドラー AES-256標準 両方とも: 業界標準
デジタル署名 統合されたビジュアル署名 デジタル署名サポート 両方とも: 署名サポート
ライセンス & 価格設定 エントリーレベル Lite: $799 (1人の開発者、1プロジェクト) シングルデベロッパー: 0 (1人の開発者、無制限のプロジェクト) IronPDF: 低いエントリーコスト
再配布 +,999 ロイヤリティフリー 含まれており、無制限のデプロイメントが可能 GemBox: より良いデプロイメント条件
スイートオプション Iron Suite: $1,498 (9製品) GemBox Bundle: ,200 (7製品) IronPDF: より良いスイートバリュー
サポート サポート含まれる はい、24/5のエンジニアリングサポート はい、1年間のプロフェッショナルサポート 両方とも: 良好なサポート
応答時間 通常24-48時間 1営業日以内 両方とも: 迅速な応答
最適な用途 使用ケース HTML to PDF、ウェブアプリ、レポート PDF操作、フォーム、OCR コンテキスト依存
class="table-note"> 注釈。 GemBox.PdfはPDF操作を中心にしていますが、HTML変換にはGemBox.Documentが必要です。IronPDFはフルブラウザーレンダリングでネイティブのHTML to PDF変換を提供します。*GemBoxでのHTMLサポートは追加製品の購入が必要です。

ご注意GemBox.PdfはHTML to PDF変換に別途GemBox.Documentライブラリ(追加$890)が必要です。

IronPDFライブラリとは何ですか?

IronPDFは、HTMLからPDFへの変換を開発者が簡単に行えるように設計された包括的な.NET PDFライブラリです。 Chromeレンダリングエンジンをコアに持ち、IronPDFはC#、F#、VB.NETアプリケーションにおけるPDF生成のアプローチを変革します。

ライブラリの哲学は、既存のウェブ開発スキルを活用することに重点を置いています。 複雑なPDF APIを学ぶ代わりに、開発者は馴染みのあるHTML、CSS、JavaScriptを使って洗練されたPDF文書を作成できます。 このアプローチは、現代のウェブ標準に準拠したピクセルパーフェクトなレンダリングを実現しながら、開発時間を大幅に短縮します。

IronPDFのコア機能

IronPDFは、開発者が遭遇する可能性のあるあらゆるPDF関連タスクを網羅する広範な機能セットを提供します。

HTMLからPDFへの変換の卓越性

  • Chrome V8エンジン: Google Chromeと同じエンジンを使用してHTMLをレンダリングし、98%以上のブラウザーフィデリティを確保
  • CSS3/HTML5完全サポート: フレックスボックス、グリッド、アニメーションなど、現代のウェブ標準を完全サポート
  • JavaScript実行: レンダリング前にJavaScriptを処理し、動的コンテンツを完璧にキャプチャ
  • レスポンシブデザイン: カスタマイズ可能なビューポート設定でレスポンシブレイアウトを処理
  • ウェブフォントサポート: Google Fonts、カスタムフォント、アイコンフォントを正確にレンダリング

高度なPDF操作

セキュリティとコンプライアンス

  • 暗号化: カスタムの権限設定を備えたAES-256暗号化
  • PDF/A準拠: 長期保存用のアーカイバル品質PDFを生成
  • 編集: 機密コンテンツを永久に除去
  • パスワード保護: ユーザーおよびオーナーパスワードと詳細な権限サポート

IronPDFのコード例:高度な機能を持つHTMLからPDF

using IronPdf;
using IronPdf.Rendering;

// Configure the Chrome renderer with advanced options
var renderer = new ChromePdfRenderer
{
    RenderingOptions = new ChromePdfRenderOptions
    {
        // Set paper orientation and size
        PaperOrientation = PdfPaperOrientation.Portrait,
        PaperSize = PdfPaperSize.A4,

        // Configure margins (in millimeters)
        MarginTop = 25,
        MarginBottom = 25,
        MarginLeft = 20,
        MarginRight = 20,

        // Enable JavaScript execution
        EnableJavaScript = true,
        RenderDelay = 1000, // Wait 1 second for JS to complete

        // Print background colors and images
        PrintHtmlBackgrounds = true,

        // Create PDF forms from HTML form elements
        CreatePdfFormsFromHtml = true,

        // Custom header and footer
        HtmlHeader = new HtmlHeaderFooter
        {
            Height = 20,
            HtmlFragment = "<div style='text-align: center; font-size: 12px;'>Company Report - {page} of {total-pages}</div>",
            DrawDividerLine = true
        },

        HtmlFooter = new HtmlHeaderFooter
        {
            Height = 15,
            HtmlFragment = "<div style='text-align: center; font-size: 10px;'>© 2025 Company Name. Confidential.</div>"
        }
    }
};

// Convert complex HTML with CSS and JavaScript
string htmlContent = @"
<!DOCTYPE html>
<html>
<head>
    <style>
        body { font-family: 'Segoe UI', Arial, sans-serif; line-height: 1.6; }
        .invoice-header { 
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 30px;
            border-radius: 10px;
            margin-bottom: 30px;
        }
        .data-table { 
            width: 100%; 
            border-collapse: collapse; 
            margin-top: 20px;
        }
        .data-table th { 
            background-color: #f8f9fa; 
            padding: 12px; 
            text-align: left;
            border-bottom: 2px solid #dee2e6;
        }
        .data-table td { 
            padding: 10px; 
            border-bottom: 1px solid #dee2e6;
        }
        .total-section {
            margin-top: 30px;
            text-align: right;
            font-size: 18px;
            font-weight: bold;
        }
        @media print {
            .no-print { display: none; }
        }
    </style>
</head>
<body>
    <div class='invoice-header'>
        <h1>Invoice #INV-2025-001</h1>
        <p>Date: <span id='current-date'></span></p>
    </div>

    <table class='data-table'>
        <thead>
            <tr>
                <th>Item Description</th>
                <th>Quantity</th>
                <th>Unit Price</th>
                <th>Total</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>Professional PDF Library License</td>
                <td>1</td>
                <td>$799.00</td>
                <td>$799.00</td>
            </tr>
            <tr>
                <td>Priority Support (1 Year)</td>
                <td>1</td>
                <td>$299.00</td>
                <td>$299.00</td>
            </tr>
        </tbody>
    </table>

    <div class='total-section'>
        <p>Subtotal: $1,048.00</p>
        <p>Tax (8%): $83.84</p>
        <p style='color: #667eea; font-size: 24px;'>Total: $1,131.84</p>
    </div>

    <script>
        // Dynamic date insertion
        document.getElementById('current-date').textContent = new Date().toLocaleDateString('en-US', {
            year: 'numeric',
            month: 'long',
            day: 'numeric'
        });
    </script>
</body>
</html>";

// Render the HTML to PDF
PdfDocument pdf = renderer.RenderHtmlAsPdf(htmlContent);

// Apply additional security settings
pdf.SecuritySettings.OwnerPassword = "admin123";
pdf.SecuritySettings.UserPassword = "user123";
pdf.SecuritySettings.AllowUserPrinting = PdfPrintSecurity.NoPrint;
pdf.SecuritySettings.AllowUserCopyPasteContent = false;
pdf.SecuritySettings.AllowUserAnnotations = false;
pdf.SecuritySettings.AllowUserFormData = true;

// Add metadata
pdf.MetaData.Author = "Invoice System";
pdf.MetaData.Title = "Invoice INV-2025-001";
pdf.MetaData.Subject = "Customer Invoice";
pdf.MetaData.Keywords = "invoice, payment, 2025";
pdf.MetaData.CreationDate = DateTime.Now;

// Save the PDF
pdf.SaveAs("invoice-2025-001.pdf");

// Optional: Save as PDF/A for archival
pdf.SaveAsPdfA("invoice-2025-001-archive.pdf", PdfAVersions.PdfA3);
using IronPdf;
using IronPdf.Rendering;

// Configure the Chrome renderer with advanced options
var renderer = new ChromePdfRenderer
{
    RenderingOptions = new ChromePdfRenderOptions
    {
        // Set paper orientation and size
        PaperOrientation = PdfPaperOrientation.Portrait,
        PaperSize = PdfPaperSize.A4,

        // Configure margins (in millimeters)
        MarginTop = 25,
        MarginBottom = 25,
        MarginLeft = 20,
        MarginRight = 20,

        // Enable JavaScript execution
        EnableJavaScript = true,
        RenderDelay = 1000, // Wait 1 second for JS to complete

        // Print background colors and images
        PrintHtmlBackgrounds = true,

        // Create PDF forms from HTML form elements
        CreatePdfFormsFromHtml = true,

        // Custom header and footer
        HtmlHeader = new HtmlHeaderFooter
        {
            Height = 20,
            HtmlFragment = "<div style='text-align: center; font-size: 12px;'>Company Report - {page} of {total-pages}</div>",
            DrawDividerLine = true
        },

        HtmlFooter = new HtmlHeaderFooter
        {
            Height = 15,
            HtmlFragment = "<div style='text-align: center; font-size: 10px;'>© 2025 Company Name. Confidential.</div>"
        }
    }
};

// Convert complex HTML with CSS and JavaScript
string htmlContent = @"
<!DOCTYPE html>
<html>
<head>
    <style>
        body { font-family: 'Segoe UI', Arial, sans-serif; line-height: 1.6; }
        .invoice-header { 
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 30px;
            border-radius: 10px;
            margin-bottom: 30px;
        }
        .data-table { 
            width: 100%; 
            border-collapse: collapse; 
            margin-top: 20px;
        }
        .data-table th { 
            background-color: #f8f9fa; 
            padding: 12px; 
            text-align: left;
            border-bottom: 2px solid #dee2e6;
        }
        .data-table td { 
            padding: 10px; 
            border-bottom: 1px solid #dee2e6;
        }
        .total-section {
            margin-top: 30px;
            text-align: right;
            font-size: 18px;
            font-weight: bold;
        }
        @media print {
            .no-print { display: none; }
        }
    </style>
</head>
<body>
    <div class='invoice-header'>
        <h1>Invoice #INV-2025-001</h1>
        <p>Date: <span id='current-date'></span></p>
    </div>

    <table class='data-table'>
        <thead>
            <tr>
                <th>Item Description</th>
                <th>Quantity</th>
                <th>Unit Price</th>
                <th>Total</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>Professional PDF Library License</td>
                <td>1</td>
                <td>$799.00</td>
                <td>$799.00</td>
            </tr>
            <tr>
                <td>Priority Support (1 Year)</td>
                <td>1</td>
                <td>$299.00</td>
                <td>$299.00</td>
            </tr>
        </tbody>
    </table>

    <div class='total-section'>
        <p>Subtotal: $1,048.00</p>
        <p>Tax (8%): $83.84</p>
        <p style='color: #667eea; font-size: 24px;'>Total: $1,131.84</p>
    </div>

    <script>
        // Dynamic date insertion
        document.getElementById('current-date').textContent = new Date().toLocaleDateString('en-US', {
            year: 'numeric',
            month: 'long',
            day: 'numeric'
        });
    </script>
</body>
</html>";

// Render the HTML to PDF
PdfDocument pdf = renderer.RenderHtmlAsPdf(htmlContent);

// Apply additional security settings
pdf.SecuritySettings.OwnerPassword = "admin123";
pdf.SecuritySettings.UserPassword = "user123";
pdf.SecuritySettings.AllowUserPrinting = PdfPrintSecurity.NoPrint;
pdf.SecuritySettings.AllowUserCopyPasteContent = false;
pdf.SecuritySettings.AllowUserAnnotations = false;
pdf.SecuritySettings.AllowUserFormData = true;

// Add metadata
pdf.MetaData.Author = "Invoice System";
pdf.MetaData.Title = "Invoice INV-2025-001";
pdf.MetaData.Subject = "Customer Invoice";
pdf.MetaData.Keywords = "invoice, payment, 2025";
pdf.MetaData.CreationDate = DateTime.Now;

// Save the PDF
pdf.SaveAs("invoice-2025-001.pdf");

// Optional: Save as PDF/A for archival
pdf.SaveAsPdfA("invoice-2025-001-archive.pdf", PdfAVersions.PdfA3);
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

この例は、グラデーション、テーブル、動的なJavaScriptコンテンツ、およびセキュリティ設定やメタデータなどの高度なPDF機能を備えた複雑なHTMLレイアウトをIronPDFがどのように処理できるかを示しています。 ライブラリは、HTMLデザインに正確に一致するプロフェッショナルなPDFをシームレスに生成します。

GemBox.Pdfライブラリとは何ですか?

GemBox.Pdfは、.NETにおけるPDF操作に対する異なるアプローチを表しています。 HTML to PDF変換に焦点を当てるのではなく、GemBox.Pdfは低レベルのPDF操作および直接的なPDF操作を専門としています。 これにより、開発者がPDFの構造やコンテンツに正確な制御を必要とするシナリオで特に適しています。

ライブラリは既存のPDF文書での作業に優れており、PDFファイルの読み取り、編集、および詳細レベルでの操作に対して強力な機能を提供します。 GemBox.PdfはAdobe Acrobatに依存しないため、さまざまな環境でのデプロイメントが簡単です。

GemBox.Pdfのコア機能

GemBox.Pdfは包括的なPDF操作機能を提供します。

PDF文書操作

  • PDFの読み書き: PDF構造およびコンテンツへの直接アクセス
  • 結合と分割: 複数のPDFを結合したり、特定のページを抽出したり
  • ページのクローン: 異なるPDF文書間でページをインポート
  • ページ管理: プログラム的にページを追加、削除、または並べ替え

コンテンツ抽出と操作

  • テキスト抽出: 配置情報とともにユニコードテキストを抽出
  • 画像抽出: PDF文書から埋め込まれた画像を取得
  • OCRサポート: スキャンされた文書のための内蔵光学式文字認識
  • コンテンツ編集: 機密情報を永久に削除

フォームとインタラクティビティ

  • インタラクティブフォーム: PDFフォームの作成、入力、平坦化、エクスポート
  • フォームフィールド管理: すべてのフォームフィールドタイプへのプログラム的アクセス
  • 注釈: ハイパーリンクおよび他のPDF注釈を追加

グラフィックとビジュアル要素

  • 描画操作: テキスト、画像、およびベクターグラフィックスを追加
  • 形状とパス: 複雑なベクタードローイングを作成
  • 透かし: テキストおよび画像の透かしを適用
  • コンテンツグループ: コンテンツを論理グループに整理

GemBox.Pdfのコード例:PDF操作とフォーム

using GemBox.Pdf;
using GemBox.Pdf.Content;
using GemBox.Pdf.Forms;
using GemBox.Pdf.Security;

// Set license (use FREE-LIMITED-KEY for evaluation)
ComponentInfo.SetLicense("FREE-LIMITED-KEY");

// Create a new PDF document from scratch
using (var document = new PdfDocument())
{
    // Add a page with custom size
    var page = document.Pages.Add();

    // Create formatted text with multiple styles
    using (var formattedText = new PdfFormattedText())
    {
        formattedText.FontSize = 24;
        formattedText.FontFamily = new PdfFontFamily("Arial");
        formattedText.Color = PdfColor.FromRgb(0.2, 0.2, 0.6);
        formattedText.AppendLine("GemBox.Pdf Document Example");

        formattedText.FontSize = 12;
        formattedText.Color = PdfColor.FromRgb(0, 0, 0);
        formattedText.AppendLine("This document demonstrates PDF creation and manipulation features.");

        // Draw text to the page
        page.Content.DrawText(formattedText, new PdfPoint(50, 700));
    }

    // Add a form to the document
    var form = document.Form;

    // Create text field
    var textField = form.Fields.AddText(page, 50, 600, 200, 30);
    textField.Name = "CustomerName";
    textField.Value = "Enter your name";
    textField.Format.Fill.Color = PdfColor.FromRgb(0.95, 0.95, 0.95);

    // Create checkbox
    var checkBox = form.Fields.AddCheck(page, 50, 550, 20, 20);
    checkBox.Name = "Agreement";
    checkBox.Checked = false;

    // Add descriptive text next to checkbox
    using (var checkboxLabel = new PdfFormattedText())
    {
        checkboxLabel.Append("I agree to the terms and conditions");
        page.Content.DrawText(checkboxLabel, new PdfPoint(80, 555));
    }

    // Create submit button
    var submitButton = form.Fields.AddButton(page, 50, 500, 100, 30);
    submitButton.Name = "Submit";
    submitButton.Actions.Activate = PdfActionType.Named;

    // Add button appearance
    using (var buttonText = new PdfFormattedText())
    {
        buttonText.Append("Submit Form");
        buttonText.FontSize = 14;
        buttonText.Color = PdfColor.FromRgb(1, 1, 1);

        // Create button appearance stream
        var appearance = submitButton.Appearance.Normal;
        appearance.Fill.Color = PdfColor.FromRgb(0.2, 0.4, 0.8);
        appearance.Stroke.Color = PdfColor.FromRgb(0.1, 0.2, 0.4);
        appearance.Stroke.Width = 1;

        // Draw button background
        appearance.DrawRectangle(new PdfPoint(0, 0), new PdfSize(100, 30), true, true);

        // Draw button text
        appearance.DrawText(buttonText, new PdfPoint(20, 10));
    }

    // Add a table using low-level graphics
    var tableTop = 400;
    var tableLeft = 50;
    var cellWidth = 150;
    var cellHeight = 30;

    // Draw table headers
    page.Content.DrawRectangle(new PdfPoint(tableLeft, tableTop), 
        new PdfSize(cellWidth * 3, cellHeight), true, true);

    using (var headerText = new PdfFormattedText())
    {
        headerText.FontSize = 12;
        headerText.Color = PdfColor.FromRgb(1, 1, 1);
        headerText.Append("Product");
        page.Content.DrawText(headerText, new PdfPoint(tableLeft + 10, tableTop + 10));

        headerText.Clear();
        headerText.Append("Quantity");
        page.Content.DrawText(headerText, new PdfPoint(tableLeft + cellWidth + 10, tableTop + 10));

        headerText.Clear();
        headerText.Append("Price");
        page.Content.DrawText(headerText, new PdfPoint(tableLeft + cellWidth * 2 + 10, tableTop + 10));
    }

    // Draw table data rows
    var rowData = new[]
    {
        new { Product = "PDF Library", Quantity = "1", Price = "$890" },
        new { Product = "Support Plan", Quantity = "1", Price = "$299" },
        new { Product = "Training", Quantity = "2", Price = "$500" }
    };

    var currentY = tableTop - cellHeight;
    foreach (var row in rowData)
    {
        // Draw cell borders
        page.Content.DrawRectangle(new PdfPoint(tableLeft, currentY), 
            new PdfSize(cellWidth, cellHeight), false, true);
        page.Content.DrawRectangle(new PdfPoint(tableLeft + cellWidth, currentY), 
            new PdfSize(cellWidth, cellHeight), false, true);
        page.Content.DrawRectangle(new PdfPoint(tableLeft + cellWidth * 2, currentY), 
            new PdfSize(cellWidth, cellHeight), false, true);

        // Draw cell content
        using (var cellText = new PdfFormattedText())
        {
            cellText.FontSize = 11;
            cellText.Append(row.Product);
            page.Content.DrawText(cellText, new PdfPoint(tableLeft + 10, currentY + 10));

            cellText.Clear();
            cellText.Append(row.Quantity);
            page.Content.DrawText(cellText, new PdfPoint(tableLeft + cellWidth + 10, currentY + 10));

            cellText.Clear();
            cellText.Append(row.Price);
            page.Content.DrawText(cellText, new PdfPoint(tableLeft + cellWidth * 2 + 10, currentY + 10));
        }

        currentY -= cellHeight;
    }

    // Apply security settings
    var securitySettings = document.SecuritySettings;
    securitySettings.DocumentOpenPassword = "user123";
    securitySettings.PermissionsPassword = "owner123";
    securitySettings.Permissions = PdfPermissions.AllowPrint | PdfPermissions.AllowFormFill;

    // Save the document
    document.Save("gembox-example.pdf");
}

// Example: Manipulating existing PDF
using (var existingDoc = PdfDocument.Load("existing-document.pdf"))
{
    // Extract text from first page
    var page = existingDoc.Pages[0];
    var text = page.Content.GetText();
    Console.WriteLine($"Extracted text: {text}");

    // Add watermark to all pages
    foreach (var p in existingDoc.Pages)
    {
        using (var watermark = new PdfFormattedText())
        {
            watermark.Append("CONFIDENTIAL");
            watermark.FontSize = 50;
            watermark.Color = PdfColor.FromRgb(0.5, 0.5, 0.5);
            watermark.Opacity = 0.3;

            // Calculate center position
            var pageWidth = p.MediaBox.Width;
            var pageHeight = p.MediaBox.Height;
            var textWidth = watermark.Width;
            var textHeight = watermark.Height;

            var x = (pageWidth - textWidth) / 2;
            var y = (pageHeight - textHeight) / 2;

            // Draw watermark diagonally
            p.Content.SaveGraphicsState();
            p.Content.SetTransform(1, 0, 0, 1, x, y);
            p.Content.SetTransform(0.7071, 0.7071, -0.7071, 0.7071, 0, 0);
            p.Content.DrawText(watermark, new PdfPoint(0, 0));
            p.Content.RestoreGraphicsState();
        }
    }

    existingDoc.Save("watermarked-document.pdf");
}
using GemBox.Pdf;
using GemBox.Pdf.Content;
using GemBox.Pdf.Forms;
using GemBox.Pdf.Security;

// Set license (use FREE-LIMITED-KEY for evaluation)
ComponentInfo.SetLicense("FREE-LIMITED-KEY");

// Create a new PDF document from scratch
using (var document = new PdfDocument())
{
    // Add a page with custom size
    var page = document.Pages.Add();

    // Create formatted text with multiple styles
    using (var formattedText = new PdfFormattedText())
    {
        formattedText.FontSize = 24;
        formattedText.FontFamily = new PdfFontFamily("Arial");
        formattedText.Color = PdfColor.FromRgb(0.2, 0.2, 0.6);
        formattedText.AppendLine("GemBox.Pdf Document Example");

        formattedText.FontSize = 12;
        formattedText.Color = PdfColor.FromRgb(0, 0, 0);
        formattedText.AppendLine("This document demonstrates PDF creation and manipulation features.");

        // Draw text to the page
        page.Content.DrawText(formattedText, new PdfPoint(50, 700));
    }

    // Add a form to the document
    var form = document.Form;

    // Create text field
    var textField = form.Fields.AddText(page, 50, 600, 200, 30);
    textField.Name = "CustomerName";
    textField.Value = "Enter your name";
    textField.Format.Fill.Color = PdfColor.FromRgb(0.95, 0.95, 0.95);

    // Create checkbox
    var checkBox = form.Fields.AddCheck(page, 50, 550, 20, 20);
    checkBox.Name = "Agreement";
    checkBox.Checked = false;

    // Add descriptive text next to checkbox
    using (var checkboxLabel = new PdfFormattedText())
    {
        checkboxLabel.Append("I agree to the terms and conditions");
        page.Content.DrawText(checkboxLabel, new PdfPoint(80, 555));
    }

    // Create submit button
    var submitButton = form.Fields.AddButton(page, 50, 500, 100, 30);
    submitButton.Name = "Submit";
    submitButton.Actions.Activate = PdfActionType.Named;

    // Add button appearance
    using (var buttonText = new PdfFormattedText())
    {
        buttonText.Append("Submit Form");
        buttonText.FontSize = 14;
        buttonText.Color = PdfColor.FromRgb(1, 1, 1);

        // Create button appearance stream
        var appearance = submitButton.Appearance.Normal;
        appearance.Fill.Color = PdfColor.FromRgb(0.2, 0.4, 0.8);
        appearance.Stroke.Color = PdfColor.FromRgb(0.1, 0.2, 0.4);
        appearance.Stroke.Width = 1;

        // Draw button background
        appearance.DrawRectangle(new PdfPoint(0, 0), new PdfSize(100, 30), true, true);

        // Draw button text
        appearance.DrawText(buttonText, new PdfPoint(20, 10));
    }

    // Add a table using low-level graphics
    var tableTop = 400;
    var tableLeft = 50;
    var cellWidth = 150;
    var cellHeight = 30;

    // Draw table headers
    page.Content.DrawRectangle(new PdfPoint(tableLeft, tableTop), 
        new PdfSize(cellWidth * 3, cellHeight), true, true);

    using (var headerText = new PdfFormattedText())
    {
        headerText.FontSize = 12;
        headerText.Color = PdfColor.FromRgb(1, 1, 1);
        headerText.Append("Product");
        page.Content.DrawText(headerText, new PdfPoint(tableLeft + 10, tableTop + 10));

        headerText.Clear();
        headerText.Append("Quantity");
        page.Content.DrawText(headerText, new PdfPoint(tableLeft + cellWidth + 10, tableTop + 10));

        headerText.Clear();
        headerText.Append("Price");
        page.Content.DrawText(headerText, new PdfPoint(tableLeft + cellWidth * 2 + 10, tableTop + 10));
    }

    // Draw table data rows
    var rowData = new[]
    {
        new { Product = "PDF Library", Quantity = "1", Price = "$890" },
        new { Product = "Support Plan", Quantity = "1", Price = "$299" },
        new { Product = "Training", Quantity = "2", Price = "$500" }
    };

    var currentY = tableTop - cellHeight;
    foreach (var row in rowData)
    {
        // Draw cell borders
        page.Content.DrawRectangle(new PdfPoint(tableLeft, currentY), 
            new PdfSize(cellWidth, cellHeight), false, true);
        page.Content.DrawRectangle(new PdfPoint(tableLeft + cellWidth, currentY), 
            new PdfSize(cellWidth, cellHeight), false, true);
        page.Content.DrawRectangle(new PdfPoint(tableLeft + cellWidth * 2, currentY), 
            new PdfSize(cellWidth, cellHeight), false, true);

        // Draw cell content
        using (var cellText = new PdfFormattedText())
        {
            cellText.FontSize = 11;
            cellText.Append(row.Product);
            page.Content.DrawText(cellText, new PdfPoint(tableLeft + 10, currentY + 10));

            cellText.Clear();
            cellText.Append(row.Quantity);
            page.Content.DrawText(cellText, new PdfPoint(tableLeft + cellWidth + 10, currentY + 10));

            cellText.Clear();
            cellText.Append(row.Price);
            page.Content.DrawText(cellText, new PdfPoint(tableLeft + cellWidth * 2 + 10, currentY + 10));
        }

        currentY -= cellHeight;
    }

    // Apply security settings
    var securitySettings = document.SecuritySettings;
    securitySettings.DocumentOpenPassword = "user123";
    securitySettings.PermissionsPassword = "owner123";
    securitySettings.Permissions = PdfPermissions.AllowPrint | PdfPermissions.AllowFormFill;

    // Save the document
    document.Save("gembox-example.pdf");
}

// Example: Manipulating existing PDF
using (var existingDoc = PdfDocument.Load("existing-document.pdf"))
{
    // Extract text from first page
    var page = existingDoc.Pages[0];
    var text = page.Content.GetText();
    Console.WriteLine($"Extracted text: {text}");

    // Add watermark to all pages
    foreach (var p in existingDoc.Pages)
    {
        using (var watermark = new PdfFormattedText())
        {
            watermark.Append("CONFIDENTIAL");
            watermark.FontSize = 50;
            watermark.Color = PdfColor.FromRgb(0.5, 0.5, 0.5);
            watermark.Opacity = 0.3;

            // Calculate center position
            var pageWidth = p.MediaBox.Width;
            var pageHeight = p.MediaBox.Height;
            var textWidth = watermark.Width;
            var textHeight = watermark.Height;

            var x = (pageWidth - textWidth) / 2;
            var y = (pageHeight - textHeight) / 2;

            // Draw watermark diagonally
            p.Content.SaveGraphicsState();
            p.Content.SetTransform(1, 0, 0, 1, x, y);
            p.Content.SetTransform(0.7071, 0.7071, -0.7071, 0.7071, 0, 0);
            p.Content.DrawText(watermark, new PdfPoint(0, 0));
            p.Content.RestoreGraphicsState();
        }
    }

    existingDoc.Save("watermarked-document.pdf");
}
Imports GemBox.Pdf
Imports GemBox.Pdf.Content
Imports GemBox.Pdf.Forms
Imports GemBox.Pdf.Security

' Set license (use FREE-LIMITED-KEY for evaluation)
ComponentInfo.SetLicense("FREE-LIMITED-KEY")

' Create a new PDF document from scratch
Using document = New PdfDocument()
	' Add a page with custom size
	Dim page = document.Pages.Add()

	' Create formatted text with multiple styles
	Using formattedText = New PdfFormattedText()
		formattedText.FontSize = 24
		formattedText.FontFamily = New PdfFontFamily("Arial")
		formattedText.Color = PdfColor.FromRgb(0.2, 0.2, 0.6)
		formattedText.AppendLine("GemBox.Pdf Document Example")

		formattedText.FontSize = 12
		formattedText.Color = PdfColor.FromRgb(0, 0, 0)
		formattedText.AppendLine("This document demonstrates PDF creation and manipulation features.")

		' Draw text to the page
		page.Content.DrawText(formattedText, New PdfPoint(50, 700))
	End Using

	' Add a form to the document
	Dim form = document.Form

	' Create text field
	Dim textField = form.Fields.AddText(page, 50, 600, 200, 30)
	textField.Name = "CustomerName"
	textField.Value = "Enter your name"
	textField.Format.Fill.Color = PdfColor.FromRgb(0.95, 0.95, 0.95)

	' Create checkbox
	Dim checkBox = form.Fields.AddCheck(page, 50, 550, 20, 20)
	checkBox.Name = "Agreement"
	checkBox.Checked = False

	' Add descriptive text next to checkbox
	Using checkboxLabel = New PdfFormattedText()
		checkboxLabel.Append("I agree to the terms and conditions")
		page.Content.DrawText(checkboxLabel, New PdfPoint(80, 555))
	End Using

	' Create submit button
	Dim submitButton = form.Fields.AddButton(page, 50, 500, 100, 30)
	submitButton.Name = "Submit"
	submitButton.Actions.Activate = PdfActionType.Named

	' Add button appearance
	Using buttonText = New PdfFormattedText()
		buttonText.Append("Submit Form")
		buttonText.FontSize = 14
		buttonText.Color = PdfColor.FromRgb(1, 1, 1)

		' Create button appearance stream
		Dim appearance = submitButton.Appearance.Normal
		appearance.Fill.Color = PdfColor.FromRgb(0.2, 0.4, 0.8)
		appearance.Stroke.Color = PdfColor.FromRgb(0.1, 0.2, 0.4)
		appearance.Stroke.Width = 1

		' Draw button background
		appearance.DrawRectangle(New PdfPoint(0, 0), New PdfSize(100, 30), True, True)

		' Draw button text
		appearance.DrawText(buttonText, New PdfPoint(20, 10))
	End Using

	' Add a table using low-level graphics
	Dim tableTop = 400
	Dim tableLeft = 50
	Dim cellWidth = 150
	Dim cellHeight = 30

	' Draw table headers
	page.Content.DrawRectangle(New PdfPoint(tableLeft, tableTop), New PdfSize(cellWidth * 3, cellHeight), True, True)

	Using headerText = New PdfFormattedText()
		headerText.FontSize = 12
		headerText.Color = PdfColor.FromRgb(1, 1, 1)
		headerText.Append("Product")
		page.Content.DrawText(headerText, New PdfPoint(tableLeft + 10, tableTop + 10))

		headerText.Clear()
		headerText.Append("Quantity")
		page.Content.DrawText(headerText, New PdfPoint(tableLeft + cellWidth + 10, tableTop + 10))

		headerText.Clear()
		headerText.Append("Price")
		page.Content.DrawText(headerText, New PdfPoint(tableLeft + cellWidth * 2 + 10, tableTop + 10))
	End Using

	' Draw table data rows
	Dim rowData = {
		New With {
			Key .Product = "PDF Library",
			Key .Quantity = "1",
			Key .Price = "$890"
		},
		New With {
			Key .Product = "Support Plan",
			Key .Quantity = "1",
			Key .Price = "$299"
		},
		New With {
			Key .Product = "Training",
			Key .Quantity = "2",
			Key .Price = "$500"
		}
	}

	Dim currentY = tableTop - cellHeight
	For Each row In rowData
		' Draw cell borders
		page.Content.DrawRectangle(New PdfPoint(tableLeft, currentY), New PdfSize(cellWidth, cellHeight), False, True)
		page.Content.DrawRectangle(New PdfPoint(tableLeft + cellWidth, currentY), New PdfSize(cellWidth, cellHeight), False, True)
		page.Content.DrawRectangle(New PdfPoint(tableLeft + cellWidth * 2, currentY), New PdfSize(cellWidth, cellHeight), False, True)

		' Draw cell content
		Using cellText = New PdfFormattedText()
			cellText.FontSize = 11
			cellText.Append(row.Product)
			page.Content.DrawText(cellText, New PdfPoint(tableLeft + 10, currentY + 10))

			cellText.Clear()
			cellText.Append(row.Quantity)
			page.Content.DrawText(cellText, New PdfPoint(tableLeft + cellWidth + 10, currentY + 10))

			cellText.Clear()
			cellText.Append(row.Price)
			page.Content.DrawText(cellText, New PdfPoint(tableLeft + cellWidth * 2 + 10, currentY + 10))
		End Using

		currentY -= cellHeight
	Next row

	' Apply security settings
	Dim securitySettings = document.SecuritySettings
	securitySettings.DocumentOpenPassword = "user123"
	securitySettings.PermissionsPassword = "owner123"
	securitySettings.Permissions = PdfPermissions.AllowPrint Or PdfPermissions.AllowFormFill

	' Save the document
	document.Save("gembox-example.pdf")
End Using

' Example: Manipulating existing PDF
Using existingDoc = PdfDocument.Load("existing-document.pdf")
	' Extract text from first page
	Dim page = existingDoc.Pages(0)
	Dim text = page.Content.GetText()
	Console.WriteLine($"Extracted text: {text}")

	' Add watermark to all pages
	For Each p In existingDoc.Pages
		Using watermark = New PdfFormattedText()
			watermark.Append("CONFIDENTIAL")
			watermark.FontSize = 50
			watermark.Color = PdfColor.FromRgb(0.5, 0.5, 0.5)
			watermark.Opacity = 0.3

			' Calculate center position
			Dim pageWidth = p.MediaBox.Width
			Dim pageHeight = p.MediaBox.Height
			Dim textWidth = watermark.Width
			Dim textHeight = watermark.Height

			Dim x = (pageWidth - textWidth) \ 2
			Dim y = (pageHeight - textHeight) \ 2

			' Draw watermark diagonally
			p.Content.SaveGraphicsState()
			p.Content.SetTransform(1, 0, 0, 1, x, y)
			p.Content.SetTransform(0.7071, 0.7071, -0.7071, 0.7071, 0, 0)
			p.Content.DrawText(watermark, New PdfPoint(0, 0))
			p.Content.RestoreGraphicsState()
		End Using
	Next p

	existingDoc.Save("watermarked-document.pdf")
End Using
$vbLabelText   $csharpLabel

この例は、GemBox.Pdfの低レベルPDF操作の強みを強調しており、フォーム作成、グラフィックス描画、および文書のセキュリティ機能を示しています。 コードはIronPDFのHTMLアプローチよりも冗長ですが、PDFのあらゆる側面を精密に制御できます。

これらのライブラリのHTMLからPDFへの変換の対応方法

HTMLからPDFへの変換のアプローチは、IronPDFとGemBox.Pdfの間の最も重要な違いの一つです。

IronPDFのHTML to PDFアプローチ

IronPDFはHTMLからPDFへの変換を主な焦点としてゼロから開発されました。 ライブラリには、HTML、CSS、およびJavaScriptをウェブブラウザと同様に処理するフルChromeレンダリングエンジンが含まれています。 これにより、以下が実現されます。

  • 真のブラウザーレンダリング: Google Chromeと同じBlinkエンジンを使用
  • 完全なウェブ標準: CSS3、HTML5、フレックスボックス、グリッド、および最新のJavaScriptを完全にサポート
  • 動的コンテンツ: レンダリング前にJavaScriptを実行し、AJAXコンテンツや動的要素をキャプチャ
  • レスポンシブデザイン: メディアクエリとレスポンシブレイアウトを処理
  • 外部リソース: URLから画像、スタイルシート、およびフォントを自動的に取得

GemBoxの限定的なHTMLサポート

GemBox.Pdf自体はHTMLからPDFへの変換をサポートしていません。 GemBoxでHTMLをPDFに変換するには、開発者は以下を行う必要があります。

  1. 別途GemBox.Documentを購入する(追加$890)
  2. GemBox.Documentを使用してHTMLをDOCXに変換する
  3. 次にDOCXをPDFに変換する

このアプローチには重大な制約があります。

  • JavaScriptサポートなし: 動的コンテンツを処理できない
  • CSSサポートの制限: 多くの最新のCSS機能がサポートされない
  • スタイルの問題: 境界、複雑なレイアウトなどに関する既知の問題がスタックオーバーフローの議論で指摘されています
  • 印刷最適化のみ: 印刷用に特別に書式化されたHTMLが必要
  • 追加費用: 2つのライブラリを購入する必要がある

モダンCSSフレームワークサポート:重要な違い

Bootstrap、Tailwind CSS、FoundationなどのモダンなCSSフレームワークとの作業時に、IronPDFのChromeベースのレンダリングが最も際立つ利点の一つになります。 これらのフレームワークは現代のウェブアプリケーションの基盤となっており、PDFでの正確なレンダリングが多くのユースケースで必要不可欠です。

IronPDF: モダンなフレームワークの完全サポート

IronPDFのChromeレンダリングエンジンは、すべてのモダンなCSSフレームワークを完全にネイティブでサポートしています。

  • Bootstrap 5: フレックスボックスと CSS グリッドの完全サポートでレスポンシブレイアウトを実現
  • Tailwind CSS: 完全なユーティリティファーストCSSフレームワークサポート
  • Real-world examples: Renders the Bootstrap homepage and Bootstrap templates pixel-perfect
  • モダンCSS3機能: アニメーション、変形、トランジション、カスタムプロパティ
  • レスポンシブデザイン: メディアクエリとビューポートベースのレイアウトがシームレスに機能

コード例: Bootstrap形式からPDFへ

using IronPdf;

var renderer = new ChromePdfRenderer();

string bootstrapForm = @"
<!DOCTYPE html>
<html>
<head>
    <link href='https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css' rel='stylesheet'>
</head>
<body>
    <div class='container mt-5'>
        <h1 class='mb-4'>Customer Registration</h1>
        <form class='needs-validation'>
            <div class='row g-3'>
                <div class='col-md-6'>
                    <label class='form-label'>First Name</label>
                    <input type='text' class='form-control' value='John'>
                </div>
                <div class='col-md-6'>
                    <label class='form-label'>Last Name</label>
                    <input type='text' class='form-control' value='Smith'>
                </div>
            </div>
            <div class='mt-4'>
                <button class='btn btn-primary' type='submit'>Submit</button>
            </div>
        </form>
    </div>
</body>
</html>";

var pdf = renderer.RenderHtmlAsPdf(bootstrapForm);
pdf.SaveAs("bootstrap-form.pdf");
using IronPdf;

var renderer = new ChromePdfRenderer();

string bootstrapForm = @"
<!DOCTYPE html>
<html>
<head>
    <link href='https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css' rel='stylesheet'>
</head>
<body>
    <div class='container mt-5'>
        <h1 class='mb-4'>Customer Registration</h1>
        <form class='needs-validation'>
            <div class='row g-3'>
                <div class='col-md-6'>
                    <label class='form-label'>First Name</label>
                    <input type='text' class='form-control' value='John'>
                </div>
                <div class='col-md-6'>
                    <label class='form-label'>Last Name</label>
                    <input type='text' class='form-control' value='Smith'>
                </div>
            </div>
            <div class='mt-4'>
                <button class='btn btn-primary' type='submit'>Submit</button>
            </div>
        </form>
    </div>
</body>
</html>";

var pdf = renderer.RenderHtmlAsPdf(bootstrapForm);
pdf.SaveAs("bootstrap-form.pdf");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

GemBox: モダンなフレームワークのサポートなし

GemBox.PdfはネイティブHTMLレンダリングを欠き、HTML変換にGemBox.Documentに依存しなければならないため、モダンなCSSフレームワークには厳しい制約があります。

  • Bootstrapサポートなし: フレックスボックスとCSSグリッド機能は正しくレンダリングされない
  • Tailwind CSSなし: ユーティリティクラスとモダンなレイアウトはサポートされない
  • 手動の回避策が必要: 印刷に最適化されたHTMLバージョンを作成する必要がある
  • CSS3の制限: 多くのモダンなCSS機能は単純に機能しない
  • 追加の複雑さ: 二段階の変換プロセス(HTML → DOCX → PDF)は、一貫性の欠如をもたらす

開発者間の議論によると、境界やレイアウトなどの基本的なCSS機能でも、GemBoxのHTML変換アプローチでは問題になる可能性があります。

現実の影響: あなたのアプリケーションがそのUIにBootstrapを使用し、あなたのウェブインターフェースに一致するPDFレポートやエクスポートを生成する必要がある場合、IronPDFは直接的な解決策を提供しますが、GemBoxは大幅な再設計または手動での回避策が必要です。

CSSフレームワークの互換性の詳細については、Bootstrap & Flexbox CSSガイドを参照してください。

どちらのライブラリが異なるPDFタスクで優れているか?

各ライブラリがどの点で優れているかを把握することは、特定のニーズに最適なツールを選ぶのに役立ちます。

IronPDFが優れている点

IronPDFは、以下のシナリオで優れたパフォーマンスを示します。

1. ウェブアプリケーションのPDF生成

SaaSアプリケーション、ウェブポータル、およびウェブコンテンツをPDFに変換する必要があるシステムに最適です。 Chromeレンダリングエンジンにより、Bootstrap、Tailwind CSS、カスタムフレームワークを使用する複雑なウェブレイアウトが完璧にレンダリングされます。

2. 動的レポート生成

レポートにチャート(Chart.js, D3.js)、動的データビジュアライゼーション、またはJavaScriptでレンダリングされたコンテンツが含まれる場合、IronPDFはすべてを正確にキャプチャします。 これにより、ビジネスインテリジェンスダッシュボードやデータ駆動アプリケーションに最適です。

3. 請求書と文書テンプレート

請求書、領収書、ビジネス文書のためのHTML/CSSテンプレートの使用により、デザイナーはPDF固有のAPIを学ばずにテンプレートを作成できます。変更は馴染みのあるウェブ技術を使用して迅速に行うことができます。

4. 迅速な開発プロジェクト

単純なAPIとHTMLベースのアプローチにより、開発時間が大幅に短縮されます。開発者は、複雑なPDFを数分で作成できます。

5. クロスプラットフォームデプロイメント

Windows, Linux, macOS, Docker, およびクラウドプラットフォームへのネイティブサポートにより、IronPDFは多様な環境でのデプロイメントを簡素化します。

GemBox.Pdfが優れている点

GemBox.Pdfは、以下の領域でその強みを示します。

1. 低レベルのPDF操作

PDF構造を精密に制御する必要がある場合、GemBox.Pdfのオブジェクト指向アプローチは、PDF要素、ストリーム、ディクショナリへの直接アクセスを提供します。

2. フォームが多いアプリケーション

PDFフォームを多用するアプリケーションにおいて、GemBox.Pdfは複雑なインタラクティブフォームをプログラムで操作するための包括的なフォームフィールド操作を提供します。

3. OCRの要件

内蔵OCR機能により、GemBox.Pdfは追加のライブラリなしでスキャンされた文書のテキストを抽出することができ、文書のデジタル化プロジェクトに適しています。

4. モバイル開発

AndroidおよびiOSプラットフォームのネイティブサポートにより、PDF機能が必要なモバイルアプリケーションに適しています。

5. 既存のPDFの修正

新しいPDFを生成するのではなく、主に既存のPDFで作業する場合、GemBox.Pdfは抽出、操作、および修正に適したツールを提供します。

インストールとセットアップの比較

両方のライブラリはNuGetを通じた簡単なインストールを提供していますが、複雑さのレベルが異なります。

IronPDFのインストール

IronPDFのインストールは非常に簡単です:

Install-Package IronPdf

または.NET CLI経由で:

dotnet add package IronPdf

パッケージには、必要なすべてのものが含まれており、Chromeレンダリングエンジンも含まれています。ほとんどのユースケースにおいて追加の構成や依存関係は必要ありません。

特定のデプロイメントシナリオ用に、IronPDFは以下を提供しています:

  • IronPdf.Slim: ランタイムにプラットフォーム固有のコンポーネントをダウンロードする軽量パッケージ
  • IronPdf.Linux: Linuxデプロイメント用に事前構成
  • IronPdf.MacOs: macOS環境に最適化

GemBox.Pdfのインストール

GemBox.Pdfのインストールは基本的なPDF操作に対しても簡単です。

Install-Package GemBox.Pdf

しかし、HTMLからPDFへの変換には以下が必要です。

Install-Package GemBox.Document

両方のライブラリはライセンスキーの設定が必要です。

// IronPDF
License.LicenseKey = "YOUR-LICENSE-KEY";

// GemBox.Pdf
ComponentInfo.SetLicense("YOUR-LICENSE-KEY");
// IronPDF
License.LicenseKey = "YOUR-LICENSE-KEY";

// GemBox.Pdf
ComponentInfo.SetLicense("YOUR-LICENSE-KEY");
' IronPDF
License.LicenseKey = "YOUR-LICENSE-KEY"

' GemBox.Pdf
ComponentInfo.SetLicense("YOUR-LICENSE-KEY")
$vbLabelText   $csharpLabel

ライセンスと価格の違いは何ですか?

ライセンスモデルを理解することで、各ソリューションの総所有コストを判断するのに役立ちます。

IronPDFのライセンス

IronPDFは透明で段階的なライセンスを提供しています(2025年の価格として):

  • Lite License: $799

    • 1開発者
    • 1場所
    • 1年のサポートとアップデート
  • Plus License: $1,199

    • 3開発者
    • 3場所
    • 1年のサポートとアップデート
  • Professional License: $2,399
    • 10開発者
    • 10場所
    • 1年のサポートとアップデート

その他のオプション:

  • ロイヤリティフリーの再配布: +$2,399
  • SaaS/OEMライセンスが利用可能
  • Iron Suiteバンドル: 9製品の$1,498

主要な利点:

  • 30日間の返金保証
  • 永久ライセンス(一括購入)
  • 開発とテストは無料
  • 開発/ステージング/本番環境へのデプロイメントが含まれる

GemBox.Pdfのライセンス

GemBoxは開発者単位のライセンスを提供しています。

  • シングルデベロッパー: $890
    • 1開発者
    • 無制限のプロジェクト
    • 1年のサポートとアップデート
    • ロイヤリティフリーのデプロイメントが含まれる

重要な考慮事項:

  • HTMLからPDFへの変換にはGemBox.Documentが必要: 追加$890
  • HTMLからPDFへの合計コスト: 最低$1,780
  • 更新時に40%割引(期限前に更新すれば60%)
  • GemBoxバンドル: 7製品で$2,200

主要な利点:

  • 30日間の返金保証
  • 永久ライセンス
  • 無制限のデプロイメントが含まれる
  • サーバーまたはOEMライセンスは不要

一般的なシナリオのコスト比較

シナリオ IronPDFのコスト GemBoxのコスト
単一開発者、HTMLからPDF $749 $1,780
3人の開発者、PDF操作のみ $1,499 $2,670
3人の開発者、HTMLからPDF $1,199 $5,340
企業(10人の開発者)、完全な機能 $2,399 $8,900+

どちらのライブラリを選ぶべきか?

IronPDFとGemBox.Pdfの選択は、具体的な要件によって異なります。

IronPDFを選択する場合:

  • HTMLからPDFへの変換が主要な要件の場合: IronPDFのChromeベースのレンダリングは比類のないものです
  • 現代のウェブサポートが必要な場合: 完全なCSS3、HTML5、およびJavaScript機能
  • 迅速な開発が重要な場合: シンプルなAPIが市場投入時間を短縮
  • 動的コンテンツと作業する場合: JavaScriptの実行がリアルタイムデータをキャプチャ
  • クロスプラットフォームのデプロイメントが必要な場合: クラウドおよびコンテナ環境の優れたサポート
  • 予算が重要な考慮事項の場合: HTMLからPDFへのシナリオでの低いエントリーコストとより良い価値

GemBox.Pdfを選択する場合:

  • 低レベルのPDF制御が不可欠な場合: PDFオブジェクトおよび構造への直接アクセス
  • モバイルプラットフォームサポートが必要な場合: AndroidおよびiOSのネイティブ互換性
  • OCRが主要な要件の場合: 追加の依存関係なしでの内蔵OCR
  • 主に既存のPDFで作業する場合: 強力な操作および抽出機能
  • HTMLからPDFへの変換が必要でない場合: 未使用のGemBox.Documentに支払う必要がない
  • 無制限の配布が重要な場合: ロイヤリティフリーの再配布が含まれる

両方のライブラリを使用することを検討する場合:

一部の組織は、以下のようにアプリケーションの異なる部分に対して両方のライブラリを使用することに価値を見出します。

  • IronPDFはレポート生成とHTMLからPDFへの変換用
  • GemBox.Pdfはフォーム処理とPDF操作用

選んだライブラリでの開始方法

両方のライブラリは、機能を評価するための無料試用版を提供しています。

IronPDFを試す

  1. NuGetパッケージをインストール
  2. 開発にライセンスキーは不要
  3. 試用モードではPDFに透かしが表示されます
  4. 評価期間中はすべての機能にアクセス可能

IronPDF無料試用版をダウンロード

GemBox.Pdfを試す

  1. NuGetパッケージをインストール
  2. ComponentInfo.SetLicense("FREE-LIMITED-KEY")を使用
  3. 無料モードでは2ページに制限されています
  4. 制限を解除するにはアップグレード

視覚的なインストールガイド

Visual Studioのグラフィカルインターフェイスを好む開発者のために、両方のライブラリをインストールするためのステップバイステップガイドです。

新しいASP.NETプロジェクトの作成

ASP.NET Webアプリケーションの選択を示すVisual Studioの新しいプロジェクトダイアログ(.NET Frameworkオプション付き) PDF生成プロジェクトの基礎を築くためのASP.NET Webアプリケーションを作成するためのVisual Studioの新しいプロジェクトダイアログ

PDFライブラリ統合用のWebフォームオプションを強調したASP.NETプロジェクトテンプレート選択画面 Webフォームをプロジェクトテンプレートとして選択 - IronPDFとGemBox.Pdfの両方の実装に適しています

NuGetを介したPDFライブラリのインストール

PDFライブラリを追加するためにNuGetパッケージオプションを管理するソリューションエクスプローラーのコンテキストメニュー プロジェクトを右クリックしてNuGetパッケージマネージャーを通じてライブラリをインストール

PDFライブラリをインストールするためのVisual Studioプロジェクトメニューに表示されるNuGetパッケージの管理オプション Visual Studioのプロジェクトメニューを介してNuGetパッケージマネージャーにアクセスする代替方法

IronPDFのインストール、バージョン詳細、および説明を示すNuGetパッケージマネージャーインターフェース NuGetパッケージマネージャーを通じてIronPDFをインストール - 包括的な機能説明とダウンロード数に注目

代替インストール方法

IronPDF公式ウェブサイトのダウンロードページで、手動インストール用の直接DLLダウンロードオプションを示しています IronPDFのウェブサイトでは、NuGetインストールが適していないシナリオ向けに直接DLLダウンロードを提供しています

結論

IronPDFとGemBox.Pdfの両方が、.NET開発者向けの品質の高いPDFライブラリで、それぞれに独自の強みがあります。 IronPDFはChromeレンダリングエンジンによりHTMLからPDFへの変換に優れており、現代のWebアプリケーションや動的コンテンツ生成には理想的です。 GemBox.Pdfは低レベルのPDF操作やモバイルサポートに優れており、正確なPDF制御が必要なアプリケーションに最適です。

ほとんどのWeb開発者やモダンアプリケーションを構築しているチームにとって、IronPDFは機能、使いやすさ、価値が最も優れた組み合わせを提供します。 親しみやすいWeb技術を使用してHTMLからピクセル完璧なPDFをレンダリングする能力により、開発時間と複雑さが大幅に削減されます。

しかし、GemBox.Pdfは特にモバイル開発やPDFフォーム処理やOCR要件に重点を置いたアプリケーションのための特殊なシナリオにおいて堅実な選択肢です。

HTMLコンテンツをプロフェッショナルなPDFに変換する準備はできていますか? IronPDFの無料トライアルを始める、そしてChrome品質のレンダリングを.NETアプリケーションで体験してください。 包括的なドキュメント、豊富なコード例、および応答性の高いサポートにより、PDFの生成は数分で行われ、時間を必要としません。

ご注意GemBox.PdfとGemBox.Documentは各所有者の登録商標です。 このサイトはGemBox.PdfまたはGemBox.Documentと提携しておらず、支援または推薦も受けていません。 すべての製品名、ロゴ、およびブランドは各所有者の所有物です。 比較は情報提供のみを目的としており、執筆時点で公開されている情報を反映しています。

よくある質問

C# で HTML を PDF に変換するにはどうすればいいですか?

IronPDF の RenderHtmlAsPdf メソッドを使用して、HTML 文字列を PDF に変換できます。RenderHtmlFileAsPdf を使用して HTML ファイルを PDF に変換することもできます。

これらのライブラリで既存の PDF ファイルを操作できますか?

はい、IronPDF と GemBox.Pdf の両方が既存の PDF ファイルの操作に使用できます。IronPDF は結合、分割、透かしの追加などの一般的なタスクを簡素化します。GemBox.Pdf は PDF オブジェクトの詳細な制御を提供し、複雑な操作タスクに役立ちます。

HTML から PDF への変換で IronPDF を使用する利点は何ですか?

IronPDF は、その Chrome V8 レンダリングエンジンにより、98% 以上のブラウザ忠実度で優れた HTML から PDF への変換品質を提供します。最新の CSS3、HTML5、JavaScript 実行、ウェブフォント、およびレスポンシブデザインをサポートしています。

小規模な開発チームにとってより費用対効果の高いライブラリはどちらですか?

3 人の開発者チームが HTML から PDF への変換を必要とする場合、IronPDF の Plus ライセンスは $1,499 で、GemBox の場合、3 つの GemBox.Pdf ライセンスと 3 つの GemBox.Document ライセンスで $5,340 かかります。IronPDF はチームにとってかなり良い価値を提供します。

IronPDF は大量の PDF 生成に適していますか?

はい、IronPDF は約 125 ms の HTML から PDF へのレンダリング時間と最適化された非同期/待機サポートにより、優れたパフォーマンスを発揮します。10MB 未満の効率的なメモリ使用量で、大量のウェブベースの PDF 生成に適しています。

IronPDF に含まれるサポートの種類は何ですか?

IronPDF には、開発チームへの直接アクセスと 24 〜 48 時間の典型的な応答時間を含む 24/5 エンジニアリングサポート、包括的なドキュメント、およびコード例が含まれています。

これらのライブラリで PDF/A 準拠のドキュメントを作成できますか?

はい、IronPDF は SaveAsPdfA() のような単純なメソッド呼び出しで PDF/A 準拠のドキュメントを生成でき、複数の PDF/A バージョンをサポートします。GemBox.Pdf は PDF/A ドキュメントを読み取り、変更時に準拠を維持することができます。

これらのライブラリは最新の .NET フレームワークと互換性がありますか?

はい、両方のライブラリは最新の .NET バージョンをサポートしています。IronPDF は .NET Framework 4.6.2+、.NET Core 3.1+、および .NET 5 から 10 をサポートします。GemBox.Pdf は .NET Framework 3.5+、.NET Standard 2.0、.NET 6+ をサポートしています。

クラウド展開に最適化されたライブラリはどちらですか?

IronPDF はクラウド展開に最適化されており、Azure、AWS、Docker コンテナ、およびサーバーレス環境向けの特定サポートがあります。HTML ベースのアプローチがウェブアプリケーションに自然に適合し、SaaS アプリケーションに最適な選択となります。

IronPDF をテストするための無料バージョンはありますか?

IronPDF は、ライセンスキーなしで無制限の開発とテストを可能にする無料の評価オプションを提供しており、出力には透かしが表示されます。購入前に製品を評価するのに十分な機能を提供します。

Jacob Mellor、Ironチームの最高技術責任者(CTO)
最高技術責任者(CTO)

Jacob Mellorは、Iron Softwareの最高技術責任者であり、C# PDF技術の開拓者としてその先進的な役割を担っています。Iron Softwareのコアコードベースのオリジナルデベロッパーである彼は、創業時から製品のアーキテクチャを形作り、CEOのCameron Rimingtonと協力してNASA、Tesla、全世界の政府機関を含む50人以上の会社に成長させました。

Jacobは、1998年から2001年にかけてマンチェスター大学で土木工学の第一級優等学士号(BEng)を取得しました。1999年にロンドンで最初のソフトウェアビジネスを立ち上げ、2005年には最初の.NETコンポーネントを作成し、Microsoftエコシステムにおける複雑な問題の解決を専門にしました。

彼の旗艦製品であるIronPDFとIronSuite .NETライブラリは、全世界で3000万以上のNuGetインストールを達成しており、彼の基本コードが世界中で使用されている開発者ツールを支えています。商業的な経験を25年間積み、コードを書くことを41年間続けるJacobは、企業向けのC#、Java、およびPython PDF技術の革新を推進し続け、次世代の技術リーダーを指導しています。