IRONSOFTWAREHOME
PDF工具

IronPDF和ABCpdf:哪個C# PDF庫在2025年提供更好的HTML到PDF轉換?

Jacob Mellor,首席技術官 @ Team Iron
Jacob Mellor
Updated: 2026年6月28日

PDF文件在各種行業中被廣泛用於像是開立發票和建立不同型別的文件這類工作。它們能有效滿足客戶需求。 在進行需要PDF生成的.NET應用程式開發時,選擇合適的程式庫會極大影響您的開發速度、輸出品質和長期維護成本。 開發者常考慮的兩個程式庫是IronPDF和ABCpdf——但哪個更能滿足您的具體需求?

這個詳細的比較將從HTML到PDF的轉換準確性到授權模式,幫助您做出明智的決策。 我們將查看真實世界的性能指標、API設計理念以及演示每個程式庫優勢和限制的實際程式碼範例。 無論您是在構建每天生成數千張發票的SaaS平台還是需要精確文件呈現的企業應用程式,理解這些差異對於專案成功至關重要。

什麼是IronPDF?

IronPDF是一個商業級的PDF生成程式庫,可以幫助C#軟體工程師在.NET專案中編輯、提取和生成PDF文件。 IronPDF以Chrome為基礎的渲染引擎為核心,將HTML、CSS和JavaScript轉化為PDF,達到與Google Chrome中印刷網頁相同的效果。

IronPDF的主要功能

IronPDF使用.NET Chromium引擎渲染HTML頁面到PDF文件。 使用HTML到PDF時,無需使用複雜的API來定位或設計PDF。 IronPDF支持標準的網頁文件:HTML、ASPX、JS、CSS和圖片。 該程式庫的架構優先考慮開發者的體驗,同時保持專業級的輸出品質。

HTML到PDF轉換卓越性

  • 支援包括HTML5語意元素的完整HTML
  • 完整支持CSS3,包括Flexbox、Grid和現代佈局技術
  • 動態內容呈現的JavaScript執行
  • 網路字體支持,包括Google字體和自訂@font-face聲明
  • 使用視口控制的響應式設計渲染
  • 使用可配置的等待時間來載入AJAX內容

文件操作功能

  • **合併和拆分:**通過單一方法調用將多個PDF合併或提取特定頁面
  • **頁眉和頁腳:**新增動態內容,包括頁碼、日期和自訂HTML
  • **浮水印:**應用文字或圖片浮水印,並可控制透明度及位置
  • **表單管理:**從HTML表單元素自動建立可填寫的PDF表單
  • **數位簽名:**應用帶有證書管理的密碼簽章
  • **加密:**實現128位和256位AES加密,並提供精細的權限控制

高級渲染功能

  • **多執行緒處理:**原生async/await支持高性能場景
  • **批次操作:**針對多個文件同時處理進行了優化
  • **記憶體效率:**支持大型文件生成的串流功能,而不需要將整個PDF載入記憶體
  • **雲端優化:**設計用於在Docker、Azure和AWS中的容器化部署

跨平台架構

IronPDF在不同的環境中保持一致的行為:

  • Windows (x86/x64)
  • Linux(包括Alpine的最小Docker映像)
  • macOS(Intel和Apple Silicon)
  • Azure App Service, Functions, and Container Instances
  • AWS Lambda和EC2
  • Google Cloud Platform

什麼是ABCpdf?

ABCpdf .NET C# PDF程式庫是用於動態讀寫、轉換和操作Adobe PDF文件的.NET組件。 由WebSupergoo開發,ABCpdf已為.NET社群服務超過二十年,並提供多個HTML渲染引擎及全面的PDF操作功能。

ABCpdf的主要功能

ABCpdf完全支持HTML/CSS及相關技術,如JavaScript、SVG、AJAX和Font Awesome。 該程式庫為開發人員提供高級方便的方法以及低級的PDF物件存取。

多個渲染引擎

ABCpdf的獨特方法提供了若干渲染引擎:

  • **ABCChrome引擎:**基於Chromium,適用於現代網路標準(僅x64)
  • **Gecko引擎:**多個版本用於相容性測試
  • **MSHTML引擎:**基於Internet Explorer的渲染
  • **ABCWebKit引擎:**基於WebKit的渲染(僅x64)

這個多引擎方法允許開發人員為其特定內容選擇最佳渲染器,雖然這會增加部署和測試的複雜性。

文件導入功能

當像OpenOffice.org這樣的助手應用程式被安裝時,ABCpdf可以讀取各種文件格式。 支持的格式包括:

  • 微軟Office文件(Word、Excel、PowerPoint)
  • PostScript和EPS文件
  • XPS(XML紙張規範)
  • SVG(可縮放向量圖形)
  • 各種圖片格式,包括TIFF、JPEG 2000和RAW格式

低層次PDF操作

  • 直接存取PDF物件模型
  • 使用多種演算法進行串流壓縮/解壓縮
  • 字體子設和嵌入控制
  • 色彩空間管理及轉換
  • 內容串流操作

性能特點

ABCpdf完全支持多執行緒,允許其靈活地在各種.NET環境中使用,包括C#、ASPX和VB,並在高性能多執行緒設置中進行了測試。 此程式庫包括:

  • GigaPDF™支持超大文件
  • 為伺服器環境優化的記憶體使用
  • 高效的字體快取機制
  • 背景執行緒處理能力

現代CSS框架支持

在處理現代網路應用程式時,將基於Bootstrap的佈局和其他現代CSS框架轉換為PDF的能力愈發重要。 許多企業應用程式和SaaS平台現在依賴Bootstrap來保持其UI的一致性,而且PDF生成需要完美保留這些佈局。

IronPDF:完全支持Bootstrap和現代框架

IronPDF的Chromium渲染引擎全面支持現代CSS框架:

  • **Bootstrap 5:**完全支持基於flexbox的佈局、網格系統和響應式工具
  • **Bootstrap 4:**完全相容包括flexbox卡組、導航欄和表單佈局
  • **Tailwind CSS:**完美呈現的現代實用第一CSS框架
  • **Foundation:**支持所有網格和組件系統
  • **現代CSS3:**Flexbox、CSS Grid、動畫、過渡和自訂屬性

真實世界的範例:Bootstrap主頁和Bootstrap範本以像素完美的精度轉換為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");

**輸出:**一個完美格式化的產品目錄,帶有Bootstrap 5的卡片網格系統、flexbox對齊和響應式間距——全部保存在PDF中。

ABCpdf:多引擎方法存在框架限制

ABCpdf對現代CSS框架的支持因所選渲染引擎的不同而顯著不同:

  • ABCChrome引擎(僅x64):良好的Bootstrap支持類似於IronPDF,但需要具體的64位平台配置
  • ABCWebKit引擎(僅x64):有限的flexbox支持,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指南。

徹底的功能比較

表格 4
IronPDF和ABCpdf的.NET應用程式功能比較
類別功能/方面IronPDFABCpdf關鍵優勢
核心架構設計理念簡潔優先,直觀的API靈活性優先,多引擎IronPDF:更快的開發
API複雜性簡單的方法如RenderHtmlAsPdf()帶有Doc類的面向物件的設計IronPDF:簡單的API
學習曲線降低,單引擎設計提高,多引擎配置要求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, Core 3.0+, Framework 4.0+兩者:現代框架支持
操作系統Windows, Linux, macOS, Docker原生支持Windows,有限的Linux支持IronPDF:更廣泛的OS支持
HTML到PDF渲染引擎Chrome V127+引擎多引擎(Chrome 123, Gecko, MSHTML)ABCpdf:引擎的靈活性
CSS3/HTML5支持Chrome相容(V8引擎)視引擎而定(70-100%)IronPDF:一致的渲染
JavaScript執行完整的V8 JavaScript支持依賴於引擎IronPDF:現代JS功能
Web字體Google字體,@font-face,系統字體支持ABCChrome兩者:Web字體支持
性能單頁渲染取決於文件的複雜性取決於引擎和文件的複雜性兩者:依賴於引擎
批量處理優化的並行處理具備多執行緒能力IronPDF:更好的非同步支持
記憶體使用更高(完整的Chrome引擎)更低(可用較輕的引擎)ABCpdf:較輕的引擎記憶體佔用較少
開發者體驗文件廣泛的教程、影片和範例全面的API文件IronPDF:更多學習資源
程式碼範例100多個即用範例廣泛的範例兩者:豐富的範例
IntelliSense支持完整的XML文件全面的IntelliSense兩者:IDE整合
Licensing & Pricing入門級Lite:$999(1位開發者,1個專案)標準:$329(1位開發者,僅32位)ABCpdf:入門成本較低
專業版專業:$2,399(10位開發者,10個專案)專業:$479(1位開發者,64位)IronPDF:更好的團隊授權
再分發+$2,399免版稅$4,790 Enterprise授權IronPDF:更實惠
支援是否包含支援是,24/5工程支援是,電子郵件支援IronPDF:即時聊天支援
回應時間< 1分鐘(即時聊天)24-48小時典型IronPDF:回應速度更快
最佳用途用例現代網路應用程式、SaaS、雲端原生Windows桌面,傳統系統依具體情況而定

注意。 ABCpdf提供多個渲染引擎以增加靈活性,但須在Windows上才能完全實現。IronPDF透過最新的Chrome引擎提供穩定的跨平台性能。兩者在單一開發者和團隊授權上的價格結構差異顯著。

在Visual Studio中建立新專案

在深入程式碼範例之前,讓我們設置一個合適的開發環境。 打開Visual Studio並建立一個新專案:

  1. 導航至檔案 > 新增 > 專案
  2. 選擇"控制台應用程式"(.NET Core或.NET Framework)
  3. 選擇您的目標框架(建議.NET 6.0或更高版本)
  4. 為您的專案命名(例如,"PdfLibraryComparison")
  5. 點擊建立

在Visual Studio中建立一個新專案 Visual Studio的專案建立對話框,用於設置新的.NET應用程式

IronPDF C# 程式庫安裝

安裝方法

IronPDF提供多種安裝方法以適應不同的開發工作流程:

方法1:使用NuGet套件管理器(推薦)

最簡單的方法是通過Visual Studio的內建NuGet套件管理器:

  1. 在解決方案資源管理器中右鍵單擊您的專案
  2. 選擇"管理NuGet套件"
  3. 點擊"瀏覽"並搜索"IronPDF"
  4. 在官方IronPDF套件上點擊安裝

NuGet套件管理器顯示IronPDF安裝 透過Visual Studio的NuGet套件管理器介面安裝IronPDF

方法2:套件管理器控制台

對喜歡命令行工具的開發者:

PM > Install-Package IronPdf

套件管理器控制台安裝IronPDF 使用套件管理器控制台透過單一指令安裝IronPDF

方法3:直接下載

對於互聯網存取受限的環境:

  1. Download from NuGet.org
  2. 將.nupkg文件新增到本地NuGet餵
  3. 從您的本地餵中安裝

方法4:.NET CLI

對於.NET Core/5+項目:

> dotnet add package IronPdf

安裝ABCpdf

安裝方法

ABCpdf提供類似的安裝選項,並有一些額外的考慮:

方法1:NuGet安裝

PM > Install-Package ABCpdf -Version 13.0.0.0

請注意,ABCpdf有不同版本的獨立套件:

  • ABCpdf - 標準版(僅32位)
  • ABCpdf.ABCChrome64 - 必須的64位Chrome渲染
  • ABCpdf.ABCGecko - 為Gecko渲染引擎使用

方法2:手動安裝

  1. 從WebSupergoo網站下載
  2. 提取ZIP文件
  3. 新增對應的DLL參考
  4. 將本地依賴項複製到您的輸出目錄

特定平台考量

ABCpdf在非Windows平台上需要額外設置:

<!-- For Linux deployment -->
<PackageReference Include="ABCpdf.Linux" Version="13.0.0.0" />
XML

這些程式庫如何處理HTML到PDF的轉換?

了解每個程式庫對HTML到PDF轉換的基本差異,有助於解釋它們不同的功能和性能特徵。

IronPDF的方法:Chrome優先架構

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字體</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");
C#

此程式碼展示了IronPDF基於Chrome的方法的幾個關鍵優勢:

  1. **現代CSS支持:**網格佈局、flexbox、漸變和變換如同在Chrome中的一樣
  2. **網路字體整合:**自動載入Google字體,無需額外配置
  3. **JavaScript執行:**在PDF渲染前進行動態內容生成
  4. **媒體查詢:**正確應用印刷特定樣式

ABCpdf的方法:多引擎靈活性

ABCpdf提供多個渲染引擎,各有不同的能力:

using WebSupergoo.ABCpdf13;

// Method 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");

// Method 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");

// Method 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");

這個多引擎的方法提供了靈活性,但需要仔細考量:

  1. **引擎選擇:**開發者必須選擇適合其內容的引擎
  2. **功能平等:**不同引擎支援不同的HTML/CSS功能
  3. **部署的複雜性:**每個引擎可能有不同的運行時要求
  4. **測試的負擔:**輸出可能在引擎間有所差異,需要更多的測試

從URL建立PDF文件

PDF程式庫的一個最常見的用例是將即時網頁轉換為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}");
        }
    }
}

展示的關鍵功能:

  • **視口控制:**為響應式測試模擬不同的螢幕大小
  • **身份驗證支持:**為受保護資源新增標頭
  • **動態內容處理:**等待策略用于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聲明

從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
            }
        };
        
        // 專業版 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>專業版 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");
    }
}
C#

這個例子展示了:

  • **專業佈局:**帶有flexbox和grid的複雜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 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");
    }
}

基準考量

上面的基準程式碼使用BenchmarkDotNet作為起始框架。 實際的結果依據硬體、文件複雜性、.NET運行時版本,和引擎配置各不相同。 社群報告中的一些關鍵觀察:

  • IronPDF的Chrome引擎使用的記憶體多於ABCpdf的輕量引擎(Gecko、MSHTML)
  • 當使用時,ABCpdf的ABCChrome引擎與IronPDF相媲美的記憶體開銷
  • 兩者都隨著文件的複雜性擴展
  • IronPDF的基於Chrome的渲染在更高的CSS/JS保真度的代價是額外的資源使用

針對您的工作負載中的代表性文件進行自己的基準測試,以進行準確的比較。

高級功能比較

數位簽名和安全

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");
    }
}

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");
        }
    }
}

表單處理和資料提取

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");
    }
}

批量處理與優化

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");
    }
}

真實世界的使用案例場景

哪個程式庫更適合您的專案?

選擇IronPDF當:

  1. 構建雲端原生應用程式

    • 原生Docker支持,配置最小
    • 與Azure Functions和AWS Lambda相容
    • 在所有雲平台上表現一致
  2. 需要像素完美的HTML渲染

    • 複雜的CSS佈局(Grid, Flexbox)
    • JavaScript繁重的單頁應用程式
    • 網路字體要求
  3. 開發跨平台解決方案

    • 目標是Windows、Linux和macOS的應用程式
    • 微服務架構
    • 基於容器的部署
  4. 優先考慮開發者體驗

    • 快速原型需求
    • 小型開發團隊
    • 有限的PDF專業知識

選擇ABCpdf當:

  1. 與傳統系統合作

    • 僅限Windows的環境
    • 現有的ABCpdf實施
    • IE相容的內容要求
  2. 需要具體的渲染引擎

    • 測試不同的瀏覽器
    • 特定引擎的優化
    • 傳統瀏覽器支持
  3. 高級PDF操作

    • 低層級的PDF物件存取
    • 自訂PDF操作符
    • 複雜文件合併場景
  4. 預算考量的專案

    • 較低的入門價格點
    • 單一開發者授權
    • 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: Memory 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;
    }
}

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");
        }
    }
}

遷移指南:在程式庫之間移動

從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);
                }
            }
        }
    }
}

授權與總擁有成本

計算專案的投資回報率

在評估PDF程式庫時,請考慮超越授權價格的總成本:

IronPDF成本分析

  • **開發時間節省:**更簡單的API減少了實施時間
  • **支持成本:**包括24/5的工程支援
  • **維護:**跨平台統一的API
  • **可擴展性:**單一授權涵蓋多個部署

ABCpdf成本分析

  • **初始成本:**較低的入門價格
  • 隱藏成本:
    • 獨立的64位授權
    • 多個引擎要求
    • 平台特定的測試
    • 額外的支援成本

授權比較計算器

public class LicenseCostCalculator
{
    public static void CalculateTotalCost()
    {
        // Scenario: 5-developer team, 3-year project
        // Note: Prices are illustrative. Verify current pricing at vendor websites.
        
        // IronPDF 專業版 (see ironpdf.com/licensing/for current prices)
        var ironPdfCost = new
        {
            License = 2999, // 10 developers, 10 projects — verify current price
            Support = 0,    // Included in license
            Training = 0,   // Simple API reduces training overhead
        };
        
        // ABCpdf equivalent setup (see websupergoo.com for current prices)
        var abcPdfCost = new
        {
            ProfessionalLicenses = 479 * 5, // 5 專業版 (64-bit) licenses
            RedistributionLicense = 4790,   // Enterprise/再分發 license
            // Training costs may apply due to multi-engine configuration
        };
        
        // Perform your own TCO calculation based on your team size, support contracts,
        // and training requirements. Check vendor websites for current pricing.
        Console.WriteLine("Verify current prices before calculating TCO.");
    }
}
C#

結論

在對這兩個程式庫進行詳細的分析後,出現了幾個關鍵區別因素:

IronPDF在以下方面表現出色:

  • 現代網路技術支持,帶有基於Chrome的渲染
  • 跨平台一致性和雲端原生部署
  • 開發人員生產力與直觀的API
  • 全面的支持和文件
  • 為增長型團隊提供更好的長期價值

ABCpdf在以下方面提供優勢:

  • 對於基本Windows專案較低的前期成本
  • 多個渲染引擎選項
  • 傳統系統相容性
  • 簡單文件的低記憶體佔用

IronPDF提供了對所有PDF問題的單一解決方案。 購買IronPDF後,您可以在一個單一的程式庫中獲得所有的轉換,並且僅需與PDF文件相關的任務,無需其他依賴項。 這種整合方法,配以一致的基於Chrome的渲染質量和跨平台支持,使IronPDF成為大多數現代.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");

存取我們的全面文件,探索程式碼範例,或與我們的工程團隊聊天,以獲取您PDF生成需求的個性化指導。

請注意: ABCpdf是其各自所有者的註冊商標。 本站與ABCpdf無關,未經其認可或贊助。 所有產品名稱、徽標和品牌均為其各自所有者的財產。 比較僅供資訊參考,並反映了撰寫時的公開可用資訊。
Jacob Mellor,首席技術官 @ Team Iron
首席技術官

Jacob Mellor是Iron Software的首席技術官,一位在C# PDF技術上開創先河的遠見工程師。作為Iron Software核心程式碼庫的原開發者,他從創立以來就一直在塑造公司的產品架構,與首席執行官Cameron Rimington一起將公司轉變為服務於NASA、特斯拉和全球政府公司的50多名人員的公司。

...
閱讀更多

相關文章

Key in blue circle

立即免費取得 30 天試用金鑰。

Your trial license will be sent to your email address

無任何限制。100% 解鎖。無需信用卡。

OR
bullet_checked無需信用卡或建立帳號無任何限制。100% 解鎖。無需信用卡。
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried Iron Suite
預訂您的免費現場演示
Booking Badge

受到全球數百萬工程師的信任

Iron Software的客戶標誌
獲取您的無義務諮詢
填寫以下表格或電子郵件sales@ironsoftware.com
您的詳細資訊將始終保密。
受到全球數百萬工程師的信任
Iron Software的客戶標誌
立即獲取您的30天試用金鑰。
無需信用卡或帳戶建立
C# 用於PDF的NuGet程式庫
使用NuGet安裝

版本: 2026.9

PM > Install-Package IronPdf
nuget.org/packages/IronPdf/
  1. 在解決方案資源管理器,右鍵點選參考,管理NuGet包
  2. 選擇瀏覽並搜尋"IronPdf"
  3. 選擇套件並安裝
C# PDF DLL
下載DLL

版本: 2026.9

或者點擊此處下載Windows安裝程式。

  1. 下載並解壓IronPDF到類似~/Libs的位置,位於您的解決方案目錄中
  2. 在Visual Studio解決方案資源管理器,右鍵點選參考。選擇瀏覽,"IronPdf.dll"

授權從$999起