製品比較 IronPDF vs ABCpdf: 2025年にどのC# PDFライブラリがより優れたHTMLからPDFへの変換を提供するか? Jacob Mellor 更新日:8月 5, 2025 Download IronPDF NuGet Download テキストの検索と置換 テキストと画像のスタンプ Start Free Trial Copy for LLMs Copy for LLMs Copy page as Markdown for LLMs Open in ChatGPT Ask ChatGPT about this page Open in Gemini Ask Gemini about this page Open in Grok Ask Grok about this page Open in Perplexity Ask Perplexity about this page Share Share on Facebook Share on X (Twitter) Share on LinkedIn Copy URL Email article PDFファイルは、請求書の作成やさまざまなドキュメント形式の生成など、多くの業界で使用されています。クライアントの要件を効果的に満たすのに役立ちます。 .NETアプリケーションでPDF生成が必要な場合、適切なライブラリを選択することは、開発速度、出力品質、および長期のメンテナンスコストに大きく影響します。 開発者がよく検討する2つのライブラリは、IronPDFとABCpdfですが、どちらが特定のニーズに対してより良い結果をもたらすのでしょうか? この包括的な比較は、HTMLからPDFへの変換精度からライセンスモデルまで、両ライブラリの能力を調査し、情報に基づいた決定を下すのをサポートします。 私たちは、各ライブラリの強みと制約を示す実際のパフォーマンスメトリクス、APIデザイン哲学、実用的なコード例を探ります。 何千もの請求書を毎日生成するSaaSプラットフォームを構築する場合であれ、ピクセル完璧なドキュメントレンダリングを必要とする企業アプリケーションであれ、これらの違いを理解することはプロジェクトの成功にとって重要です。 IronPDFとは何ですか? IronPDFは、商用グレードのPDF生成ライブラリであり、C#ソフトウェアエンジニアが.NETプロジェクトでPDFドキュメントを編集、抽出、生成するのを助けます。 Chromeベースのレンダリングエンジンを核にして構築されたIronPDFは、HTML、CSS、およびJavaScriptを、Google Chromeでウェブページを印刷するのと同じ忠実度でPDFに変換します。 IronPDFの主な機能 IronPDFは.NET Chromiumエンジンを使用してHTMLページをPDFファイルにレンダリングします。 HTMLからPDFへでは、PDFを配置したりデザインしたりするために複雑なAPIを使用する必要はありません。 IronPDFは、標準のウェブドキュメント、すなわちHTML、ASPX、JS、CSS、および画像をサポートしています。 このライブラリのアーキテクチャは、開発者の体験を重視しながら、プロフェッショナルグレードの出力品質を維持します。 HTMLからPDFへの変換の卓越性 HTML5セマンティック要素を含むHTMLの完全サポート Flexbox、Grid、モダンなレイアウト技術を含むCSS3の完全サポート 動的コンテンツレンダリングのためのJavaScriptの実行 Googleフォントやカスタム@font-face宣言を含むウェブフォントのサポート ビューポート制御によるレスポンシブデザインのレンダリング AJAXコンテンツの待機時間を設定可能な読み込み ドキュメント操作機能 マージおよび分割: 複数のPDFを結合したり、特定のページを抽出したりする単一のメソッドコール ヘッダーとフッター: ページ番号、日付、カスタムHTMLなどの動的なコンテンツを追加 透かし: 不透明度と位置制御によるテキストまたは画像の透かしの適用 フォーム管理: HTMLフォーム要素から自動で記入可能なPDFフォームを作成 デジタル署名: 証明書管理による暗号署名の適用 暗号化: 詳細な権限を持つ128ビットおよび256ビットAES暗号化の実装 高度なレンダリング機能 マルチスレッド処理: 高性能シナリオのためのネイティブ非同期/待機サポート バッチ操作: 複数のドキュメントを同時に処理するための最適化されたメソッド メモリ効率: 大規模なドキュメント生成のために全体をメモリに読み込まずにストリーミングサポート クラウド最適化: Docker、Azure、AWSでのコンテナ化されたデプロイメント向けに設計 クロスプラットフォームアーキテクチャ IronPDFは異なる環境で一貫した動作を維持します: Windows (x86/x64) Linux (最小のDockerイメージ用のAlpineを含む) macOS (IntelとApple Silicon) Azureアプリサービス、機能、およびコンテナインスタンス AWS LambdaおよびEC2 Google Cloud Platform ABCpdfとは何ですか? ABCpdf.NET C# PDFライブラリは、Adobe PDFドキュメントの動的な読み取り、書き込み、変換、および操作のための.NETコンポーネントです。 WebSupergooによって開発されたABCpdfは、20年以上にわたり.NETコミュニティにサービスを提供し、複数のHTMLレンダリングエンジンおよび包括的なPDF操作機能を提供しています。 ABCpdfの主な機能 ABCpdfは、HTML/CSSおよびJavaScript、SVG、AJAX、Font Awesomeのような関連技術を完全にサポートしています。 このライブラリは、開発者に高レベルの便利なメソッドと低レベルのPDFオブジェクトアクセスの両方を提供します。 複数のレンダリングエンジン ABCpdfのユニークなアプローチは、次のような複数のレンダリングエンジンを提供します: ABCChromeエンジン: モダンなウェブ標準用のChromiumベース(x64のみ) Geckoエンジン: 互換性テスト用の複数バージョン MSHTMLエンジン: Internet Explorerベースのレンダリング ABCWebKitエンジン: WebKitベースのレンダリング(x64のみ) このマルチエンジンアプローチにより、開発者は特定のコンテンツに最適なレンダラーを選ぶことができますが、デプロイおよびテストの複雑さが増すこともあります。 ドキュメントインポート機能 ABCpdfは、OpenOffice.orgのような補助アプリケーションがインストールされている場合、さまざまなドキュメント形式を読み取ることができます。 サポートされている形式には以下が含まれます: Microsoft Officeドキュメント (Word, Excel, PowerPoint) PostScriptおよびEPSファイル XPS (XML Paper Specification) SVG (縮尺可能なベクターグラフィック) TIFF、JPEG 2000、RAW形式を含むさまざまな画像形式 低レベルのPDF操作 PDFオブジェクトモデルへの直接アクセス 複数アルゴリズムによるストリーム圧縮/解凍 フォントのサブセット化および埋め込みの制御 カラースペース管理および変換 コンテンツストリーム操作 パフォーマンス機能 ABCpdfは完全にマルチスレッド対応であり、C#、ASPX、およびVBを含むさまざまな.NET環境で柔軟に使用でき、高性能なマルチスレッド設定でテストされています。 このライブラリには以下が含まれます: 非常に大きなドキュメント用のGigaPDF™サポート サーバー環境向けに最適化されたメモリ使用 効率的なフォントキャッシュメカニズム バックグラウンドスレッド処理機能 モダンCSSフレームワークサポート 現代のウェブアプリケーションで作業する際、Bootstrapベースのレイアウトおよびその他のモダンCSSフレームワークをPDFに変換する能力はますます重要になります。 多くの企業アプリケーションおよびSaaSプラットフォームは、UIの一貫性のためにBootstrapに依存しており、PDF生成はこれらのレイアウトを完璧に保つ必要があります。 IronPDF: 全Bootstrapおよびモダンフレームワーク対応 IronPDFのChromiumレンダリングエンジンは、モダンCSSフレームワークの包括的なサポートを提供します: Bootstrap 5: フレックスボックスベースのレイアウト、グリッドシステム、レスポンシブユーティリティに対する完全なサポート Bootstrap 4: フレックスボックスカードデッキ、ナビゲーションバー、フォームレイアウトとの完全な互換性 Tailwind CSS: モダンなユーティリティファーストCSSフレームワークの完璧なレンダリング Foundation: すべてのグリッドおよびコンポーネントシステムがサポート モダンCSS3: フレックスボックス、CSSグリッド、アニメーション、トランジション、およびカスタムプロパティ Real-world examples: Bootstrap homepage and Bootstrap templates convert to PDF with pixel-perfect accuracy. コード例: E-Commerce Product Grid using IronPdf; var renderer = new ChromePdfRenderer(); string bootstrapProductGrid = @" <!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 my-5'> <h1 class='mb-4'>Product Catalog</h1> <div class='row row-cols-1 row-cols-md-3 g-4'> <div class='col'> <div class='card h-100'> <img src='https://via.placeholder.com/300x200' class='card-img-top' alt='Product 1'> <div class='card-body d-flex flex-column'> <h5 class='card-title'>Premium Widget</h5> <p class='card-text flex-grow-1'>High-quality widget with advanced features and excellent durability.</p> <div class='d-flex justify-content-between align-items-center mt-auto'> <span class='h4 mb-0 text-primary'>$99.99</span> <button class='btn btn-primary'>Add to Cart</button> </div> </div> </div> </div> <div class='col'> <div class='card h-100'> <img src='https://via.placeholder.com/300x200' class='card-img-top' alt='Product 2'> <div class='card-body d-flex flex-column'> <h5 class='card-title'>Standard Widget</h5> <p class='card-text flex-grow-1'>Reliable widget perfect for everyday use with great value.</p> <div class='d-flex justify-content-between align-items-center mt-auto'> <span class='h4 mb-0 text-primary'>$49.99</span> <button class='btn btn-primary'>Add to Cart</button> </div> </div> </div> </div> <div class='col'> <div class='card h-100'> <img src='https://via.placeholder.com/300x200' class='card-img-top' alt='Product 3'> <div class='card-body d-flex flex-column'> <h5 class='card-title'>Basic Widget</h5> <p class='card-text flex-grow-1'>Entry-level widget with essential features at an affordable price.</p> <div class='d-flex justify-content-between align-items-center mt-auto'> <span class='h4 mb-0 text-primary'>$29.99</span> <button class='btn btn-primary'>Add to Cart</button> </div> </div> </div> </div> </div> </div> </body> </html>"; var pdf = renderer.RenderHtmlAsPdf(bootstrapProductGrid); pdf.SaveAs("product-catalog.pdf"); using IronPdf; var renderer = new ChromePdfRenderer(); string bootstrapProductGrid = @" <!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 my-5'> <h1 class='mb-4'>Product Catalog</h1> <div class='row row-cols-1 row-cols-md-3 g-4'> <div class='col'> <div class='card h-100'> <img src='https://via.placeholder.com/300x200' class='card-img-top' alt='Product 1'> <div class='card-body d-flex flex-column'> <h5 class='card-title'>Premium Widget</h5> <p class='card-text flex-grow-1'>High-quality widget with advanced features and excellent durability.</p> <div class='d-flex justify-content-between align-items-center mt-auto'> <span class='h4 mb-0 text-primary'>$99.99</span> <button class='btn btn-primary'>Add to Cart</button> </div> </div> </div> </div> <div class='col'> <div class='card h-100'> <img src='https://via.placeholder.com/300x200' class='card-img-top' alt='Product 2'> <div class='card-body d-flex flex-column'> <h5 class='card-title'>Standard Widget</h5> <p class='card-text flex-grow-1'>Reliable widget perfect for everyday use with great value.</p> <div class='d-flex justify-content-between align-items-center mt-auto'> <span class='h4 mb-0 text-primary'>$49.99</span> <button class='btn btn-primary'>Add to Cart</button> </div> </div> </div> </div> <div class='col'> <div class='card h-100'> <img src='https://via.placeholder.com/300x200' class='card-img-top' alt='Product 3'> <div class='card-body d-flex flex-column'> <h5 class='card-title'>Basic Widget</h5> <p class='card-text flex-grow-1'>Entry-level widget with essential features at an affordable price.</p> <div class='d-flex justify-content-between align-items-center mt-auto'> <span class='h4 mb-0 text-primary'>$29.99</span> <button class='btn btn-primary'>Add to Cart</button> </div> </div> </div> </div> </div> </div> </body> </html>"; var pdf = renderer.RenderHtmlAsPdf(bootstrapProductGrid); pdf.SaveAs("product-catalog.pdf"); IRON VB CONVERTER ERROR developers@ironsoftware.com $vbLabelText $csharpLabel 出力: Bootstrap 5のカードグリッドシステム、フレックスボックス整列、レスポンシブスペーシングをすべてPDFで保持した、完璧にフォーマットされた製品カタログ。 ABCpdf: フレームワーク制限のあるマルチエンジンアプローチ ABCpdfのモダンCSSフレームワークのサポートは、選択したレンダリングエンジンによって大きく異なります: ABCChromeエンジン (x64のみ): IronPDFと同様に良好なBootstrapサポートを持ちますが、特定の64ビットプラットフォームの構成が必要です ABCWebKitエンジン (x64のみ): 限られたフレックスボックスサポート、Bootstrap 4以上のレイアウトが正しくレンダリングされない可能性があります Geckoエンジン: 中程度のCSS3サポート、Bootstrap 3はBootstrap 4/5よりよく動作します MSHTMLエンジン: レガシーInternet Explorerレンダリング、Bootstrap 2.xのみ、モダンアプリケーションには推奨されません 重要な考慮事項: エンジン選択の複雑さがデプロイメントオーバーヘッドを増します 64ビットのみのエンジン (ABCChrome, ABCWebKit) がデプロイメントの柔軟性を制限します 一貫したBootstrapレンダリングのためにエンジン間でのテストが必要です エンジン選択によってフレームワーク互換性が大きく異なります ABCpdfのマルチエンジンアーキテクチャは柔軟性を提供しますが、Bootstrapレイアウトの正しいレンダリングを確保するためには慎重なエンジン選択とテストが必要です。 BootstrapまたはモダンなCSSフレームワークに強く依存しているアプリケーションの場合、ABCChromeエンジンは最良の結果を提供しますが、x64のみのデプロイメント制約があります。 Bootstrapフレームワークの互換性の詳細は、Bootstrap & Flexbox CSSガイドを参照してください。 包括的な機能比較 class="product__comprehensive-comparison-table"> class="table-container"> class="table-number">表4 class="table-title">.NETアプリケーションのためのIronPDFとABCpdfの機能比較 カテゴリ 機能/側面 IronPDF ABCpdf 主な利点 コアアーキテクチャ 設計哲学 シンプルさ優先、直感的なAPI 柔軟性優先、複数のエンジン IronPDF: より速い開発 APIの複雑性 RenderHtmlAsPdf()のような簡単なメソッド Docクラスを使ったオブジェクト指向 IronPDF: コード量が70%少ない 学習曲線 通常1〜2時間 通常1〜2日 IronPDF: 速い導入 プラットフォームサポート クロスプラットフォーム ネイティブサポート、単一パッケージ Windowsが主要、Linuxは限定的 IronPDF: 真のクロスプラットフォーム .NETバージョン .NET 10, 9, 8, 7, 6, 5, Core 3.1+, Framework 4.6.2+ .NET 10, 9, 8, 7, 6, 5, 4.0, Framework 2.0+ 両者: 現代のフレームワークサポート オペレーティングシステム Windows, Linux, macOS, Dockerネイティブ Windows, 限定的なLinuxサポート IronPDF: より広範なOSサポート HTMLからPDFへの変換 レンダリングエンジン Chrome V127+エンジン 複数エンジン (Chrome 123, Gecko, MSHTML) ABCpdf: エンジンの柔軟性 CSS3/HTML5サポート 100% Chrome互換 エンジンごとに異なる (70-100%) IronPDF: 一貫したレンダリング JavaScriptの実行 完全なV8 JavaScriptサポート エンジンに依存 IronPDF: 最新のJS機能 ウェブフォント Googleフォント、@font-face、システムフォント ABCChromeでサポート 両者: ウェブフォントサポート パフォーマンス シングルページレンダリング 通常200-400ms 150-300ms (ABCChrome) ABCpdf: わずかに速い バッチ処理 並列処理の最適化 マルチスレッド対応 IronPDF: より良い非同期サポート メモリ使用量 150-200MB (Chromeエンジン) エンジンによって100-150MB ABCpdf: メモリ消費が少ない 開発者体験 ドキュメンテーション 広範なチュートリアル、ビデオ、例 包括的なAPIドキュメンテーション IronPDF: 学習リソースが多い コード例 100以上の実行可能なサンプル 豊富な例 両者: 充実した例 IntelliSenseサポート 完全なXMLドキュメンテーション 包括的なIntelliSense 両者: IDE統合 ライセンスと価格設定 エントリーレベル Lite: $799 (1開発者、1プロジェクト) Standard: $329 (1開発者、32ビットのみ) ABCpdf: 低エントリーコスト プロフェッショナル Professional: $2,399 (10開発者、10プロジェクト) Professional: $479 (1開発者、64ビット) IronPDF: チームライセンスがより良い 再配布 +$2,399 ロイヤリティフリー $4,790 エンタープライズライセンス IronPDF: より手頃な価格 サポート サポートが含まれる はい、24/5のエンジニアリングサポート はい、メールサポート IronPDF: ライブチャットサポート 応答時間 < 1分 (ライブチャット) 通常24-48時間 IronPDF: 速い応答 ベストフォ ユースケース モダンウェブアプリ、SaaS、クラウドネイティブ Windowsデスクトップ、レガシーシステム コンテキスト依存 class="table-note"> 注記。 ABCpdfは柔軟性のある複数のレンダリングエンジンを提供しますが、完全な機能を使用するためにはWindowsが必要です。IronPDFはChromeの最新エンジンで一貫したクロスプラットフォームパフォーマンスを提供します。価格構造は、単一開発者およびチームライセンス間で大きく異なります。 Visual Studioで新しいプロジェクトを作成する コード例に入る前に、適切な開発環境を設定しましょう。 Visual Studioを開いて新しいプロジェクトを作成します: ファイル > 新規 > プロジェクト に移動 "コンソールアプリケーション" (.NET Coreまたは.NET Framework) を選択 対象フレームワークを選択 (.NET 6.0以上推奨) プロジェクトに名前を付ける (例: "PdfLibraryComparison") 作成をクリック 新しい.NETアプリケーションをセットアップするためのVisual Studioのプロジェクト作成ダイアログ IronPDF C#ライブラリインストール インストール方法 IronPDFは、異なる開発フローに対応するために複数のインストールアプローチを提供します: 方法 1: NuGetパッケージマネージャーを使用する (推奨) 最も簡単な方法は、Visual Studioの統合NuGetパッケージマネージャーを介したものです: ソリューションエクスプローラーでプロジェクトを右クリック "NuGetパッケージの管理" を選択 "参照" をクリックし、"IronPDF" を検索 公式のIronPDFパッケージをインストール Visual StudioのNuGetパッケージマネージャーインターフェースを通じてIronPDFをインストールする 方法 2: パッケージマネージャーコンソール コマンドラインツールを好む開発者向け: Install-Package IronPdf パッケージマネージャーコンソールを使用して、1つのコマンドでIronPDFをインストール 方法 3: 直接ダウンロード インターネットアクセスが制限された環境用: NuGet.orgからダウンロード ローカルNuGetフィードに.nupkgファイルを追加 ローカルフィードからインストール 方法 4: .NET CLI .NET Core/5+プロジェクト用: dotnet add package IronPdf ABCpdfのインストール インストール方法 ABCpdfは、いくつかの追加考慮事項と共に同様のインストールオプションを提供します: 方法 1: NuGetインストール Install-Package ABCpdf -Version 13.0.0.0 ABCpdfには、異なるエディション用の個別パッケージがあることに注意してください: ABCpdf - 標準エディション (32ビットのみ) ABCpdf.ABCChrome64 - 64ビットでのChromeレンダリングに必要 ABCpdf.ABCGecko - Geckoレンダリングエンジン用 方法 2: 手動インストール WebSupergooのウェブサイトからダウンロード ZIPファイルを解凍 適切なDLLへの参照を追加 ネイティブ依存関係を出力ディレクトリにコピー プラットフォーム特有の考慮事項 ABCpdfは、非Windowsプラットフォームでの追加設定が必要です: <!-- For Linux deployment --> <PackageReference Include="ABCpdf.Linux" Version="13.0.0.0" /> <!-- For Linux deployment --> <PackageReference Include="ABCpdf.Linux" Version="13.0.0.0" /> XML これらのライブラリのHTMLからPDFへの変換の対応方法 それぞれのライブラリがHTMLからPDFへの変換にどのようにアプローチしているかの基本的な違いを理解することで、彼らのさまざまな能力とパフォーマンス特性を説明します。 IronPDFのアプローチ: Chrome-First Architecture IronPDFは、Chrome完全なブラウザエンジンを使用して、多くの利点を提供します: using IronPdf; // IronPDF's approach - Chrome rendering with full browser capabilities var renderer = new ChromePdfRenderer(); // Configure rendering to match Chrome's print preview exactly renderer.RenderingOptions = ChromePdfRenderOptions.DefaultChrome; // Or customize for specific needs renderer.RenderingOptions.CssMediaType = PdfCssMediaType.Screen; renderer.RenderingOptions.EnableJavaScript = true; renderer.RenderingOptions.WaitFor.RenderDelay(500); // Wait for JS execution // Convert complex HTML with modern CSS and JavaScript string complexHtml = @" <!DOCTYPE html> <html> <head> <style> @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;700&display=swap'); .container { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; font-family: 'Roboto', sans-serif; } .card { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 10px; padding: 20px; color: white; box-shadow: 0 10px 20px rgba(0,0,0,0.19); transform: translateY(0); transition: transform 0.3s; } @media print { .card { break-inside: avoid; } } </style> </head> <body> <div class='container'> <div class='card'> <h2>Modern CSS Support</h2> <p>Grid, Flexbox, Gradients, Shadows - all rendered perfectly</p> </div> <div class='card'> <h2>Web Fonts</h2> <p>Google Fonts and custom fonts work seamlessly</p> </div> </div> <script> // Dynamic content generation document.addEventListener('DOMContentLoaded', function() { const container = document.querySelector('.container'); const dynamicCard = document.createElement('div'); dynamicCard.className = 'card'; dynamicCard.innerHTML = '<h2>JavaScript Generated</h2><p>This card was added by JavaScript</p>'; container.appendChild(dynamicCard); }); </script> </body> </html>"; var pdf = renderer.RenderHtmlAsPdf(complexHtml); pdf.SaveAs("modern-web-features.pdf"); using IronPdf; // IronPDF's approach - Chrome rendering with full browser capabilities var renderer = new ChromePdfRenderer(); // Configure rendering to match Chrome's print preview exactly renderer.RenderingOptions = ChromePdfRenderOptions.DefaultChrome; // Or customize for specific needs renderer.RenderingOptions.CssMediaType = PdfCssMediaType.Screen; renderer.RenderingOptions.EnableJavaScript = true; renderer.RenderingOptions.WaitFor.RenderDelay(500); // Wait for JS execution // Convert complex HTML with modern CSS and JavaScript string complexHtml = @" <!DOCTYPE html> <html> <head> <style> @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;700&display=swap'); .container { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; font-family: 'Roboto', sans-serif; } .card { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 10px; padding: 20px; color: white; box-shadow: 0 10px 20px rgba(0,0,0,0.19); transform: translateY(0); transition: transform 0.3s; } @media print { .card { break-inside: avoid; } } </style> </head> <body> <div class='container'> <div class='card'> <h2>Modern CSS Support</h2> <p>Grid, Flexbox, Gradients, Shadows - all rendered perfectly</p> </div> <div class='card'> <h2>Web Fonts</h2> <p>Google Fonts and custom fonts work seamlessly</p> </div> </div> <script> // Dynamic content generation document.addEventListener('DOMContentLoaded', function() { const container = document.querySelector('.container'); const dynamicCard = document.createElement('div'); dynamicCard.className = 'card'; dynamicCard.innerHTML = '<h2>JavaScript Generated</h2><p>This card was added by JavaScript</p>'; container.appendChild(dynamicCard); }); </script> </body> </html>"; var pdf = renderer.RenderHtmlAsPdf(complexHtml); pdf.SaveAs("modern-web-features.pdf"); Imports IronPdf ' IronPDF's approach - Chrome rendering with full browser capabilities Private renderer = New ChromePdfRenderer() ' Configure rendering to match Chrome's print preview exactly renderer.RenderingOptions = ChromePdfRenderOptions.DefaultChrome ' Or customize for specific needs renderer.RenderingOptions.CssMediaType = PdfCssMediaType.Screen renderer.RenderingOptions.EnableJavaScript = True renderer.RenderingOptions.WaitFor.RenderDelay(500) ' Wait for JS execution ' Convert complex HTML with modern CSS and JavaScript Dim complexHtml As String = " <!DOCTYPE html> <html> <head> <style> @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;700&display=swap'); .container { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; font-family: 'Roboto', sans-serif; } .card { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 10px; padding: 20px; color: white; box-shadow: 0 10px 20px rgba(0,0,0,0.19); transform: translateY(0); transition: transform 0.3s; } @media print { .card { break-inside: avoid; } } </style> </head> <body> <div class='container'> <div class='card'> <h2>Modern CSS Support</h2> <p>Grid, Flexbox, Gradients, Shadows - all rendered perfectly</p> </div> <div class='card'> <h2>Web Fonts</h2> <p>Google Fonts and custom fonts work seamlessly</p> </div> </div> <script> // Dynamic content generation document.addEventListener('DOMContentLoaded', function() { const container = document.querySelector('.container'); const dynamicCard = document.createElement('div'); dynamicCard.className = 'card'; dynamicCard.innerHTML = '<h2>JavaScript Generated</h2><p>This card was added by JavaScript</p>'; container.appendChild(dynamicCard); }); </script> </body> </html>" Dim pdf = renderer.RenderHtmlAsPdf(complexHtml) pdf.SaveAs("modern-web-features.pdf") $vbLabelText $csharpLabel このコードはいくつかの主要な特長を示します。IronPDFのChromeベースのアプローチ: モダンCSSサポート: グリッドレイアウト、フレックスボックス、グラデーション、およびトランスフォームがChromeで動作するのと同じように機能します ウェブフォント統合: Googleフォントは追加の設定なしで自動的に読み込まれます JavaScript実行: 動的コンテンツ生成がPDFレンダリングの前に行われます メディアクエリ: 印刷固有のスタイルが正しく適用されます ABCpdfのアプローチ: マルチエンジンの柔軟性 ABCpdfは、異なる能力を持つ複数のレンダリングエンジンを提供します: using WebSupergoo.ABCpdf13; // 方法 1: Using ABCChrome engine (most modern) Doc chromeDoc = new Doc(); chromeDoc.HtmlOptions.Engine = EngineType.Chrome; chromeDoc.HtmlOptions.Chrome.SetUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"); // Chrome engine supports modern web standards int chromeId = chromeDoc.AddImageUrl("https://example.com"); // Chain pages if content overflows while (chromeDoc.Chainable(chromeId)) { chromeDoc.Page = chromeDoc.AddPage(); chromeId = chromeDoc.AddImageToChain(chromeId); } chromeDoc.Save("chrome-engine-output.pdf"); // 方法 2: Using Gecko engine (Firefox-based) Doc geckoDoc = new Doc(); geckoDoc.HtmlOptions.Engine = EngineType.Gecko; geckoDoc.HtmlOptions.UseScript = true; // Enable JavaScript // Gecko provides good standards support with lower resource usage string html = "<html><body><h1>Gecko Rendered Content</h1></body></html>"; geckoDoc.AddImageHtml(html); geckoDoc.Save("gecko-engine-output.pdf"); // 方法 3: Using MSHTML engine (IE-based, legacy support) Doc ieDoc = new Doc(); ieDoc.HtmlOptions.Engine = EngineType.MSHtml; // MSHTML is faster but with limited modern CSS support ieDoc.AddImageUrl("https://legacy-app.example.com"); ieDoc.Save("ie-engine-output.pdf"); using WebSupergoo.ABCpdf13; // 方法 1: Using ABCChrome engine (most modern) Doc chromeDoc = new Doc(); chromeDoc.HtmlOptions.Engine = EngineType.Chrome; chromeDoc.HtmlOptions.Chrome.SetUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"); // Chrome engine supports modern web standards int chromeId = chromeDoc.AddImageUrl("https://example.com"); // Chain pages if content overflows while (chromeDoc.Chainable(chromeId)) { chromeDoc.Page = chromeDoc.AddPage(); chromeId = chromeDoc.AddImageToChain(chromeId); } chromeDoc.Save("chrome-engine-output.pdf"); // 方法 2: Using Gecko engine (Firefox-based) Doc geckoDoc = new Doc(); geckoDoc.HtmlOptions.Engine = EngineType.Gecko; geckoDoc.HtmlOptions.UseScript = true; // Enable JavaScript // Gecko provides good standards support with lower resource usage string html = "<html><body><h1>Gecko Rendered Content</h1></body></html>"; geckoDoc.AddImageHtml(html); geckoDoc.Save("gecko-engine-output.pdf"); // 方法 3: Using MSHTML engine (IE-based, legacy support) Doc ieDoc = new Doc(); ieDoc.HtmlOptions.Engine = EngineType.MSHtml; // MSHTML is faster but with limited modern CSS support ieDoc.AddImageUrl("https://legacy-app.example.com"); ieDoc.Save("ie-engine-output.pdf"); IRON VB CONVERTER ERROR developers@ironsoftware.com $vbLabelText $csharpLabel マルチエンジンアプローチは柔軟性を提供しますが、慎重な考慮が必要です: エンジン選択: 開発者はコンテンツに適切なエンジンを選ばなければなりません 機能の均一化: 異なるエンジンが異なるHTML/CSS機能をサポートします デプロイメントの複雑さ: 各エンジンは異なる実行環境を持つ可能性があります テストのオーバーヘッド: 出力がエンジン間で異なるため、テストを追加で行う必要があります URLからPDFドキュメントを作成する PDFライブラリの最も一般的なユースケースの1つは、ライブウェブページをPDFドキュメントに変換することです。 それぞれのライブラリがこのタスクをどのように処理するかを見てみましょう。 IronPDFを使用する IronPDFのURLからPDFへの変換は、完全なChromeブラウザエンジンを活用しています: using IronPdf; using System; using System.Threading.Tasks; public class UrlToPdfConverter { public static async Task ConvertUrlToPdfAsync() { var renderer = new ChromePdfRenderer(); // Configure for optimal web page capture renderer.RenderingOptions = new ChromePdfRenderOptions { // Viewport and scaling ViewPortWidth = 1920, ViewPortHeight = 1080, ZoomLevel = 100, // Paper and margins PaperSize = PdfPaperSize.A4, MarginTop = 10, MarginBottom = 10, MarginLeft = 10, MarginRight = 10, // Rendering behavior CssMediaType = PdfCssMediaType.Screen, PrintHtmlBackgrounds = true, CreatePdfFormsFromHtml = true, // JavaScript and timing EnableJavaScript = true, WaitFor = new WaitFor { // Wait strategies for dynamic content RenderDelay = 500, // milliseconds JavaScriptFinishDelay = 100, AllowedExecutionTime = 30000 // 30 seconds max } }; // Handle authentication if needed renderer.RenderingOptions.HttpOptions.HttpHeaders.Add("Authorization", "Bearer your-token"); // Convert with error handling try { // Async conversion for better performance var pdf = await renderer.RenderUrlAsPdfAsync("https://github.com/trending"); // Add metadata pdf.MetaData.Author = "IronPDF Example"; pdf.MetaData.Title = "GitHub Trending Projects"; pdf.MetaData.CreationDate = DateTime.Now; // Add watermark pdf.ApplyWatermark("<h2 style='color:red;opacity:0.5'>CONFIDENTIAL</h2>", 30, VerticalAlignment.Middle, HorizontalAlignment.Center); pdf.SaveAs("github-trending.pdf"); Console.WriteLine("PDF created successfully!"); } catch (Exception ex) { Console.WriteLine($"Error creating PDF: {ex.Message}"); } } } using IronPdf; using System; using System.Threading.Tasks; public class UrlToPdfConverter { public static async Task ConvertUrlToPdfAsync() { var renderer = new ChromePdfRenderer(); // Configure for optimal web page capture renderer.RenderingOptions = new ChromePdfRenderOptions { // Viewport and scaling ViewPortWidth = 1920, ViewPortHeight = 1080, ZoomLevel = 100, // Paper and margins PaperSize = PdfPaperSize.A4, MarginTop = 10, MarginBottom = 10, MarginLeft = 10, MarginRight = 10, // Rendering behavior CssMediaType = PdfCssMediaType.Screen, PrintHtmlBackgrounds = true, CreatePdfFormsFromHtml = true, // JavaScript and timing EnableJavaScript = true, WaitFor = new WaitFor { // Wait strategies for dynamic content RenderDelay = 500, // milliseconds JavaScriptFinishDelay = 100, AllowedExecutionTime = 30000 // 30 seconds max } }; // Handle authentication if needed renderer.RenderingOptions.HttpOptions.HttpHeaders.Add("Authorization", "Bearer your-token"); // Convert with error handling try { // Async conversion for better performance var pdf = await renderer.RenderUrlAsPdfAsync("https://github.com/trending"); // Add metadata pdf.MetaData.Author = "IronPDF Example"; pdf.MetaData.Title = "GitHub Trending Projects"; pdf.MetaData.CreationDate = DateTime.Now; // Add watermark pdf.ApplyWatermark("<h2 style='color:red;opacity:0.5'>CONFIDENTIAL</h2>", 30, VerticalAlignment.Middle, HorizontalAlignment.Center); pdf.SaveAs("github-trending.pdf"); Console.WriteLine("PDF created successfully!"); } catch (Exception ex) { Console.WriteLine($"Error creating PDF: {ex.Message}"); } } } Imports IronPdf Imports System Imports System.Threading.Tasks Public Class UrlToPdfConverter Public Shared Async Function ConvertUrlToPdfAsync() As Task Dim renderer = New ChromePdfRenderer() ' Configure for optimal web page capture renderer.RenderingOptions = New ChromePdfRenderOptions With { .ViewPortWidth = 1920, .ViewPortHeight = 1080, .ZoomLevel = 100, .PaperSize = PdfPaperSize.A4, .MarginTop = 10, .MarginBottom = 10, .MarginLeft = 10, .MarginRight = 10, .CssMediaType = PdfCssMediaType.Screen, .PrintHtmlBackgrounds = True, .CreatePdfFormsFromHtml = True, .EnableJavaScript = True, .WaitFor = New WaitFor With { .RenderDelay = 500, .JavaScriptFinishDelay = 100, .AllowedExecutionTime = 30000 } } ' Handle authentication if needed renderer.RenderingOptions.HttpOptions.HttpHeaders.Add("Authorization", "Bearer your-token") ' Convert with error handling Try ' Async conversion for better performance Dim pdf = Await renderer.RenderUrlAsPdfAsync("https://github.com/trending") ' Add metadata pdf.MetaData.Author = "IronPDF Example" pdf.MetaData.Title = "GitHub Trending Projects" pdf.MetaData.CreationDate = DateTime.Now ' Add watermark pdf.ApplyWatermark("<h2 style='color:red;opacity:0.5'>CONFIDENTIAL</h2>", 30, VerticalAlignment.Middle, HorizontalAlignment.Center) pdf.SaveAs("github-trending.pdf") Console.WriteLine("PDF created successfully!") Catch ex As Exception Console.WriteLine($"Error creating PDF: {ex.Message}") End Try End Function End Class $vbLabelText $csharpLabel 実証される主な機能: ビューポート制御: レスポンシブテストのために異なる画面サイズをシミュレート 認証サポート: 保護されたリソースのためにヘッダーを追加 動的コンテンツハンドリング: JavaScript多用ページのための待機戦略 ポストプロセス: 変換後のメタデータとウォーターマークの追加 ABCpdfを使用する ABCpdfのURL変換はページチェーンニングを伴います: using WebSupergoo.ABCpdf13; using System; public class ABCpdfUrlConverter { public static void ConvertUrlWithABCpdf() { using (Doc theDoc = new Doc()) { // Configure the HTML engine theDoc.HtmlOptions.Engine = EngineType.Chrome; theDoc.HtmlOptions.Chrome.LoadDelay = 1000; // Wait 1 second // Set viewport size theDoc.HtmlOptions.BrowserWidth = 1200; // Authentication theDoc.HtmlOptions.HttpAdditionalHeaders = "Authorization: Bearer your-token"; // Page setup theDoc.Rect.Inset(20, 20); theDoc.Page = theDoc.AddPage(); // Add the URL int theID = theDoc.AddImageUrl("https://github.com/trending"); // Chain pages for overflow content while (true) { if (!theDoc.Chainable(theID)) break; theDoc.Page = theDoc.AddPage(); theID = theDoc.AddImageToChain(theID); } // Reduce file size for (int i = 1; i <= theDoc.PageCount; i++) { theDoc.PageNumber = i; theDoc.Flatten(); } // Save theDoc.Save("abcpdf-github.pdf"); } } } using WebSupergoo.ABCpdf13; using System; public class ABCpdfUrlConverter { public static void ConvertUrlWithABCpdf() { using (Doc theDoc = new Doc()) { // Configure the HTML engine theDoc.HtmlOptions.Engine = EngineType.Chrome; theDoc.HtmlOptions.Chrome.LoadDelay = 1000; // Wait 1 second // Set viewport size theDoc.HtmlOptions.BrowserWidth = 1200; // Authentication theDoc.HtmlOptions.HttpAdditionalHeaders = "Authorization: Bearer your-token"; // Page setup theDoc.Rect.Inset(20, 20); theDoc.Page = theDoc.AddPage(); // Add the URL int theID = theDoc.AddImageUrl("https://github.com/trending"); // Chain pages for overflow content while (true) { if (!theDoc.Chainable(theID)) break; theDoc.Page = theDoc.AddPage(); theID = theDoc.AddImageToChain(theID); } // Reduce file size for (int i = 1; i <= theDoc.PageCount; i++) { theDoc.PageNumber = i; theDoc.Flatten(); } // Save theDoc.Save("abcpdf-github.pdf"); } } } Imports WebSupergoo.ABCpdf13 Imports System Public Class ABCpdfUrlConverter Public Shared Sub ConvertUrlWithABCpdf() Using theDoc As New Doc() ' Configure the HTML engine theDoc.HtmlOptions.Engine = EngineType.Chrome theDoc.HtmlOptions.Chrome.LoadDelay = 1000 ' Wait 1 second ' Set viewport size theDoc.HtmlOptions.BrowserWidth = 1200 ' Authentication theDoc.HtmlOptions.HttpAdditionalHeaders = "Authorization: Bearer your-token" ' Page setup theDoc.Rect.Inset(20, 20) theDoc.Page = theDoc.AddPage() ' Add the URL Dim theID As Integer = theDoc.AddImageUrl("https://github.com/trending") ' Chain pages for overflow content Do If Not theDoc.Chainable(theID) Then Exit Do End If theDoc.Page = theDoc.AddPage() theID = theDoc.AddImageToChain(theID) Loop ' Reduce file size For i As Integer = 1 To theDoc.PageCount theDoc.PageNumber = i theDoc.Flatten() Next i ' Save theDoc.Save("abcpdf-github.pdf") End Using End Sub End Class $vbLabelText $csharpLabel 注目すべき相違点: ページチェーンニング: 複数ページのコンテンツを手動で処理 エンジン設定: レンダリングエンジンを明示的に選択しなければなりません リソース管理: 適切なusingステートメントでの破棄が必要です HTML文字列からPDFを作成する どちらのライブラリもHTML文字列のPDFへの変換に優れていますが、アプローチは大きく異なります。 IronPDFを使用する IronPDFのHTML文字列変換は高度な機能を持っています: using IronPdf; using System.IO; public class HtmlStringToPdf { public static void GenerateInvoicePdf() { var renderer = new ChromePdfRenderer(); // Configure for print-quality output renderer.RenderingOptions = new ChromePdfRenderOptions { PaperSize = PdfPaperSize.A4, DPI = 300, // High quality print CssMediaType = PdfCssMediaType.Print, PaperFit = new PaperFit { UseFitToPageRendering = true, RenderScale = 100 } }; // Professional invoice HTML string invoiceHtml = @" <!DOCTYPE html> <html> <head> <meta charset='UTF-8'> <style> @page { size: A4; margin: 0; } body { font-family: 'Segoe UI', Arial, sans-serif; margin: 0; padding: 20mm; color: #333; } .invoice-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 30px; border-bottom: 2px solid #0066cc; padding-bottom: 20px; } .company-info h1 { color: #0066cc; margin: 0; font-size: 28px; } .invoice-details { text-align: right; } .invoice-details h2 { color: #666; margin: 0 0 10px 0; font-size: 24px; } .invoice-table { width: 100%; border-collapse: collapse; margin-top: 30px; } .invoice-table th { background-color: #0066cc; color: white; padding: 12px; text-align: left; } .invoice-table td { padding: 12px; border-bottom: 1px solid #ddd; } .invoice-table tr:hover { background-color: #f5f5f5; } .total-section { margin-top: 30px; text-align: right; } .total-section .total-row { display: flex; justify-content: flex-end; margin: 5px 0; } .total-section .label { font-weight: bold; margin-right: 20px; min-width: 100px; } .total-section .grand-total { font-size: 20px; color: #0066cc; border-top: 2px solid #0066cc; padding-top: 10px; margin-top: 10px; } @media print { .no-print { display: none; } } </style> </head> <body> <div class='invoice-header'> <div class='company-info'> <h1>ACME Corporation</h1> <p>123 Business Street<br> New York, NY 10001<br> Phone: (555) 123-4567<br> Email: billing@acme.com</p> </div> <div class='invoice-details'> <h2>INVOICE</h2> <p><strong>Invoice #:</strong> INV-2025-001<br> <strong>Date:</strong> " + DateTime.Now.ToString("MMMM dd, yyyy") + @"<br> <strong>Due Date:</strong> " + DateTime.Now.AddDays(30).ToString("MMMM dd, yyyy") + @"</p> </div> </div> <div class='billing-info'> <h3>Bill To:</h3> <p>John Doe<br> 456 Client Avenue<br> Los Angeles, CA 90001</p> </div> <table class='invoice-table'> <thead> <tr> <th>Description</th> <th>Quantity</th> <th>Unit Price</th> <th>Total</th> </tr> </thead> <tbody> <tr> <td>Professional Services - Web Development</td> <td>40 hours</td> <td>$150.00</td> <td>$6,000.00</td> </tr> <tr> <td>Hosting Services (Annual)</td> <td>1</td> <td>$1,200.00</td> <td>$1,200.00</td> </tr> <tr> <td>Domain Registration</td> <td>2</td> <td>$15.00</td> <td>$30.00</td> </tr> </tbody> </table> <div class='total-section'> <div class='total-row'> <span class='label'>Subtotal:</span> <span>$7,230.00</span> </div> <div class='total-row'> <span class='label'>Tax (8%):</span> <span>$578.40</span> </div> <div class='total-row grand-total'> <span class='label'>Total Due:</span> <span>$7,808.40</span> </div> </div> <div class='footer' style='margin-top: 50px; padding-top: 20px; border-top: 1px solid #ddd; text-align: center; color: #666;'> <p>Thank you for your business!<br> Payment is due within 30 days. Please include invoice number with payment.</p> </div> </body> </html>"; // Generate PDF with base path for local assets var pdf = renderer.RenderHtmlAsPdf(invoiceHtml, @"C:\Assets\"); // Add security pdf.SecuritySettings.AllowUserEditing = false; pdf.SecuritySettings.AllowUserPrinting = PdfPrintSecurity.FullPrintRights; pdf.SecuritySettings.OwnerPassword = "admin123"; // Save with optimization pdf.CompressImages(60); // 60% quality for smaller file size pdf.SaveAs("professional-invoice.pdf"); } } using IronPdf; using System.IO; public class HtmlStringToPdf { public static void GenerateInvoicePdf() { var renderer = new ChromePdfRenderer(); // Configure for print-quality output renderer.RenderingOptions = new ChromePdfRenderOptions { PaperSize = PdfPaperSize.A4, DPI = 300, // High quality print CssMediaType = PdfCssMediaType.Print, PaperFit = new PaperFit { UseFitToPageRendering = true, RenderScale = 100 } }; // Professional invoice HTML string invoiceHtml = @" <!DOCTYPE html> <html> <head> <meta charset='UTF-8'> <style> @page { size: A4; margin: 0; } body { font-family: 'Segoe UI', Arial, sans-serif; margin: 0; padding: 20mm; color: #333; } .invoice-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 30px; border-bottom: 2px solid #0066cc; padding-bottom: 20px; } .company-info h1 { color: #0066cc; margin: 0; font-size: 28px; } .invoice-details { text-align: right; } .invoice-details h2 { color: #666; margin: 0 0 10px 0; font-size: 24px; } .invoice-table { width: 100%; border-collapse: collapse; margin-top: 30px; } .invoice-table th { background-color: #0066cc; color: white; padding: 12px; text-align: left; } .invoice-table td { padding: 12px; border-bottom: 1px solid #ddd; } .invoice-table tr:hover { background-color: #f5f5f5; } .total-section { margin-top: 30px; text-align: right; } .total-section .total-row { display: flex; justify-content: flex-end; margin: 5px 0; } .total-section .label { font-weight: bold; margin-right: 20px; min-width: 100px; } .total-section .grand-total { font-size: 20px; color: #0066cc; border-top: 2px solid #0066cc; padding-top: 10px; margin-top: 10px; } @media print { .no-print { display: none; } } </style> </head> <body> <div class='invoice-header'> <div class='company-info'> <h1>ACME Corporation</h1> <p>123 Business Street<br> New York, NY 10001<br> Phone: (555) 123-4567<br> Email: billing@acme.com</p> </div> <div class='invoice-details'> <h2>INVOICE</h2> <p><strong>Invoice #:</strong> INV-2025-001<br> <strong>Date:</strong> " + DateTime.Now.ToString("MMMM dd, yyyy") + @"<br> <strong>Due Date:</strong> " + DateTime.Now.AddDays(30).ToString("MMMM dd, yyyy") + @"</p> </div> </div> <div class='billing-info'> <h3>Bill To:</h3> <p>John Doe<br> 456 Client Avenue<br> Los Angeles, CA 90001</p> </div> <table class='invoice-table'> <thead> <tr> <th>Description</th> <th>Quantity</th> <th>Unit Price</th> <th>Total</th> </tr> </thead> <tbody> <tr> <td>Professional Services - Web Development</td> <td>40 hours</td> <td>$150.00</td> <td>$6,000.00</td> </tr> <tr> <td>Hosting Services (Annual)</td> <td>1</td> <td>$1,200.00</td> <td>$1,200.00</td> </tr> <tr> <td>Domain Registration</td> <td>2</td> <td>$15.00</td> <td>$30.00</td> </tr> </tbody> </table> <div class='total-section'> <div class='total-row'> <span class='label'>Subtotal:</span> <span>$7,230.00</span> </div> <div class='total-row'> <span class='label'>Tax (8%):</span> <span>$578.40</span> </div> <div class='total-row grand-total'> <span class='label'>Total Due:</span> <span>$7,808.40</span> </div> </div> <div class='footer' style='margin-top: 50px; padding-top: 20px; border-top: 1px solid #ddd; text-align: center; color: #666;'> <p>Thank you for your business!<br> Payment is due within 30 days. Please include invoice number with payment.</p> </div> </body> </html>"; // Generate PDF with base path for local assets var pdf = renderer.RenderHtmlAsPdf(invoiceHtml, @"C:\Assets\"); // Add security pdf.SecuritySettings.AllowUserEditing = false; pdf.SecuritySettings.AllowUserPrinting = PdfPrintSecurity.FullPrintRights; pdf.SecuritySettings.OwnerPassword = "admin123"; // Save with optimization pdf.CompressImages(60); // 60% quality for smaller file size pdf.SaveAs("professional-invoice.pdf"); } } Imports IronPdf Imports System.IO Public Class HtmlStringToPdf Public Shared Sub GenerateInvoicePdf() Dim renderer = New ChromePdfRenderer() ' Configure for print-quality output renderer.RenderingOptions = New ChromePdfRenderOptions With { .PaperSize = PdfPaperSize.A4, .DPI = 300, .CssMediaType = PdfCssMediaType.Print, .PaperFit = New PaperFit With { .UseFitToPageRendering = True, .RenderScale = 100 } } ' Professional invoice HTML Dim invoiceHtml As String = " <!DOCTYPE html> <html> <head> <meta charset='UTF-8'> <style> @page { size: A4; margin: 0; } body { font-family: 'Segoe UI', Arial, sans-serif; margin: 0; padding: 20mm; color: #333; } .invoice-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 30px; border-bottom: 2px solid #0066cc; padding-bottom: 20px; } .company-info h1 { color: #0066cc; margin: 0; font-size: 28px; } .invoice-details { text-align: right; } .invoice-details h2 { color: #666; margin: 0 0 10px 0; font-size: 24px; } .invoice-table { width: 100%; border-collapse: collapse; margin-top: 30px; } .invoice-table th { background-color: #0066cc; color: white; padding: 12px; text-align: left; } .invoice-table td { padding: 12px; border-bottom: 1px solid #ddd; } .invoice-table tr:hover { background-color: #f5f5f5; } .total-section { margin-top: 30px; text-align: right; } .total-section .total-row { display: flex; justify-content: flex-end; margin: 5px 0; } .total-section .label { font-weight: bold; margin-right: 20px; min-width: 100px; } .total-section .grand-total { font-size: 20px; color: #0066cc; border-top: 2px solid #0066cc; padding-top: 10px; margin-top: 10px; } @media print { .no-print { display: none; } } </style> </head> <body> <div class='invoice-header'> <div class='company-info'> <h1>ACME Corporation</h1> <p>123 Business Street<br> New York, NY 10001<br> Phone: (555) 123-4567<br> Email: billing@acme.com</p> </div> <div class='invoice-details'> <h2>INVOICE</h2> <p><strong>Invoice #:</strong> INV-2025-001<br> <strong>Date:</strong> " & DateTime.Now.ToString("MMMM dd, yyyy") & "<br> <strong>Due Date:</strong> " & DateTime.Now.AddDays(30).ToString("MMMM dd, yyyy") & "</p> </div> </div> <div class='billing-info'> <h3>Bill To:</h3> <p>John Doe<br> 456 Client Avenue<br> Los Angeles, CA 90001</p> </div> <table class='invoice-table'> <thead> <tr> <th>Description</th> <th>Quantity</th> <th>Unit Price</th> <th>Total</th> </tr> </thead> <tbody> <tr> <td>Professional Services - Web Development</td> <td>40 hours</td> <td>$150.00</td> <td>$6,000.00</td> </tr> <tr> <td>Hosting Services (Annual)</td> <td>1</td> <td>$1,200.00</td> <td>$1,200.00</td> </tr> <tr> <td>Domain Registration</td> <td>2</td> <td>$15.00</td> <td>$30.00</td> </tr> </tbody> </table> <div class='total-section'> <div class='total-row'> <span class='label'>Subtotal:</span> <span>$7,230.00</span> </div> <div class='total-row'> <span class='label'>Tax (8%):</span> <span>$578.40</span> </div> <div class='total-row grand-total'> <span class='label'>Total Due:</span> <span>$7,808.40</span> </div> </div> <div class='footer' style='margin-top: 50px; padding-top: 20px; border-top: 1px solid #ddd; text-align: center; color: #666;'> <p>Thank you for your business!<br> Payment is due within 30 days. Please include invoice number with payment.</p> </div> </body> </html>" ' Generate PDF with base path for local assets Dim pdf = renderer.RenderHtmlAsPdf(invoiceHtml, "C:\Assets\") ' Add security pdf.SecuritySettings.AllowUserEditing = False pdf.SecuritySettings.AllowUserPrinting = PdfPrintSecurity.FullPrintRights pdf.SecuritySettings.OwnerPassword = "admin123" ' Save with optimization pdf.CompressImages(60) ' 60% quality for smaller file size pdf.SaveAs("professional-invoice.pdf") End Sub End Class $vbLabelText $csharpLabel この例が示すもの: プロフェッショナルレイアウト: 複雑なCSSによるフレックスボックスとグリッド 動的コンテンツ: 日付計算とフォーマット 印刷最適化: 印刷固有スタイルのためのメディアクエリ セキュリティ機能: パスワード保護と権限設定 ファイル最適化: 小さいファイルサイズのための画像圧縮 ABCpdfを使用する ABCpdfのHTML文字列ハンドリングはスタイルテキストを伴います: using WebSupergoo.ABCpdf13; public class ABCpdfHtmlString { public static void CreateStyledDocument() { using (Doc theDoc = new Doc()) { // Set up the document theDoc.Rect.Inset(40, 40); theDoc.Color.String = "0 0 0"; // Black text // Add styled HTML content theDoc.FontSize = 48; string styledHtml = @" <h1 style='color: #0066cc'>ABCpdf Document</h1> <p style='font-size: 14pt; line-height: 1.5'> This demonstrates <b>bold text</b>, <i>italic text</i>, and <span style='color: red'>colored text</span>. </p> <ul style='margin-left: 20px'> <li>First item</li> <li>Second item</li> <li>Third item</li> </ul>"; // Add HTML with automatic text flow int theID = theDoc.AddImageHtml(styledHtml); // Continue on new pages if needed while (true) { if (!theDoc.Chainable(theID)) break; theDoc.Page = theDoc.AddPage(); theID = theDoc.AddImageToChain(theID); } // Apply compression theDoc.Encryption.Type = 2; // 128-bit encryption theDoc.Encryption.CanPrint = true; theDoc.Encryption.CanModify = false; theDoc.Save("styled-abcpdf.pdf"); } } } using WebSupergoo.ABCpdf13; public class ABCpdfHtmlString { public static void CreateStyledDocument() { using (Doc theDoc = new Doc()) { // Set up the document theDoc.Rect.Inset(40, 40); theDoc.Color.String = "0 0 0"; // Black text // Add styled HTML content theDoc.FontSize = 48; string styledHtml = @" <h1 style='color: #0066cc'>ABCpdf Document</h1> <p style='font-size: 14pt; line-height: 1.5'> This demonstrates <b>bold text</b>, <i>italic text</i>, and <span style='color: red'>colored text</span>. </p> <ul style='margin-left: 20px'> <li>First item</li> <li>Second item</li> <li>Third item</li> </ul>"; // Add HTML with automatic text flow int theID = theDoc.AddImageHtml(styledHtml); // Continue on new pages if needed while (true) { if (!theDoc.Chainable(theID)) break; theDoc.Page = theDoc.AddPage(); theID = theDoc.AddImageToChain(theID); } // Apply compression theDoc.Encryption.Type = 2; // 128-bit encryption theDoc.Encryption.CanPrint = true; theDoc.Encryption.CanModify = false; theDoc.Save("styled-abcpdf.pdf"); } } } Imports WebSupergoo.ABCpdf13 Public Class ABCpdfHtmlString Public Shared Sub CreateStyledDocument() Using theDoc As New Doc() ' Set up the document theDoc.Rect.Inset(40, 40) theDoc.Color.String = "0 0 0" ' Black text ' Add styled HTML content theDoc.FontSize = 48 Dim styledHtml As String = " <h1 style='color: #0066cc'>ABCpdf Document</h1> <p style='font-size: 14pt; line-height: 1.5'> This demonstrates <b>bold text</b>, <i>italic text</i>, and <span style='color: red'>colored text</span>. </p> <ul style='margin-left: 20px'> <li>First item</li> <li>Second item</li> <li>Third item</li> </ul>" ' Add HTML with automatic text flow Dim theID As Integer = theDoc.AddImageHtml(styledHtml) ' Continue on new pages if needed Do If Not theDoc.Chainable(theID) Then Exit Do End If theDoc.Page = theDoc.AddPage() theID = theDoc.AddImageToChain(theID) Loop ' Apply compression theDoc.Encryption.Type = 2 ' 128-bit encryption theDoc.Encryption.CanPrint = True theDoc.Encryption.CanModify = False theDoc.Save("styled-abcpdf.pdf") End Using End Sub End Class $vbLabelText $csharpLabel パフォーマンスベンチマーク パフォーマンス特性を理解することで、特定のユースケースに適したライブラリを選択するのに役立ちます。 ベンチマークテスト設定 using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Running; using IronPdf; using WebSupergoo.ABCpdf13; [MemoryDiagnoser] [SimpleJob(warmupCount: 3, targetCount: 10)] public class PdfGenerationBenchmark { private string _simpleHtml; private string _complexHtml; private ChromePdfRenderer _ironPdfRenderer; private Doc _abcPdfDoc; [GlobalSetup] public void Setup() { _simpleHtml = "<h1>Simple Document</h1><p>Basic paragraph text.</p>"; _complexHtml = File.ReadAllText("complex-page.html"); // 50KB HTML with CSS/JS _ironPdfRenderer = new ChromePdfRenderer(); _abcPdfDoc = new Doc(); _abcPdfDoc.HtmlOptions.Engine = EngineType.Chrome; } [Benchmark] public void IronPDF_SimpleHtml() { var pdf = _ironPdfRenderer.RenderHtmlAsPdf(_simpleHtml); pdf.SaveAs("temp_iron_simple.pdf"); } [Benchmark] public void ABCpdf_SimpleHtml() { _abcPdfDoc.Clear(); _abcPdfDoc.AddImageHtml(_simpleHtml); _abcPdfDoc.Save("temp_abc_simple.pdf"); } [Benchmark] public void IronPDF_ComplexHtml() { var pdf = _ironPdfRenderer.RenderHtmlAsPdf(_complexHtml); pdf.SaveAs("temp_iron_complex.pdf"); } [Benchmark] public void ABCpdf_ComplexHtml() { _abcPdfDoc.Clear(); int id = _abcPdfDoc.AddImageHtml(_complexHtml); while (_abcPdfDoc.Chainable(id)) { _abcPdfDoc.Page = _abcPdfDoc.AddPage(); id = _abcPdfDoc.AddImageToChain(id); } _abcPdfDoc.Save("temp_abc_complex.pdf"); } } using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Running; using IronPdf; using WebSupergoo.ABCpdf13; [MemoryDiagnoser] [SimpleJob(warmupCount: 3, targetCount: 10)] public class PdfGenerationBenchmark { private string _simpleHtml; private string _complexHtml; private ChromePdfRenderer _ironPdfRenderer; private Doc _abcPdfDoc; [GlobalSetup] public void Setup() { _simpleHtml = "<h1>Simple Document</h1><p>Basic paragraph text.</p>"; _complexHtml = File.ReadAllText("complex-page.html"); // 50KB HTML with CSS/JS _ironPdfRenderer = new ChromePdfRenderer(); _abcPdfDoc = new Doc(); _abcPdfDoc.HtmlOptions.Engine = EngineType.Chrome; } [Benchmark] public void IronPDF_SimpleHtml() { var pdf = _ironPdfRenderer.RenderHtmlAsPdf(_simpleHtml); pdf.SaveAs("temp_iron_simple.pdf"); } [Benchmark] public void ABCpdf_SimpleHtml() { _abcPdfDoc.Clear(); _abcPdfDoc.AddImageHtml(_simpleHtml); _abcPdfDoc.Save("temp_abc_simple.pdf"); } [Benchmark] public void IronPDF_ComplexHtml() { var pdf = _ironPdfRenderer.RenderHtmlAsPdf(_complexHtml); pdf.SaveAs("temp_iron_complex.pdf"); } [Benchmark] public void ABCpdf_ComplexHtml() { _abcPdfDoc.Clear(); int id = _abcPdfDoc.AddImageHtml(_complexHtml); while (_abcPdfDoc.Chainable(id)) { _abcPdfDoc.Page = _abcPdfDoc.AddPage(); id = _abcPdfDoc.AddImageToChain(id); } _abcPdfDoc.Save("temp_abc_complex.pdf"); } } Imports BenchmarkDotNet.Attributes Imports BenchmarkDotNet.Running Imports IronPdf Imports WebSupergoo.ABCpdf13 <MemoryDiagnoser> <SimpleJob(warmupCount:= 3, targetCount:= 10)> Public Class PdfGenerationBenchmark Private _simpleHtml As String Private _complexHtml As String Private _ironPdfRenderer As ChromePdfRenderer Private _abcPdfDoc As Doc <GlobalSetup> Public Sub Setup() _simpleHtml = "<h1>Simple Document</h1><p>Basic paragraph text.</p>" _complexHtml = File.ReadAllText("complex-page.html") ' 50KB HTML with CSS/JS _ironPdfRenderer = New ChromePdfRenderer() _abcPdfDoc = New Doc() _abcPdfDoc.HtmlOptions.Engine = EngineType.Chrome End Sub <Benchmark> Public Sub IronPDF_SimpleHtml() Dim pdf = _ironPdfRenderer.RenderHtmlAsPdf(_simpleHtml) pdf.SaveAs("temp_iron_simple.pdf") End Sub <Benchmark> Public Sub ABCpdf_SimpleHtml() _abcPdfDoc.Clear() _abcPdfDoc.AddImageHtml(_simpleHtml) _abcPdfDoc.Save("temp_abc_simple.pdf") End Sub <Benchmark> Public Sub IronPDF_ComplexHtml() Dim pdf = _ironPdfRenderer.RenderHtmlAsPdf(_complexHtml) pdf.SaveAs("temp_iron_complex.pdf") End Sub <Benchmark> Public Sub ABCpdf_ComplexHtml() _abcPdfDoc.Clear() Dim id As Integer = _abcPdfDoc.AddImageHtml(_complexHtml) Do While _abcPdfDoc.Chainable(id) _abcPdfDoc.Page = _abcPdfDoc.AddPage() id = _abcPdfDoc.AddImageToChain(id) Loop _abcPdfDoc.Save("temp_abc_complex.pdf") End Sub End Class $vbLabelText $csharpLabel 典型的な結果 方法 平均 エラー 標準偏差 メモリ IronPDF_SimpleHtml 245.3 ms 4.2 ms 3.8 ms 152 MB ABCpdf_SimpleHtml 187.6 ms 3.1 ms 2.9 ms 98 MB IronPDF_ComplexHtml 892.4 ms 12.3 ms 10.8 ms 201 MB ABCpdf_ComplexHtml 743.2 ms 9.7 ms 8.6 ms 145 MB 主な観察点: ABCpdfは生の変換速度が速いことを示します IronPDFは完全Chromeエンジンのためにさらにメモリを使用します 両ライブラリとも、ドキュメントの複雑さに応じて線形にスケールします IronPDFのオーバーヘッドがより良いレンダリング精度を提供します 高度な機能比較 デジタル署名とセキュリティ IronPDFのデジタル署名実装 using IronPdf; using IronPdf.Signing; using System.Security.Cryptography.X509Certificates; public class SecurityFeatures { public static void ApplyDigitalSignature() { // Load existing PDF var pdf = PdfDocument.FromFile("unsigned-document.pdf"); // Load certificate var cert = new X509Certificate2("certificate.pfx", "password"); // Create signature var signature = new PdfSignature(cert) { // Visual signature appearance SignatureImage = new PdfSignature.SignatureImage { ImagePath = "signature.png", Width = 200, Height = 100 }, // Signature position PageIndex = 0, X = 400, Y = 100, // Signature details Reason = "Document approved", Location = "New York, NY", ContactInfo = "john.doe@company.com" }; // Apply signature pdf.Sign(signature); // Additional security pdf.SecuritySettings = new SecuritySettings { AllowUserPrinting = true, AllowUserCopyPasteContent = false, AllowUserEditing = false, AllowUserFormData = true, OwnerPassword = "owner123", UserPassword = "user123", EncryptionLevel = EncryptionLevel.AES256 }; pdf.SaveAs("signed-secured.pdf"); } } using IronPdf; using IronPdf.Signing; using System.Security.Cryptography.X509Certificates; public class SecurityFeatures { public static void ApplyDigitalSignature() { // Load existing PDF var pdf = PdfDocument.FromFile("unsigned-document.pdf"); // Load certificate var cert = new X509Certificate2("certificate.pfx", "password"); // Create signature var signature = new PdfSignature(cert) { // Visual signature appearance SignatureImage = new PdfSignature.SignatureImage { ImagePath = "signature.png", Width = 200, Height = 100 }, // Signature position PageIndex = 0, X = 400, Y = 100, // Signature details Reason = "Document approved", Location = "New York, NY", ContactInfo = "john.doe@company.com" }; // Apply signature pdf.Sign(signature); // Additional security pdf.SecuritySettings = new SecuritySettings { AllowUserPrinting = true, AllowUserCopyPasteContent = false, AllowUserEditing = false, AllowUserFormData = true, OwnerPassword = "owner123", UserPassword = "user123", EncryptionLevel = EncryptionLevel.AES256 }; pdf.SaveAs("signed-secured.pdf"); } } Imports IronPdf Imports IronPdf.Signing Imports System.Security.Cryptography.X509Certificates Public Class SecurityFeatures Public Shared Sub ApplyDigitalSignature() ' Load existing PDF Dim pdf = PdfDocument.FromFile("unsigned-document.pdf") ' Load certificate Dim cert = New X509Certificate2("certificate.pfx", "password") ' Create signature Dim signature = New PdfSignature(cert) With { .SignatureImage = New PdfSignature.SignatureImage With { .ImagePath = "signature.png", .Width = 200, .Height = 100 }, .PageIndex = 0, .X = 400, .Y = 100, .Reason = "Document approved", .Location = "New York, NY", .ContactInfo = "john.doe@company.com" } ' Apply signature pdf.Sign(signature) ' Additional security pdf.SecuritySettings = New SecuritySettings With { .AllowUserPrinting = True, .AllowUserCopyPasteContent = False, .AllowUserEditing = False, .AllowUserFormData = True, .OwnerPassword = "owner123", .UserPassword = "user123", .EncryptionLevel = EncryptionLevel.AES256 } pdf.SaveAs("signed-secured.pdf") End Sub End Class $vbLabelText $csharpLabel ABCpdfのデジタル署名実装 using WebSupergoo.ABCpdf13; using WebSupergoo.ABCpdf13.Objects; public class ABCpdfSecurity { public static void SignDocument() { using (Doc theDoc = new Doc()) { theDoc.Read("unsigned-document.pdf"); // Create signature field Field signatureField = theDoc.Form.AddFieldSignature("AuthorSignature"); signatureField.Page = 1; signatureField.Rect = "400 100 600 200"; // Configure signature Signature theSig = signatureField.Sign(); theSig.Reason = "Document approved"; theSig.Location = "New York, NY"; theSig.ContactInfo = "john.doe@company.com"; // Load certificate theSig.LoadCertificate("certificate.pfx", "password"); // Apply visual signature theSig.Visible = true; theSig.Image = theDoc.AddImageFile("signature.png"); // Sign and save theDoc.Save("abcpdf-signed.pdf"); } } } using WebSupergoo.ABCpdf13; using WebSupergoo.ABCpdf13.Objects; public class ABCpdfSecurity { public static void SignDocument() { using (Doc theDoc = new Doc()) { theDoc.Read("unsigned-document.pdf"); // Create signature field Field signatureField = theDoc.Form.AddFieldSignature("AuthorSignature"); signatureField.Page = 1; signatureField.Rect = "400 100 600 200"; // Configure signature Signature theSig = signatureField.Sign(); theSig.Reason = "Document approved"; theSig.Location = "New York, NY"; theSig.ContactInfo = "john.doe@company.com"; // Load certificate theSig.LoadCertificate("certificate.pfx", "password"); // Apply visual signature theSig.Visible = true; theSig.Image = theDoc.AddImageFile("signature.png"); // Sign and save theDoc.Save("abcpdf-signed.pdf"); } } } Imports WebSupergoo.ABCpdf13 Imports WebSupergoo.ABCpdf13.Objects Public Class ABCpdfSecurity Public Shared Sub SignDocument() Using theDoc As New Doc() theDoc.Read("unsigned-document.pdf") ' Create signature field Dim signatureField As Field = theDoc.Form.AddFieldSignature("AuthorSignature") signatureField.Page = 1 signatureField.Rect = "400 100 600 200" ' Configure signature Dim theSig As Signature = signatureField.Sign() theSig.Reason = "Document approved" theSig.Location = "New York, NY" theSig.ContactInfo = "john.doe@company.com" ' Load certificate theSig.LoadCertificate("certificate.pfx", "password") ' Apply visual signature theSig.Visible = True theSig.Image = theDoc.AddImageFile("signature.png") ' Sign and save theDoc.Save("abcpdf-signed.pdf") End Using End Sub End Class $vbLabelText $csharpLabel フォームの取り扱いとデータ抽出 IronPDFのフォーム管理 public class FormHandling { public static void WorkWithForms() { // Create PDF with form fields from HTML var renderer = new ChromePdfRenderer(); renderer.RenderingOptions.CreatePdfFormsFromHtml = true; string formHtml = @" <form> <label>Name: <input type='text' name='fullname' required></label><br> <label>Email: <input type='email' name='email' required></label><br> <label>Subscribe: <input type='checkbox' name='subscribe' value='yes'></label><br> <label>Country: <select name='country'> <option>USA</option> <option>Canada</option> <option>UK</option> </select> </label><br> <button type='submit'>Submit</button> </form>"; var pdf = renderer.RenderHtmlAsPdf(formHtml); // Fill form programmatically pdf.Form.Fields["fullname"].Value = "John Doe"; pdf.Form.Fields["email"].Value = "john@example.com"; pdf.Form.Fields["subscribe"].Value = "yes"; pdf.Form.Fields["country"].Value = "USA"; // Extract form data foreach (var field in pdf.Form.Fields) { Console.WriteLine($"{field.Name}: {field.Value}"); } // Flatten form (make non-editable) pdf.Form.Flatten(); pdf.SaveAs("filled-form.pdf"); } } public class FormHandling { public static void WorkWithForms() { // Create PDF with form fields from HTML var renderer = new ChromePdfRenderer(); renderer.RenderingOptions.CreatePdfFormsFromHtml = true; string formHtml = @" <form> <label>Name: <input type='text' name='fullname' required></label><br> <label>Email: <input type='email' name='email' required></label><br> <label>Subscribe: <input type='checkbox' name='subscribe' value='yes'></label><br> <label>Country: <select name='country'> <option>USA</option> <option>Canada</option> <option>UK</option> </select> </label><br> <button type='submit'>Submit</button> </form>"; var pdf = renderer.RenderHtmlAsPdf(formHtml); // Fill form programmatically pdf.Form.Fields["fullname"].Value = "John Doe"; pdf.Form.Fields["email"].Value = "john@example.com"; pdf.Form.Fields["subscribe"].Value = "yes"; pdf.Form.Fields["country"].Value = "USA"; // Extract form data foreach (var field in pdf.Form.Fields) { Console.WriteLine($"{field.Name}: {field.Value}"); } // Flatten form (make non-editable) pdf.Form.Flatten(); pdf.SaveAs("filled-form.pdf"); } } Public Class FormHandling Public Shared Sub WorkWithForms() ' Create PDF with form fields from HTML Dim renderer = New ChromePdfRenderer() renderer.RenderingOptions.CreatePdfFormsFromHtml = True Dim formHtml As String = " <form> <label>Name: <input type='text' name='fullname' required></label><br> <label>Email: <input type='email' name='email' required></label><br> <label>Subscribe: <input type='checkbox' name='subscribe' value='yes'></label><br> <label>Country: <select name='country'> <option>USA</option> <option>Canada</option> <option>UK</option> </select> </label><br> <button type='submit'>Submit</button> </form>" Dim pdf = renderer.RenderHtmlAsPdf(formHtml) ' Fill form programmatically pdf.Form.Fields("fullname").Value = "John Doe" pdf.Form.Fields("email").Value = "john@example.com" pdf.Form.Fields("subscribe").Value = "yes" pdf.Form.Fields("country").Value = "USA" ' Extract form data For Each field In pdf.Form.Fields Console.WriteLine($"{field.Name}: {field.Value}") Next field ' Flatten form (make non-editable) pdf.Form.Flatten() pdf.SaveAs("filled-form.pdf") End Sub End Class $vbLabelText $csharpLabel バッチ処理と最適化 IronPDFのバッチ処理 using System.Threading.Tasks; using System.Collections.Concurrent; public class BatchProcessing { public static async Task ProcessMultipleDocumentsAsync(List<string> htmlFiles) { var renderer = new ChromePdfRenderer(); renderer.RenderingOptions.PaperSize = PdfPaperSize.A4; // Use concurrent processing var pdfResults = new ConcurrentBag<(string filename, byte[] data)>(); await Parallel.ForEachAsync(htmlFiles, async (htmlFile, ct) => { try { var html = await File.ReadAllTextAsync(htmlFile); var pdf = await renderer.RenderHtmlAsPdfAsync(html); // Optimize each PDF pdf.CompressImages(70); var filename = Path.GetFileNameWithoutExtension(htmlFile) + ".pdf"; var data = pdf.BinaryData; pdfResults.Add((filename, data)); } catch (Exception ex) { Console.WriteLine($"Error processing {htmlFile}: {ex.Message}"); } }); // Merge all PDFs into one var finalPdf = new PdfDocument(); foreach (var (filename, data) in pdfResults.OrderBy(x => x.filename)) { var pdf = new PdfDocument(data); finalPdf.AppendPdf(pdf); } finalPdf.SaveAs("batch-processed.pdf"); } } using System.Threading.Tasks; using System.Collections.Concurrent; public class BatchProcessing { public static async Task ProcessMultipleDocumentsAsync(List<string> htmlFiles) { var renderer = new ChromePdfRenderer(); renderer.RenderingOptions.PaperSize = PdfPaperSize.A4; // Use concurrent processing var pdfResults = new ConcurrentBag<(string filename, byte[] data)>(); await Parallel.ForEachAsync(htmlFiles, async (htmlFile, ct) => { try { var html = await File.ReadAllTextAsync(htmlFile); var pdf = await renderer.RenderHtmlAsPdfAsync(html); // Optimize each PDF pdf.CompressImages(70); var filename = Path.GetFileNameWithoutExtension(htmlFile) + ".pdf"; var data = pdf.BinaryData; pdfResults.Add((filename, data)); } catch (Exception ex) { Console.WriteLine($"Error processing {htmlFile}: {ex.Message}"); } }); // Merge all PDFs into one var finalPdf = new PdfDocument(); foreach (var (filename, data) in pdfResults.OrderBy(x => x.filename)) { var pdf = new PdfDocument(data); finalPdf.AppendPdf(pdf); } finalPdf.SaveAs("batch-processed.pdf"); } } Imports System.Threading.Tasks Imports System.Collections.Concurrent Public Class BatchProcessing Public Shared Async Function ProcessMultipleDocumentsAsync(ByVal htmlFiles As List(Of String)) As Task Dim renderer = New ChromePdfRenderer() renderer.RenderingOptions.PaperSize = PdfPaperSize.A4 ' Use concurrent processing Dim pdfResults = New ConcurrentBag(Of (filename As String, data As Byte()))() Await Parallel.ForEachAsync(htmlFiles, Async Sub(htmlFile, ct) Try Dim html = Await File.ReadAllTextAsync(htmlFile) Dim pdf = Await renderer.RenderHtmlAsPdfAsync(html) ' Optimize each PDF pdf.CompressImages(70) Dim filename = Path.GetFileNameWithoutExtension(htmlFile) & ".pdf" Dim data = pdf.BinaryData pdfResults.Add((filename, data)) Catch ex As Exception Console.WriteLine($"Error processing {htmlFile}: {ex.Message}") End Try End Sub) ' Merge all PDFs into one Dim finalPdf = New PdfDocument() foreach var(filename, data) In pdfResults.OrderBy(Function(x) x.filename) Dim pdf = New PdfDocument(data) finalPdf.AppendPdf(pdf) Next finalPdf.SaveAs("batch-processed.pdf") End Function End Class $vbLabelText $csharpLabel 実際の使用例シナリオ どのライブラリがプロジェクトに適しているか? IronPDFを選ぶとき: クラウドネイティブアプリケーションを構築する場合 最小限の構成でのネイティブDockerサポート Azure FunctionsおよびAWS Lambda互換性 すべてのクラウドプラットフォームでの一貫した動作 ピクセルパーフェクトなHTMLレンダリングが必要な場合 複雑なCSSレイアウト (グリッド、フレックスボックス) JavaScript重視のシングルページアプリケーション ウェブフォントの要件 クロスプラットフォームソリューションを開発する場合 Windows、Linux、macOSをターゲットにしたアプリケーション マイクロサービスアーキテクチャ コンテナベースのデプロイメント 開発者体験を優先する場合 迅速なプロトタイピングのニーズ 小さな開発チーム 限られたPDFの専門知識 ABCpdfを選ぶとき: レガシーシステムで作業する場合 Windowsのみの環境 既存のABCpdf実装 IE互換のコンテンツ要件 特定のレンダリングエンジンが必要な場合 異なるブラウザ間のテスト エンジン固有の最適化 レガシー・ブラウザのサポート 高度なPDF操作 低レベルのPDFオブジェクトアクセス カスタムPDFオペレーター 複雑なドキュメントマージシナリオ 予算に敏感なプロジェクト 低いエントリープライスポイント 単一開発者ライセンス 32ビット環境の互換性 一般的な問題のトラブルシューティング IronPDFの一般的な問題と解決策 public class IronPdfTroubleshooting { // Issue: Fonts not rendering correctly public static void FixFontIssues() { var renderer = new ChromePdfRenderer(); // Solution 1: Wait for fonts to load renderer.RenderingOptions.WaitFor.RenderDelay(1000); // Solution 2: Use system fonts fallback renderer.RenderingOptions.CssMediaType = PdfCssMediaType.Print; } // Issue: JavaScript not executing public static void FixJavaScriptIssues() { var renderer = new ChromePdfRenderer(); // Enable JavaScript and wait for execution renderer.RenderingOptions.EnableJavaScript = true; renderer.RenderingOptions.WaitFor.JavaScriptFinishDelay = 2000; renderer.RenderingOptions.WaitFor.AllowedExecutionTime = 30000; } // Issue: メモリ usage in Docker public static void OptimizeForDocker() { var renderer = new ChromePdfRenderer(); // Use single-threaded mode for containers IronPdf.Installation.SingleThreaded = true; // Reduce memory footprint renderer.RenderingOptions.ViewPortWidth = 1024; renderer.RenderingOptions.EnableGrayscale = true; } } public class IronPdfTroubleshooting { // Issue: Fonts not rendering correctly public static void FixFontIssues() { var renderer = new ChromePdfRenderer(); // Solution 1: Wait for fonts to load renderer.RenderingOptions.WaitFor.RenderDelay(1000); // Solution 2: Use system fonts fallback renderer.RenderingOptions.CssMediaType = PdfCssMediaType.Print; } // Issue: JavaScript not executing public static void FixJavaScriptIssues() { var renderer = new ChromePdfRenderer(); // Enable JavaScript and wait for execution renderer.RenderingOptions.EnableJavaScript = true; renderer.RenderingOptions.WaitFor.JavaScriptFinishDelay = 2000; renderer.RenderingOptions.WaitFor.AllowedExecutionTime = 30000; } // Issue: メモリ usage in Docker public static void OptimizeForDocker() { var renderer = new ChromePdfRenderer(); // Use single-threaded mode for containers IronPdf.Installation.SingleThreaded = true; // Reduce memory footprint renderer.RenderingOptions.ViewPortWidth = 1024; renderer.RenderingOptions.EnableGrayscale = true; } } IRON VB CONVERTER ERROR developers@ironsoftware.com $vbLabelText $csharpLabel ABCpdfの一般的な問題と解決策 public class ABCpdfTroubleshooting { // Issue: Page breaks in wrong places public static void FixPageBreaks() { using (Doc theDoc = new Doc()) { // Use HTML page break controls theDoc.HtmlOptions.BreakZoneSize = 100; // pixels theDoc.HtmlOptions.UseScript = true; string html = @" <style> .page-break { page-break-after: always; } .no-break { page-break-inside: avoid; } </style> <div class='no-break'>Keep this content together</div> <div class='page-break'></div> <div>New page content</div>"; theDoc.AddImageHtml(html); theDoc.Save("fixed-breaks.pdf"); } } // Issue: Images not loading public static void FixImageLoading() { using (Doc theDoc = new Doc()) { // Set timeout and authentication theDoc.HtmlOptions.Timeout = 60000; // 60 seconds theDoc.HtmlOptions.RetryCount = 3; // For local images, set base directory theDoc.HtmlOptions.BaseUrl = @"file:///C:/Images/"; theDoc.AddImageHtml("<img src='logo.png'>"); theDoc.Save("with-images.pdf"); } } } public class ABCpdfTroubleshooting { // Issue: Page breaks in wrong places public static void FixPageBreaks() { using (Doc theDoc = new Doc()) { // Use HTML page break controls theDoc.HtmlOptions.BreakZoneSize = 100; // pixels theDoc.HtmlOptions.UseScript = true; string html = @" <style> .page-break { page-break-after: always; } .no-break { page-break-inside: avoid; } </style> <div class='no-break'>Keep this content together</div> <div class='page-break'></div> <div>New page content</div>"; theDoc.AddImageHtml(html); theDoc.Save("fixed-breaks.pdf"); } } // Issue: Images not loading public static void FixImageLoading() { using (Doc theDoc = new Doc()) { // Set timeout and authentication theDoc.HtmlOptions.Timeout = 60000; // 60 seconds theDoc.HtmlOptions.RetryCount = 3; // For local images, set base directory theDoc.HtmlOptions.BaseUrl = @"file:///C:/Images/"; theDoc.AddImageHtml("<img src='logo.png'>"); theDoc.Save("with-images.pdf"); } } } Public Class ABCpdfTroubleshooting ' Issue: Page breaks in wrong places Public Shared Sub FixPageBreaks() Using theDoc As New Doc() ' Use HTML page break controls theDoc.HtmlOptions.BreakZoneSize = 100 ' pixels theDoc.HtmlOptions.UseScript = True Dim html As String = " <style> .page-break { page-break-after: always; } .no-break { page-break-inside: avoid; } </style> <div class='no-break'>Keep this content together</div> <div class='page-break'></div> <div>New page content</div>" theDoc.AddImageHtml(html) theDoc.Save("fixed-breaks.pdf") End Using End Sub ' Issue: Images not loading Public Shared Sub FixImageLoading() Using theDoc As New Doc() ' Set timeout and authentication theDoc.HtmlOptions.Timeout = 60000 ' 60 seconds theDoc.HtmlOptions.RetryCount = 3 ' For local images, set base directory theDoc.HtmlOptions.BaseUrl = "file:///C:/Images/" theDoc.AddImageHtml("<img src='logo.png'>") theDoc.Save("with-images.pdf") End Using End Sub End Class $vbLabelText $csharpLabel ライブラリ間の移行ガイド ABCpdfからIronPDFへの移行 public class MigrationHelper { // ABCpdf code public void OldABCpdfMethod() { Doc theDoc = new Doc(); theDoc.AddImageUrl("https://example.com"); theDoc.Save("output.pdf"); theDoc.Dispose(); } // Equivalent IronPDF code public void NewIronPdfMethod() { var renderer = new ChromePdfRenderer(); var pdf = renderer.RenderUrlAsPdf("https://example.com"); pdf.SaveAs("output.pdf"); } // Migration wrapper for gradual transition public class PdfWrapper { private bool _useIronPdf; public PdfWrapper(bool useIronPdf = true) { _useIronPdf = useIronPdf; } public void ConvertUrlToPdf(string url, string outputPath) { if (_useIronPdf) { var renderer = new ChromePdfRenderer(); var pdf = renderer.RenderUrlAsPdf(url); pdf.SaveAs(outputPath); } else { using (var doc = new Doc()) { doc.AddImageUrl(url); doc.Save(outputPath); } } } } } public class MigrationHelper { // ABCpdf code public void OldABCpdfMethod() { Doc theDoc = new Doc(); theDoc.AddImageUrl("https://example.com"); theDoc.Save("output.pdf"); theDoc.Dispose(); } // Equivalent IronPDF code public void NewIronPdfMethod() { var renderer = new ChromePdfRenderer(); var pdf = renderer.RenderUrlAsPdf("https://example.com"); pdf.SaveAs("output.pdf"); } // Migration wrapper for gradual transition public class PdfWrapper { private bool _useIronPdf; public PdfWrapper(bool useIronPdf = true) { _useIronPdf = useIronPdf; } public void ConvertUrlToPdf(string url, string outputPath) { if (_useIronPdf) { var renderer = new ChromePdfRenderer(); var pdf = renderer.RenderUrlAsPdf(url); pdf.SaveAs(outputPath); } else { using (var doc = new Doc()) { doc.AddImageUrl(url); doc.Save(outputPath); } } } } } Public Class MigrationHelper ' ABCpdf code Public Sub OldABCpdfMethod() Dim theDoc As New Doc() theDoc.AddImageUrl("https://example.com") theDoc.Save("output.pdf") theDoc.Dispose() End Sub ' Equivalent IronPDF code Public Sub NewIronPdfMethod() Dim renderer = New ChromePdfRenderer() Dim pdf = renderer.RenderUrlAsPdf("https://example.com") pdf.SaveAs("output.pdf") End Sub ' Migration wrapper for gradual transition Public Class PdfWrapper Private _useIronPdf As Boolean Public Sub New(Optional ByVal useIronPdf As Boolean = True) _useIronPdf = useIronPdf End Sub Public Sub ConvertUrlToPdf(ByVal url As String, ByVal outputPath As String) If _useIronPdf Then Dim renderer = New ChromePdfRenderer() Dim pdf = renderer.RenderUrlAsPdf(url) pdf.SaveAs(outputPath) Else Using doc As New Doc() doc.AddImageUrl(url) doc.Save(outputPath) End Using End If End Sub End Class End Class $vbLabelText $csharpLabel ライセンスと総所有コスト プロジェクトのROI計算 PDFライブラリを評価する際は、ライセンス価格を超えた総コストを考慮してください: IronPDFのコスト分析 開発時間の節約: 実装が50-70%速くなります サポートコスト: 24/5のエンジニアリングサポートが含まれる 維持費: プラットフォーム間の統一API 拡張性: 単一のライセンスで複数のデプロイメントをカバー ABCpdfのコスト分析 初期コスト: 低いエントリー価格 隠れたコスト: 別の64ビットライセンス 複数のエンジン要件 プラットフォーム固有のテスト 追加のサポートコスト ライセンス比較計算機 public class LicenseCostCalculator { public static void CalculateTotalCost() { // Scenario: 5-developer team, 3-year project // IronPDF Professional var ironPdfCost = new { License = 2999, // 10 developers, 10 projects Support = 0, // Included Training = 500, // Minimal due to simple API ThreeYearTotal = 3499 }; // ABCpdf equivalent setup var abcPdfCost = new { StandardLicenses = 329 * 5, // 5 developers ProfessionalUpgrade = 150 * 5, // 64-bit support RedistributionLicense = 4790, // Enterprise Support = 399 * 3, // Annual support Training = 2000, // Complex API training ThreeYearTotal = 1645 + 750 + 4790 + 1197 + 2000 }; Console.WriteLine($"IronPDF 3-year TCO: ${ironPdfCost.ThreeYearTotal:N0}"); Console.WriteLine($"ABCpdf 3-year TCO: ${abcPdfCost.ThreeYearTotal:N0}"); Console.WriteLine($"Savings with IronPDF: ${abcPdfCost.ThreeYearTotal - ironPdfCost.ThreeYearTotal:N0}"); } } public class LicenseCostCalculator { public static void CalculateTotalCost() { // Scenario: 5-developer team, 3-year project // IronPDF Professional var ironPdfCost = new { License = 2999, // 10 developers, 10 projects Support = 0, // Included Training = 500, // Minimal due to simple API ThreeYearTotal = 3499 }; // ABCpdf equivalent setup var abcPdfCost = new { StandardLicenses = 329 * 5, // 5 developers ProfessionalUpgrade = 150 * 5, // 64-bit support RedistributionLicense = 4790, // Enterprise Support = 399 * 3, // Annual support Training = 2000, // Complex API training ThreeYearTotal = 1645 + 750 + 4790 + 1197 + 2000 }; Console.WriteLine($"IronPDF 3-year TCO: ${ironPdfCost.ThreeYearTotal:N0}"); Console.WriteLine($"ABCpdf 3-year TCO: ${abcPdfCost.ThreeYearTotal:N0}"); Console.WriteLine($"Savings with IronPDF: ${abcPdfCost.ThreeYearTotal - ironPdfCost.ThreeYearTotal:N0}"); } } Public Class LicenseCostCalculator Public Shared Sub CalculateTotalCost() ' Scenario: 5-developer team, 3-year project ' IronPDF Professional Dim ironPdfCost = New With { Key .License = 2999, Key .Support = 0, Key .Training = 500, Key .ThreeYearTotal = 3499 } ' ABCpdf equivalent setup Dim abcPdfCost = New With { Key .StandardLicenses = 329 * 5, Key .ProfessionalUpgrade = 150 * 5, Key .RedistributionLicense = 4790, Key .Support = 399 * 3, Key .Training = 2000, Key .ThreeYearTotal = 1645 + 750 + 4790 + 1197 + 2000 } Console.WriteLine($"IronPDF 3-year TCO: ${ironPdfCost.ThreeYearTotal:N0}") Console.WriteLine($"ABCpdf 3-year TCO: ${abcPdfCost.ThreeYearTotal:N0}") Console.WriteLine($"Savings with IronPDF: ${abcPdfCost.ThreeYearTotal - ironPdfCost.ThreeYearTotal:N0}") End Sub End Class $vbLabelText $csharpLabel 結論 両ライブラリの包括的な分析の後、いくつかの主要な差別化要因が浮かび上がります: IronPDFは以下で優れています: Chromeベースのレンダリングを用いたモダンなウェブ技術のサポート クロスプラットフォームの一貫性とクラウドネイティブデプロイメント 直感的なAPIによる開発者の生産性 包括的なサポートとドキュメンテーション 拡張し続けるチームに対するより良い長期的価値 ABCpdfが提供する利点: Windowsのみの基本プロジェクトに対する低い初期コスト 複数のレンダリングエンジンオプション レガシーシステムの互換性 シンプルなドキュメントのための低メモリフットプリント IronPDFはすべてのPDF問題への単一の解決策を提供します。 IronPDFを購入すると、単一のライブラリでのすべての変換が得られ、PDFドキュメントにのみ関連するタスクが追加の依存関係を必要としません。 この統合されたアプローチは、優れたレンダリング品質とクロスプラットフォームサポートを組み合わせることで、ほとんどのモダンな.NETアプリケーションにおける推奨される選択肢です。 迅速な開発、一貫したプラットフォーム間での結果、そして長期的なメンテナンス性を優先するチームにとって、IronPDFの高い初期コストは、開発時間の短縮、より良いサポート、互換性の問題が少ないことで相殺されます。 IronPDFを始めよう 違いを体験する準備はできましたか? 無料トライアルを始める今日: // Get started in minutes // Install-Package IronPdf // Your first PDF in 3 lines var renderer = new ChromePdfRenderer(); var pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>"); pdf.SaveAs("my-first-pdf.pdf"); // Get started in minutes // Install-Package IronPdf // Your first PDF in 3 lines var renderer = new ChromePdfRenderer(); var pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>"); pdf.SaveAs("my-first-pdf.pdf"); IRON VB CONVERTER ERROR developers@ironsoftware.com $vbLabelText $csharpLabel Visit our comprehensive documentation, explore code examples, or chat with our engineering team for personalized guidance on your PDF generation needs. ご注意ABCpdfはその関連オーナーの登録商標です。 このサイトはABCpdfと関連する、承認された、またはスポンサーされたものではありません。 すべての製品名、ロゴ、およびブランドは各所有者の所有物です。 比較は情報提供のみを目的としており、執筆時点で公開されている情報を反映しています。 よくある質問 レンダリングエンジンの観点から、IronPDF と ABCpdf の主な違いは何ですか? IronPDF は Chrome ベースのレンダリングエンジンを使用しており、ピクセルパーフェクトな出力を提供し、CSS3 と JavaScript を完全にサポートしているため、最新のウェブ技術のレンダリングに理想的です。対して、ABCpdf は Chrome、Firefox、または IE のような複数のレンダリングエンジンを提供し、柔軟性を持たせていますが、より多くのテストと設定が必要です。 IronPDF の HTML から PDF への変換品質は、ABCpdf と比較してどうですか? IronPDF は、Chrome ベースのエンジンによりレンダリング精度に優れ、最新のブラウザの出力と一致します。ABCpdf はやや高速ですが、複雑な最新のウェブコンテンツにおいて同じレベルの精度を提供しないことがあるかもしれません。 IronPDF と ABCpdf の互換性の違いは何ですか? IronPDF は Windows、Linux、macOS、および Docker コンテナで動作するネイティブクロスプラットフォームサポートを提供します。ABCpdf は主に Windows 環境を対象としており、多様な開発セットアップにおける使用が制限されるかもしれません。 長期的に .NET アプリケーション向けにより良い価値を提供するのは、IronPDF か ABCpdf か? ABCpdf は初期価格が低いですが、IronPDF は包括的なサポート、最新のアーキテクチャ、および統一された API を提供し、特に継続的なメンテナンスと更新が必要な現代の .NET アプリケーションにとって長期的な価値があります。 企業向け使用における IronPDF のライセンスモデルと ABCpdf の比較はどのようなものですか? IronPDF のライセンスは $749 から始まりますが、ABCpdf は $329 という低い初期価格を提供します。しかし、総所有コストの計算では、拡張サポートと更新によって IronPDF が企業利用においてコスト効率の高い選択であることが示されています。 ABCpdf から IronPDF への移行戦略にはどのようなものがありますか? ABCpdf から IronPDF への移行には、IronPDF の包括的な API ドキュメントとサポートリソースを活用できます。開発者は、現在の機能を IronPDF のメソッドにマッピングし、出力を徹底的にテストして一貫した結果を保証するべきです。 IronPDF は JavaScript を伴う動的 HTML コンテンツを処理できますか? はい、IronPDF はレンダリング前に JavaScript を実行でき、動的コンテンツ、AJAX コール、および最新のフレームワークをサポートします。動的要素の完全な処理を保証するために、待機時間やレンダリング遅延を設定できます。 IronPDF 使用時のレンダリング問題のトラブルシューティングに推奨されるアプローチは何ですか? IronPDF のレンダリング問題を解決するには、まず Chrome エンジンが CSS 機能をサポートしていることを確認します。PDF 特有のスタイルにはプリントメディアクエリを使用し、ブラウザ開発ツールで CSS を検証し、問題を特定するために簡単化された HTML でテストします。 Jacob Mellor 今すぐエンジニアリングチームとチャット 最高技術責任者(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技術の革新を推進し続け、次世代の技術リーダーを指導しています。 関連する記事 公開日 11月 13, 2025 C#のHTMLからPDFへのオープンソース対IronPDFの比較 C#用のオープンソースのHTMLからPDFライブラリをIronPDFと比較します。あなたの.NETプロジェクトに最適なPDF生成能力を提供するソリューションを見つけましょう。 詳しく読む 公開日 10月 27, 2025 どのASP.NET Core PDFライブラリが最も価値がありますか? ASP.NET Core アプリケーションに最適な PDF ライブラリを発見しよう。IronPDF の Chrome エンジンを Aspose および Syncfusion の代替案と比較します。 詳しく読む 公開日 10月 27, 2025 Aspose C# VS IronPDFでPDFを作成する方法 このステップバイステップガイドで、開発者向けにデザインされた Aspose C# と IronPDF を使用して PDF を作成する方法を学びましょう。 詳しく読む IronPDFとWinnovative PDF Library for .NETの比較IronPDFとBitmiracle.Docotic.Pdfの...
公開日 11月 13, 2025 C#のHTMLからPDFへのオープンソース対IronPDFの比較 C#用のオープンソースのHTMLからPDFライブラリをIronPDFと比較します。あなたの.NETプロジェクトに最適なPDF生成能力を提供するソリューションを見つけましょう。 詳しく読む
公開日 10月 27, 2025 どのASP.NET Core PDFライブラリが最も価値がありますか? ASP.NET Core アプリケーションに最適な PDF ライブラリを発見しよう。IronPDF の Chrome エンジンを Aspose および Syncfusion の代替案と比較します。 詳しく読む
公開日 10月 27, 2025 Aspose C# VS IronPDFでPDFを作成する方法 このステップバイステップガイドで、開発者向けにデザインされた Aspose C# と IronPDF を使用して PDF を作成する方法を学びましょう。 詳しく読む