PDF ツール

IronPDFとApryse C#の比較

Curtis Chau
Curtis Chau
更新日:

なぜIronPDFとApryse C# PDFライブラリを比較するのか?

IronPDFとApryse C#は、.NET向けの著名なPDFライブラリであり、それぞれ独自の強みを持っています。IronPDFは、完全なBootstrapサポートを備えたHTMLからPDFへの変換や、豊富な編集機能に優れています。一方、Apryseはドキュメントの注釈や墨消しに特化しており、エンタープライズのコンプライアンス要件に対応しています。

C#開発者として、アプリケーションでドキュメントを生成・編集・表示する際に、PDF関連のタスクに直面することがよくあります。信頼できるPDFライブラリは、効率化のために不可欠です。これらのライブラリは、ドキュメントの変換、テキストの編集、PDF内の画像処理など、複雑な操作のための組み込み機能を提供します。これらがなければ、すべての機能を一から実装する必要があり、時間がかかるだけでなくエラーも発生しやすくなります。

この比較では、人気のある2つのPDFライブラリ、IronPDFとApryse C#を取り上げます。IronPDFは、.NET環境でのPDF操作を簡素化する信頼性の高い機能を提供し、HTMLからPDFへの変換から高度なドキュメント編集まで対応します。Apryse C#は、効率性と使いやすさに重点を置いた、シンプルなPDF操作を実現します。本分析では、それぞれのライブラリの具体的な機能を検証し、プロジェクトに最適な選択肢を見極める手助けをします。

Apryse C# PDFライブラリとは?

Apryseのホームページは、コードエディタとドキュメントビューアのインターフェースがコンピュータモニターに表示されているドキュメント処理SDKを示しています

Apryse C#は、.NETアプリケーション向けに設計された、C#環境でのPDF操作を簡素化するための包括的なPDFライブラリです。以前はPDFTron SDKとして知られており、正確なPDF処理機能を求める開発者のために、幅広い機能とツールを提供しています。

Apryse C#はどのような主な機能を提供していますか?

  • .NETプロジェクトへの簡単な統合: ASP.NET Coreや従来の.NET Frameworkアプリケーションを含む.NETとのスムーズな統合が可能です。
  • ドキュメントの作成と編集: ゼロからPDFを作成したり、既存のPDFを編集できます。テキスト、画像、フォーム、ページ操作(並べ替え、結合、分割)などに対応しています。
  • HTMLからPDFへの変換: 請求書、レポート、ウェブページのドキュメント化のために、HTMLコンテンツを直接PDF形式に変換できます。
  • 充実したフォームフィールドサポート: 自動化ワークフローのためのPDFフォームフィールドの作成、編集、プログラムによる入力が信頼性高く行えます。
  • テキストとコンテンツの抽出: PDFからテキストやコンテンツを抽出し、分析、検索ツール、コンテンツ管理に活用できます。
  • セキュリティと暗号化: ドキュメントの暗号化、権限管理、デジタル署名など、完全なセキュリティ機能を備えています。
  • 高度なPDF機能: 注釈、ブックマーク、ハイパーリンクなど、インタラクティブなPDFに対応しています。

IronPDF C#ライブラリとは?

IronPDFのホームページに表示された、HTMLからPDFへの変換用C#コード例とNuGetインストールコマンド

IronPDFは、.NET開発者向けに設計された多機能なPDFライブラリです。複雑なPDF操作を簡素化し、C#アプリケーション内で直接作成、編集、変換を可能にします。Java、Python、C#など複数のプログラミング言語に対応しており、IronPDFは多様なPDF処理ニーズに効率的かつ信頼性高く応えます。

IronPDFはどのような主な機能を提供していますか?

C#コンソールアプリケーションを作成するには?

Visual Studioでコンソールアプリケーションを作成することで、IronPDFやApryse C#などのPDFライブラリを利用した.NET開発プロジェクトの基盤を構築できます。以下の手順で開始してください。

Visual Studioを起動するには?

お使いのコンピューターでVisual Studioを開きます。まだVisual Studioをインストールしていない場合は、公式Microsoftウェブサイトからダウンロードし、ご自身のニーズに合ったバージョンを選択してインストールしてください。

新しいプロジェクトを作成するには?

Visual Studioが起動したら、最初のダッシュボードから「新しいプロジェクトの作成」を選択します。

Visual Studio 2022のスタート画面。「はじめに」メニューに、リポジトリのクローン、プロジェクトまたはソリューションの開く、ローカルフォルダーの開く、新しいプロジェクトの作成などのオプションが表示されています。

どのプロジェクトタイプを選択すればよいですか?

「新しいプロジェクトの作成」ウィンドウでは、さまざまなプロジェクトテンプレートが表示されます。検索ボックスに「Console」と入力するか、リストから「Console Application」を探してください。C#専用のテンプレートを選択します。

Visual Studioの「新しいプロジェクトの作成」ダイアログで、Console App、Blazor Web App、Web APIなどのASP.NET CoreおよびC#プロジェクトテンプレートが表示されている様子。

プロジェクトはどのように構成しますか?

「Console Application」を選択したら、「次へ」をクリックします。新しいプロジェクトを構成します。

  • プロジェクト名: プロジェクトの説明的な名前を入力します。

  • 場所: 保存先を選択します。

  • ソリューション名: デフォルトではプロジェクト名と同じですが、カスタマイズ可能です。

    Visual Studioのプロジェクト構成画面で、「IronPDF vs Apryse」という名前の新しいC#コンソールアプリプロジェクトの作成、プロジェクトの保存場所、ソリューション設定が表示されている様子。

  • フレームワーク: .NETのバージョンを選択します。最新バージョンが特別な要件がない限り推奨されます。

    コンソールアプリケーションの構成画面で、.NET 8.0フレームワークの選択、トップレベルステートメントやネイティブAOTパブリッシングのオプションが表示されている様子

プロジェクト作成を完了するには?

プロジェクト設定を構成したら、「作成」をクリックします。Visual StudioがデフォルトのProgram.csファイルを含む新しいコンソールアプリケーションプロジェクトをセットアップします。

プロジェクト構成はどうなっていますか?

ソリューションエクスプローラーウィンドウで生成されたプロジェクト構成を確認します。コンソールアプリケーションの場合、主にProgram.csファイルで作業し、ここにC#コードを書きます。

IronPDFライブラリはどのようにインストールしますか?

IronPDFを.NETプロジェクトに統合することで、PDF操作の全機能を利用できます。複数のインストール方法があり、ワークフローの好みに応じて柔軟に選択できます。

NuGetパッケージマネージャーを使ったインストール方法は?

Visual StudioのNuGetパッケージマネージャーは、ライブラリ管理用のグラフィカルインターフェースを提供します。

  1. Visual Studioでプロジェクトを開きます。
  2. ソリューションエクスプローラーでプロジェクトを右クリックし、「NuGetパッケージの管理」を選択します。
  3. 「参照」タブをクリックし、「IronPDF」で検索します。
  4. 検索結果からIronPDFを選択し、「インストール」をクリックします。

NuGetパッケージマネージャーでIronPDFライブラリの検索結果(バージョン2024.2.2)、プラットフォーム固有のChrome依存関係やIronPdf.Slimなどの関連パッケージが表示されている様子。

コマンドラインでインストールするには?

パッケージマネージャーコンソールを使用すると、コマンドラインから直接インストールできます。

  1. Visual Studio プロジェクトを開きます。
  2. ツール > NuGet パッケージマネージャー > パッケージマネージャーコンソールに移動します。
  3. 次のコマンドを入力します。

PM > Install-Package IronPdf

このコマンドは、最新のIronPDFバージョンをプロジェクトにインストールします。

NuGetから直接ダウンロードするには?

統合前にパッケージを手動でダウンロードできます。

  1. NuGetウェブサイトにアクセスし、「IronPDF」で検索します。

  2. IronPDFパッケージページで「Download Package」をクリックし、.nupkgファイルを取得します。

    IronPDFバージョン2024.2.2のNuGetパッケージページ。インストールコマンド、合計8.2Mダウンロード数、.NET 5.0、.NET Core 2.0、.NET Framework 4.6.2などの対応フレームワークが表示されています。

  3. ダウンロードしたパッケージを、ソリューションエクスプローラー > プロジェクトを右クリック > 「追加 > 参照」から手動で追加します。

どちらの方法でもIronPDFが正常に統合され、強力なPDF処理機能を利用できるようになります。

Apryse C#をインストールするには?

Apryse C#のプロジェクトへの統合方法は、.NET Frameworkまたは.NET Core環境によって異なります。以下は一般的なインストール手順です。

.NET Framework用Apryseのインストール方法

  1. Apryse SDK for Windowsをダウンロード: [.NET Frameworkアプリケーション向けのSDKをダウンロードするには、Apryse SDK for Windowsページにアクセスしてください。

    Apryse C# .NET PDFライブラリのダウンロードページ。SDKダウンロードボタンと商用ライセンス要件が表示されています。

  2. SDKを展開: ダウンロード後、SDKをシステム上の分かりやすい場所に展開します。

  3. Apryseトライアルキーを取得: Apryseプラットフォームに登録し、トライアル機能を有効化するためのトライアルキーを取得します。

  4. プロジェクトのセットアップ: Visual Studioで新しい.NET Frameworkコンソールアプリケーションを作成し、展開したSDKのLibフォルダーをプロジェクトディレクトリに追加します。

  5. 参照の追加: プロジェクト内の参照を右クリックし、「参照の追加」を選択して、コピーしたPDFNetLoader.dllおよびアーキテクチャ(x86またはx64)に適したPDFNet.dllがあるLibフォルダーを指定します。PDFNet.dllの「ローカルコピー」プロパティはfalseに設定してください。

  6. App.configの設定: App.configファイルでloadFromRemoteSources設定がtrueになっていることを確認します。

SDKにはサンプルフォルダーが含まれており、直接ソリューションとして開いて実行できます。## IronPDFの高度な機能

HTMLからPDFへの変換

IronPDFは、HTMLをPDFドキュメントに変換する際に非常に効果的です。これは、レポート、請求書、またはウェブページのスナップショットを生成するウェブアプリケーションにとって重要な機能です。このライブラリは、HTML、CSS、JavaScriptを正確にレンダリングし、生成されたPDF内でウェブコンテンツのレイアウトやスタイルを保持します。

HTML文字列からPDFへの変換

HTML文字列を直接PDFに変換することで、アプリケーションが生成したコンテンツや保存された変数から動的にドキュメントを作成できます。この方法は、ユーザー入力に基づいたカスタマイズされたレポート、領収書、またはドキュメントの作成に役立ちます。

using IronPdf;

// Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;

// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";

// Instantiate a PDF renderer
var renderer = new ChromePdfRenderer();

// Define a simple HTML string to convert to PDF
string htmlContent = @"
<!DOCTYPE html>
<html lang='en'>
<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>My PDF</title>
    <style>
        body {
            font-family: Arial, sans-serif;
        }
        h1 {
            color: #333;
            text-align: center;
        }
        p {
            color: #666;
            text-align: justify;
        }
    </style>
</head>
<body>
    <h1>Welcome to My PDF</h1>
    <p>This is a sample paragraph demonstrating how to create a PDF from HTML using IronPdf in C#.</p>
    <p>You can add more content here as needed.</p>
</body>
</html>";

// Render the HTML string as a PDF
var pdf = renderer.RenderHtmlAsPdf(htmlContent);

// Save the resulting PDF to a file
pdf.SaveAs("output.pdf");

HTMLファイルからPDFへの変換

ディスク上に保存されているHTMLファイルがある場合、IronPDFはこれらのファイルをPDFドキュメントに変換できます。この方法は、既存のHTMLドキュメント、テンプレート、またはプロジェクトやサーバーに保存されたレポートに最適です。

using IronPdf;

// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";

// Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;

// Instantiate a PDF renderer
var renderer = new ChromePdfRenderer();

// Render the HTML file as a PDF
var pdf = renderer.RenderHtmlFileAsPdf("invoice.html");

// Save the resulting PDF to a file
pdf.SaveAs("file.pdf");

URLからPDFへの変換

IronPDFは、URLを指定することでライブウェブページをPDFドキュメントに変換できます。この機能は、複雑なレイアウト、CSS、JavaScriptで生成されたコンテンツを含む、現在のウェブページの状態をキャプチャします。

using IronPdf;

// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";

// Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;

// Instantiate a PDF renderer
var renderer = new ChromePdfRenderer();

// Render the URL as a PDF
var pdf = renderer.RenderUrlAsPdf("https://dotnet.microsoft.com/en-us/download/dotnet-framework");

// Save the resulting PDF to a file
pdf.SaveAs("url.pdf");

Bootstrapおよび最新CSSフレームワークのサポート

最新のウェブアプリケーションからPDFを生成する際、BootstrapやCSSフレームワークへの完全な対応は不可欠です。多くの組織がウェブインターフェースにBootstrapを利用しているため、PDFへの正確な変換はレポート、請求書、ドキュメント作成において重要です。

IronPDFがサポートするBootstrapの機能

IronPDF:完全なBootstrapサポート

  • Bootstrap 5: フレックスボックスレイアウト、CSS Grid、ユーティリティクラス、レスポンシブコンポーネントを完全サポート
  • Bootstrap 4: カードシステム、ナビゲーションコンポーネント、フレックスユーティリティを完全サポート
  • Tailwind CSS: すべてのユーティリティクラスを正確にレンダリング
  • Foundation: グリッドシステムおよびコンポーネントを完全サポート
  • 最新CSS3: フルフレックスボックス、CSS Grid、カスタムプロパティ、アニメーション、トランジション

IronPDFは、Bootstrapのホームページおよびすべての公式サンプルをピクセル単位で正確にレンダリングします。

コード例:ビジネスメトリクスダッシュボード

using IronPdf;

// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";

var renderer = new ChromePdfRenderer();
string bootstrapDashboard = @"
<!DOCTYPE html>
<html>
<head>
    <link href='https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css' rel='stylesheet'>
    <style>
        .metric-card { transition: transform 0.2s; }
        .metric-card:hover { transform: translateY(-5px); }
        .trend-up { color: #28a745; }
        .trend-down { color: #dc3545; }
    </style>
</head>
<body>
    <div class='container-fluid py-4'>
        <div class='d-flex justify-content-between align-items-center mb-4'>
            <h1 class='display-5'>Business Performance Dashboard</h1>
            <div class='text-muted'>Last updated: March 2025</div>
        </div>

        <div class='row g-4 mb-4'>
            <div class='col-md-3'>
                <div class='card metric-card shadow-sm border-start border-primary border-4'>
                    <div class='card-body'>
                        <div class='d-flex justify-content-between align-items-center mb-2'>
                            <h6 class='text-muted text-uppercase mb-0'>Total Revenue</h6>
                            <span class='badge bg-primary'>Q1 2025</span>
                        </div>
                        <h2 class='mb-1'>$2.4M</h2>
                        <div class='trend-up'>
                            <i>↑</i> <strong>+18.5%</strong> from last quarter
                        </div>
                    </div>
                </div>
            </div>

            <div class='col-md-3'>
                <div class='card metric-card shadow-sm border-start border-success border-4'>
                    <div class='card-body'>
                        <div class='d-flex justify-content-between align-items-center mb-2'>
                            <h6 class='text-muted text-uppercase mb-0'>New Customers</h6>
                            <span class='badge bg-success'>Active</span>
                        </div>
                        <h2 class='mb-1'>1,284</h2>
                        <div class='trend-up'>
                            <i>↑</i> <strong>+24.3%</strong> growth rate
                        </div>
                    </div>
                </div>
            </div>

            <div class='col-md-3'>
                <div class='card metric-card shadow-sm border-start border-warning border-4'>
                    <div class='card-body'>
                        <div class='d-flex justify-content-between align-items-center mb-2'>
                            <h6 class='text-muted text-uppercase mb-0'>Avg Order Value</h6>
                            <span class='badge bg-warning text-dark'>Updated</span>
                        </div>
                        <h2 class='mb-1'>$1,847</h2>
                        <div class='trend-up'>
                            <i>↑</i> <strong>+5.2%</strong> increase
                        </div>
                    </div>
                </div>
            </div>

            <div class='col-md-3'>
                <div class='card metric-card shadow-sm border-start border-info border-4'>
                    <div class='card-body'>
                        <div class='d-flex justify-content-between align-items-center mb-2'>
                            <h6 class='text-muted text-uppercase mb-0'>Satisfaction Rate</h6>
                            <span class='badge bg-info'>Excellent</span>
                        </div>
                        <h2 class='mb-1'>94.7%</h2>
                        <div class='trend-up'>
                            <i>↑</i> <strong>+2.1pts</strong> improvement
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class='row g-4'>
            <div class='col-md-8'>
                <div class='card shadow-sm'>
                    <div class='card-header bg-white d-flex justify-content-between align-items-center'>
                        <h5 class='mb-0'>Revenue Breakdown by Category</h5>
                        <div class='btn-group btn-group-sm' role='group'>
                            <button type='button' class='btn btn-outline-primary active'>Monthly</button>
                            <button type='button' class='btn btn-outline-primary'>Quarterly</button>
                            <button type='button' class='btn btn-outline-primary'>Annual</button>
                        </div>
                    </div>
                    <div class='card-body'>
                        <div class='table-responsive'>
                            <table class='table table-hover mb-0'>
                                <thead class='table-light'>
                                    <tr>
                                        <th>Category</th>
                                        <th>Revenue</th>
                                        <th>Orders</th>
                                        <th>Avg Value</th>
                                        <th class='text-end'>Trend</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td><span class='badge bg-primary me-2'>A</span>Enterprise Solutions</td>
                                        <td><strong>$1,245,000</strong></td>
                                        <td>142</td>
                                        <td>$8,768</td>
                                        <td class='text-end'><span class='badge bg-success'>+12%</span></td>
                                    </tr>
                                    <tr>
                                        <td><span class='badge bg-success me-2'>B</span>Professional Services</td>
                                        <td><strong>$687,500</strong></td>
                                        <td>458</td>
                                        <td>$1,501</td>
                                        <td class='text-end'><span class='badge bg-success'>+18%</span></td>
                                    </tr>
                                    <tr>
                                        <td><span class='badge bg-info me-2'>C</span>Standard Packages</td>
                                        <td><strong>$412,300</strong></td>
                                        <td>891</td>
                                        <td>$463</td>
                                        <td class='text-end'><span class='badge bg-success'>+8%</span></td>
                                    </tr>
                                    <tr>
                                        <td><span class='badge bg-warning me-2'>D</span>Custom Development</td>
                                        <td><strong>$55,200</strong></td>
                                        <td>12</td>
                                        <td>$4,600</td>
                                        <td class='text-end'><span class='badge bg-danger'>-3%</span></td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>

            <div class='col-md-4'>
                <div class='card shadow-sm'>
                    <div class='card-header bg-white'>
                        <h5 class='mb-0'>Quick Actions</h5>
                    </div>
                    <div class='card-body'>
                        <div class='d-grid gap-2'>
                            <button class='btn btn-primary'>Generate Full Report</button>
                            <button class='btn btn-outline-primary'>Export to Excel</button>
                            <button class='btn btn-outline-secondary'>Schedule Email</button>
                            <button class='btn btn-outline-info'>Share Dashboard</button>
                        </div>
                    </div>
                </div>

                <div class='card shadow-sm mt-3'>
                    <div class='card-header bg-white'>
                        <h5 class='mb-0'>Key Insights</h5>
                    </div>
                    <div class='card-body'>
                        <div class='alert alert-success mb-2'>
                            <small><strong>Top Performer:</strong> Enterprise Solutions leading revenue growth</small>
                        </div>
                        <div class='alert alert-info mb-2'>
                            <small><strong>Growth Driver:</strong> Professional Services showing strongest customer acquisition</small>
                        </div>
                        <div class='alert alert-warning mb-0'>
                            <small><strong>Attention Needed:</strong> Custom Development segment requires review</small>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>";

var pdf = renderer.RenderHtmlAsPdf(bootstrapDashboard);
pdf.SaveAs("business-dashboard.pdf");

出力例: Bootstrap 5のフレックスボックスベースのグリッドシステム、ボーダーユーティリティ付きカードコンポーネント、バッジ要素、レスポンシブテーブル、色分けされたメトリクスを備えたプロフェッショナルなビジネスダッシュボードPDF。すべてのレイアウトとタイポグラフィが完璧に保持されてレンダリングされます。

ApryseのCSSフレームワークの制限

ApryseのHTML2PDFモジュールは、独自のレンダリングエンジン(Chromiumではありません)を使用しており、以下のような制限が文書化されています。

  • Flexboxの部分的なサポート: Bootstrap 4/5のレイアウトが正しく表示されない場合があります
  • CSS Gridの制限: モダンなグリッドベースのデザインは多くの場合失敗します
  • JavaScriptの制約: ブラウザ環境と比べて実行が最小限です
  • フレームワーク互換性: Bootstrapコンポーネントには広範なテストが必要です

HTML2PDFのドキュメントでは、複雑なCSSが期待通りにレンダリングされない可能性があると明記されています。開発者からは、ナビゲーションバー、flexベースのカードレイアウト、レスポンシブユーティリティに関する問題が報告されています。

開発への影響: Apryseを使用するチームは、「PDF対応」CSSを並行して作成するか、Bootstrapレイアウトを大幅に簡素化する必要があり、開発工数が増加し、WebとPDF出力間のデザイン一貫性が制限されます。

完全なBootstrapフレームワークサポートとCSS3レンダリングについては、Bootstrap & Flexbox CSSガイドをご覧ください。

PDFの結合と分割

IronPDFを使えば、複数のPDFドキュメントを結合したり、PDFを小さなファイルに分割したりすることが簡単にできます。この機能は、PDFコンテンツの構造を整理する必要があるドキュメント管理システムにとって不可欠です。

using IronPdf;

// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";

// Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;

// Define HTML content for two PDFs to merge
var htmlA = @"
    <h1>PDF A</h1>
    <p>This is the content of PDF A.</p>
    <p>This is the first page of PDF A.</p>
    <div style='page-break-after: always;'></div>
    <p>This is the second page of PDF A.</p>";

var htmlB = @"
    <h1>PDF B</h1>
    <p>This is the content of PDF B.</p>
    <p>This is the first page of PDF B.</p>
    <div style='page-break-after: always;'></div>
    <p>This is the second page of PDF B.</p>";

// Instantiate a PDF renderer
var renderer = new ChromePdfRenderer();

// Render the HTML content as separate PDF documents
var pdfDocA = renderer.RenderHtmlAsPdf(htmlA);
var pdfDocB = renderer.RenderHtmlAsPdf(htmlB);

// Merge the two PDFs into one
var mergedPdf = PdfDocument.Merge(pdfDocA, pdfDocB);

// Save the merged PDF to a file
mergedPdf.SaveAs("Merged.pdf");

PDFへのウォーターマーク追加

IronPDFを使用すると、PDFページにウォーターマークを追加してブランディングや機密文書のマーキングが可能です。ライブラリがテキストおよび画像ウォーターマークの複雑さを管理し、柔軟な適用と表示を実現します。

using IronPdf;

// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";

// Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;

// Instantiate a PDF renderer
var renderer = new ChromePdfRenderer();

// Render a URL as a PDF
var pdf = renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf");

// Apply a watermark to the PDF
pdf.ApplyWatermark("<h2 style='color:red'>SAMPLE</h2>", 30, IronPdf.Editing.VerticalAlignment.Middle, IronPdf.Editing.HorizontalAlignment.Center);

// Save the watermarked PDF to a file
pdf.SaveAs("Watermarked.pdf");

PDFフォームを操作するには?

IronPDFは、インタラクティブなPDFフォームの完全な操作をサポートしています。フォームの作成、入力、送信をプログラムで行うことができ、フォーム処理の自動化やワークフローへのフォームデータ収集の統合に特に便利です。

using IronPdf;

// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";

// Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;

// Define HTML content with form elements
const string formHtml = @"
    <html>
        <body>
            <h2>Employee Information Form</h2>
            <form>
                First name: <br> 
                Last name: <br> 
                <br>
                <p>Please select your department:</p>
                <select name='department'>
                    <option value='HR'>HR</option>
                    <option value='Finance'>Finance</option>
                    <option value='IT'>IT</option>
                    <option value='Marketing'>Marketing</option>
                </select>
                <br>
                <br>
                <p>Please select your employment status:</p>
                <label for='fulltime'>Full-time</label> <br>
                <label for='parttime'>Part-time</label> <br>
                <br>
                <p>Please select your skills:</p>
                <label for='skill1'> Programming</label><br>
                <label for='skill2'> Design</label><br>
                <label for='skill3'> Marketing</label><br>
            </form>
        </body>
    </html>";

// Instantiate a PDF renderer
var renderer = new ChromePdfRenderer();
renderer.RenderingOptions.CreatePdfFormsFromHtml = true;

// Render the HTML form content as a PDF
renderer.RenderHtmlAsPdf(formHtml).SaveAs("EmployeeInfoForm.pdf");

テキストフィールド、ドロップダウンメニュー、ラジオボタン、チェックボックスなど、さまざまなフォーム要素を含むインタラクティブなPDFフォームの生成例 - フォーム作成機能を示しています。

PDFのセキュリティと暗号化はどうする?

IronPDFは、暗号化、権限設定、デジタル署名など、PDFドキュメントのセキュリティ機能を提供します。これにより、機密情報の保護やドキュメントの完全性維持が可能です。

using IronPdf;

// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";

// Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;

// Load an existing PDF file
var pdf = PdfDocument.FromFile("invoice.pdf");

// Set document security settings
pdf.SecuritySettings.OwnerPassword = "top-secret"; // Password to edit the PDF
pdf.SecuritySettings.UserPassword = "sharable";   // Password to open the PDF

// Save the secured PDF to a file
pdf.SaveAs("secured.pdf");

テキストフィールドと「Open file」「Cancel」とラベル付けされた2つのボタンがあるパスワード入力ダイアログボックス

高度な編集オプションにはどのようなものがありますか?

IronPDFは、基本的な修正を超えた高度な編集機能を提供しています。これには、ヘッダーとフッターの追加、ページレイアウトのカスタマイズ、画像やフォントの埋め込みなどが含まれます。これらの機能により、アプリケーションの要件に合わせた動的なPDF生成やカスタマイズが可能になります。

using IronPdf;

// Set your IronPDF license key
IronPdf.License.LicenseKey = "License-Key goes here";

// Secure the server environment to disable local disk access or cross-origin requests
Installation.EnableWebSecurity = true;

// Instantiate a PDF renderer
var renderer = new IronPdf.ChromePdfRenderer();

// Define multi-page HTML content with page breaks
var multiPageHtml = @"
    <p> This is 1st Page</p>
    <div style = 'page-break-after: always;' ></div>
    <p> This is 2nd Page</p>
    <div style = 'page-break-after: always;' ></div>
    <p> This is 3rd Page</p>
    <div style = 'page-break-after: always;' ></div>
    <p> This is 4th Page</p>
    <div style = 'page-break-after: always;' ></div>
    <p> This is 5th Page</p>
    <div style = 'page-break-after: always;' ></div>
    <p> This is 6th Page</p>
    <div style = 'page-break-after: always;' ></div>
    <p> This is 7th Page</p>";

// Render the HTML content as a PDF
var pdfDoc = renderer.RenderHtmlAsPdf(multiPageHtml);

// Create a header for the first page only
var firstPageHeader = new HtmlHeaderFooter();
firstPageHeader.HtmlFragment = "This is the First Page Header";
pdfDoc.AddHtmlHeaders(firstPageHeader, 1);

// Save the resulting PDF with headers to a file
pdfDoc.SaveAs("PagesWithHeaders.pdf");

PDFビューアーに、1ページ目に「This is the First Page Header」、本文に「This is 1st Page」と表示された2ページのドキュメントが表示され、左サイドバーにはページのサムネイルが見えています。

Apryse C#の高度な機能とは?

注釈やマークアップを追加するには?

Apryse C#では、PDFドキュメントに注釈やマークアップをプログラムで追加できます。これにはテキスト注釈、ハイライト、下線、図形などが含まれ、ドキュメントのレビューや補足情報の追加に不可欠です。

using pdftron;
using pdftron.PDF;
using pdftron.SDF;

class Program
{
    static void Main()
    {
        // Initialize the PDFNet library with your license key
        PDFNet.Initialize("License");

        // Open an existing PDF document
        using (PDFDoc doc = new PDFDoc("input.pdf"))
        {
            // Access the first page of the document
            Page page = doc.GetPage(1);

            // Create a text annotation on the document
            Text txt = Text.Create(doc, new Rect(10, 20, 30, 40));
            txt.SetIcon("UserIcon");
            txt.SetContents("It's an annotation!");
            page.AnnotPushBack(txt);

            // Save the modified document
            doc.Save("output.pdf", SDFDoc.SaveOptions.e_linearized);
        }
    }
}

PDFビューアーに「It's an annotation!」と書かれたテキスト注釈と、その下に小さな黄色いコメントアイコンが表示されたドキュメントが見えています。

ドキュメントをPDFに変換するには?

Apryse C#は、さまざまなドキュメント形式のPDFへの変換を可能にします。これにはOfficeドキュメント、画像、HTMLなどが含まれます。この機能により、アーカイブ、共有、表示のためにドキュメント形式を統一できます。

using pdftron;
using pdftron.PDF;

class Program
{
    static void Main()
    {
        // Initialize the PDFNet library
        PDFNet.Initialize();

        // Create a new PDF document
        PDFDoc pdfdoc = new PDFDoc();

        // Convert a Word document to PDF and add it to the PDF document
        Convert.ToPdf(pdfdoc, "input.docx");

        // Save the newly created PDF document
        pdfdoc.Save("output.pdf", SDFDoc.SaveOptions.e_linearized);
    }
}

PDFからコンテンツを抽出するには?

Apryse C#は、PDFドキュメントからテキスト、画像、その他のコンテンツの抽出に優れています。この機能は、コンテンツ分析、データ抽出、情報検索アプリケーションをサポートし、効率的なPDFコンテンツ処理を実現します。

using pdftron;
using pdftron.PDF;
using pdftron.SDF;

class Program
{
    static void Main()
    {
        // Initialize the PDFNet library
        PDFNet.Initialize();

        // Open an existing PDF document
        using (PDFDoc doc = new PDFDoc("input.pdf"))
        {
            // Iterate through each page of the document
            PageIterator itr = doc.GetPageIterator();
            for (; itr.HasNext(); itr.Next())
            {
                Page page = itr.Current();

                // Extract text from the page
                TextExtractor txt = new TextExtractor();
                txt.Begin(page);

                // Print the extracted text to the console
                Console.WriteLine(txt.GetAsText());
            }
        }
    }
}

コンソール出力に、請求書番号INV-001、日付2024年2月14日、顧客John Doe、商品詳細と合計金額$35.00を含む抽出された請求書テキストデータが表示されています。

ApryseでPDFを保護するには?

Apryse C#は、PDFドキュメントのセキュリティ確保のための完全なツールを提供します。パスワード保護の適用、ドキュメントの暗号化、ユーザー権限の管理により、機密情報を安全に保護できます。

using pdftron;
using pdftron.SDF;
using pdftron.PDF;

class Program
{
    static void Main()
    {
        // Initialize the PDFNet library
        PDFNet.Initialize();

        // Open an existing PDF document
        using (PDFDoc doc = new PDFDoc("input.pdf"))
        {
            // Initialize the security handler
            doc.InitSecurityHandler();

            // Create a new security handler
            SecurityHandler newHandler = new SecurityHandler();

            // Set the user password for the document
            newHandler.ChangeUserPassword("new_password");

            // Grant permission to print the document
            newHandler.SetPermission(SecurityHandler.Permission.e_print, true);

            // Apply the security handler to the document
            doc.SetSecurityHandler(newHandler);

            // Save the secured document
            doc.Save("output.pdf", SDFDoc.SaveOptions.e_linearized);
        }
    }
}

機密情報を墨消しするには?

Apryse C#は、PDFドキュメントから機密情報の墨消しをサポートしています。これはコンプライアンスやプライバシーの観点から不可欠な機能であり、PDF内のテキストや画像を完全に削除または隠すことができます。

using pdftron;
using pdftron.PDF;
using pdftron.SDF;

class Program
{
    static void Main()
    {
        // Initialize the PDFNet library
        PDFNet.Initialize();

        // Open an existing PDF document
        using (PDFDoc doc = new PDFDoc("input.pdf"))
        {
            // Define redaction areas on specific pages
            Redactor.Redaction[] redactions = {
                new Redactor.Redaction(1, new Rect(100, 100, 200, 200), false, "redacted"),
            };

            // Apply redactions to the document
            Redactor.Redact(doc, redactions);

            // Save the redacted document
            doc.Save("output.pdf", SDFDoc.SaveOptions.e_linearized);
        }
    }
}

利用可能なドキュメントとサポートは?

IronPDFはどのようなサポートを提供していますか?

ドキュメント: IronPDFは、完全なドキュメントを提供しており、はじめにガイドから、HTMLからPDFへの変換、PDF編集、結合、分割、セキュリティなどの高度な機能まで幅広くカバーしています。ドキュメントは、豊富なコード例と解説を交え、さまざまなPDF機能の実装方法を分かりやすく案内しています。

サポート: IronPDFは、メールサポート、チケットサポート、ライブのエンジニアリングサポートチャットなど、複数のチャネルを通じて支援を提供しています。技術チームと直接つながり、特定の問題について相談できます。アプリケーションは、フィードバックシステムを通じて即座に恩恵を受けることができます。

Iron Support Teamチャットインターフェース。エンジニアリングサポートまたはライセンシングセールスチームへの接続オプションを表示

Apryse C#はどのようなサポートを提供していますか?

ドキュメント: Apryse C#(旧PDFTron for .NET)は、完全なAPIリファレンス、開発者ガイド、多様なPDF操作タスク向けのサンプルコードを含む詳細なドキュメントを提供しています。

サポート: Apryseは、技術チームとの直接メールによるコミュニケーションを通じて、トラブルシューティングや実装に関する質問に対応しています。また、Stack Overflowで質問することも可能です。

ライセンスオプションと価格は?

IronPDFのライセンスオプションは?

IronPDFは、さまざまなプロジェクトニーズに合わせたライセンスオプションを複数提供しています。価格はLiteライセンスで$999から始まります。これらのライセンスは、開発者数、拠点数、対象プロジェクト数によって異なります。IronPDFは、ロイヤリティフリーの再配布オプションや、アドオンごとの特定価格による拡張サポートも提供しています。

IronPDFの永続ライセンスオプションには以下が含まれます:

  • Lite Edition: 価格は$999で、1開発者、1拠点、1プロジェクトに適しており、メールサポートが含まれます。
  • Plus Edition: $1,499で、最大3開発者、3拠点、3プロジェクトをカバーし、24時間メール・チャットサポート、電話サポートが利用可能です。
  • Professional Edition: $2,999で、最大10開発者、10拠点、10プロジェクトに対応し、メール、チャット、電話、画面共有サポートなど包括的なサポートを提供します。

また、月額$500で10,000APIコールを含むサブスクリプションも提供しており、追加コールは1回あたり$0.02です。無制限利用の場合は、見積もりベースの価格によるエンタープライズソリューションも用意されています。このソリューションには、無制限の永続ライセンスやAPIコールなど、さまざまな機能が含まれます。

Apryse C#のライセンスオプションとは?

Apryse C#は、機能、ドキュメントのボリューム、導入シナリオなど、特定のプロジェクト要件に基づいたカスタマイズ可能な価格設定を提供しています。Apryseの価格情報については、必ず営業チームにお問い合わせください。

連絡先情報やアプリケーション利用詳細の入力欄があるApryseの価格問い合わせフォーム

どのPDFライブラリを選ぶべきですか?

IronPDFとApryse C#の両方が、PDFを扱う.NET開発者に効果的な機能を提供します。IronPDFは、豊富なPDF操作機能で優位性を発揮します。高度な編集やIronPDFによるPDF結合など、完全な機能を備えている点が特長です。Iron Suiteパッケージを利用すれば、コストパフォーマンスに優れた価格で複数のツールにアクセスでき、さまざまなニーズに対応する信頼性の高いユーティリティを開発に導入できます。

IronPDFは、ほとんどのPDF処理シナリオにおいて、総合的な汎用性と価値提案で際立っています。最終的な選択は、プロジェクト要件や開発に必要な特定の機能に合わせて決定してください。

注意してください: Apryse C#は、それぞれの所有者の登録商標です。本サイトはApryse C#と提携、承認、またはスポンサー関係にありません。すべての商品名、ロゴ、ブランドは、それぞれの所有者に帰属します。比較は情報提供のみを目的としており、執筆時点で公開されている情報に基づいています。

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

もっと読む

関連記事