產品比較 ActivePDF vs IronPDF:HTML到PDF教程和全面對比 Jacob Mellor 更新日期:8月 5, 2025 Download IronPDF NuGet 下載 DLL 下載 Windows 安裝程式 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 How do IronPDF and ActivePDF compare for PDF generation in .NET? When developers need robust PDF generation capabilities in their .NET applications, two prominent solutions often emerge: IronPDF and ActivePDF. Both libraries offer powerful features for creating, converting, and manipulating PDF documents, but they differ significantly in their approach, pricing, and implementation complexity. IronPDF stands out with its intuitive API design and comprehensive HTML-to-PDF conversion using a Chrome rendering engine, while ActivePDF provides enterprise-focused solutions through multiple specialized components like WebGrabber for HTML conversion and DocConverter for document transformation. This article provides an in-depth comparison to help you make an informed decision for your PDF processing needs. Product Comparison Overview Comparison of IronPDF and ActivePDF for .NET Development Category Feature/Aspect IronPDF ActivePDF Key Advantage Core Architecture Design Philosophy All-in-one library, developer-friendly Modular components, enterprise-focused IronPDF: Simpler integration API Complexity Intuitive methods like RenderHtmlAsPdf() Component-specific APIs IronPDF: Fewer lines of code Learning Curve 1-2 days typical 1-2 weeks typical IronPDF: Faster adoption Platform Support Cross-Platform Windows, Linux, macOS, Docker Windows Server primarily IronPDF: True cross-platform .NET Versions .NET 10, 9, 8, 7, 6, 5, Core, Framework 4.6.2+ .NET Framework 4.5+, Core 1.0, Standard 1.0 IronPDF: Modern .NET support Cloud Platforms Azure, AWS, Google Cloud optimized Limited cloud support IronPDF: Cloud-native ready HTML to PDF Rendering Engine Chrome V8 engine Native and IE engines IronPDF: Modern rendering CSS3/HTML5 Support Full support Partial support IronPDF: Modern web standards JavaScript Execution Full JavaScript support Limited JavaScript support IronPDF: Dynamic content Web Fonts Google Fonts, system fonts System fonts only IronPDF: Typography flexibility Document Conversion Supported Formats HTML, DOCX, Images, RTF, MD 300+ formats (DocConverter) ActivePDF: More formats DOCX to PDF Built-in DocxToPdfRenderer Native Office conversion ActivePDF: Better fidelity Batch Processing Programmatic approach Watched folders support ActivePDF: Enterprise automation Performance HTML Rendering Speed 125ms typical, 835ms complex Variable by engine IronPDF: Consistent performance Memory Usage Under 10MB typical Service-based overhead IronPDF: Lower footprint Threading Support Native async/await optimized Multi-threaded service IronPDF: Better .NET integration PDF Features Form Handling Create, fill, flatten forms Advanced form features (Toolkit) ActivePDF: Complex forms PDF/A Compliance PDF/A-3B support Multiple PDF/A levels ActivePDF: More compliance options OCR Capabilities Via IronOCR integration Dedicated OCR component Both: Available solutions Digital Signatures Integrated, visual signatures Advanced signature options ActivePDF: Enterprise signatures Developer Experience Documentation Comprehensive tutorials, examples Traditional API docs IronPDF: Better learning resources Code Examples 100+ ready-to-run samples Basic examples on GitHub IronPDF: Extensive resources Error Messages Descriptive, actionable Service-level messages IronPDF: Better debugging Licensing & Pricing Entry Level Lite: $799 (1 dev, 1 project) WebGrabber: $2,499+ per component IronPDF: 70% lower entry Team License Professional: $2,399 (10 devs) Multiple components needed IronPDF: All-inclusive Suite Option Iron Suite: $1,498 (9 products) No suite option IronPDF: Exceptional value Support Support Included Yes, 24/5 engineering support Support portal access IronPDF: Direct engineering support Response Time 24-48 hours typical Varies by issue IronPDF: Predictable SLA Best For Use Cases Modern web apps, rapid development Enterprise automation, legacy systems Context-dependent Project Types SaaS, web apps, microservices Document management, batch processing Based on requirements Note. Comparison based on current versions as of 2025. ActivePDF offers modular components for specific enterprise needs, while IronPDF provides an integrated solution. Pricing varies significantly based on component selection for ActivePDF. Compare IronPDF to ActivePDF Components Get the IronPDF C# PDF Library Compare IronPDF and ActivePDF Features Compare code for URL to PDF Compare code for HTML string to PDF Compare licensing, free software options, and more class="tutorial-segment-title">概述 About the IronPDF C# Library Iron Software is a market-leading component provider offering IronPDF for comprehensive PDF manipulation. IronPDF provides an all-inclusive solution for generating PDF files from various formats while offering complete programmatic control over document properties. Developers favor IronPDF for its consistent, reliable output and intuitive API that requires minimal code. IronPDF supports C#, VB.NET, ASP.NET, MVC, .NET Core, .NET 9, and .NET 10. It runs seamlessly on Windows, Linux, macOS, Docker, Azure, AWS, and other cloud platforms. About ActivePDF Components ActivePDF (now part of Apryse) provides enterprise-focused PDF solutions through multiple specialized components. Unlike IronPDF's unified approach, ActivePDF offers separate products for different PDF tasks: ActivePDF WebGrabber for HTML to PDF Conversion ActivePDF WebGrabber is specifically designed to convert HTML sources (URLs, HTML files, or HTML strings) to PDF format. It provides configuration options for page properties including headers, footers, margins, watermarks, and bookmarks. WebGrabber supports both Native and Internet Explorer rendering engines. ActivePDF DocConverter for Document Transformation ActivePDF DocConverter handles conversion of over 300 file formats to PDF, including Microsoft Office documents, images, CAD files, and more. It features watched folder automation, batch processing capabilities, and enterprise-grade document management features. Modern CSS Framework Rendering: Bootstrap and Beyond Contemporary web applications increasingly depend on CSS frameworks like Bootstrap, Foundation, and Tailwind CSS for consistent, responsive UI development. PDF generation libraries must accurately render these frameworks to maintain professional document quality and design fidelity. IronPDF: Complete Bootstrap and Modern Framework Support IronPDF's Chromium rendering engine ensures comprehensive support for all modern CSS frameworks and specifications: Bootstrap 5: Full flexbox and CSS Grid rendering with responsive utilities Bootstrap 4: Complete card systems, navigation components, and form layouts Tailwind CSS: All utility-first classes and responsive variants render correctly Foundation: Complete grid and component system support Modern CSS3: Flexbox, CSS Grid, custom properties, animations, transitions, and transforms JavaScript Execution: Full support for dynamic content and framework interactivity Validated with production examples: Bootstrap homepage and official templates convert with browser-accurate fidelity. Code Example: Service Pricing Table with Bootstrap using IronPdf; var renderer = new ChromePdfRenderer(); string bootstrapPricing = @" <!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='text-center mb-5'>Service Plans</h1> <div class='row g-4'> <div class='col-md-4'> <div class='card h-100 shadow-sm'> <div class='card-header bg-light text-center py-3'> <h3>Starter</h3> </div> <div class='card-body d-flex flex-column'> <div class='text-center mb-4'> <span class='h2'>$29</span> <span class='text-muted'>/month</span> </div> <ul class='list-unstyled flex-grow-1'> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> 100 PDF conversions/month</li> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> Basic templates</li> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> Email support</li> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> 5 GB storage</li> <li class='mb-2 text-muted'><i class='bi bi-x-circle'></i> Priority processing</li> </ul> <button class='btn btn-outline-primary w-100 mt-auto'>Get Started</button> </div> </div> </div> <div class='col-md-4'> <div class='card h-100 shadow border-primary'> <div class='position-absolute top-0 start-50 translate-middle'> <span class='badge bg-primary'>Most Popular</span> </div> <div class='card-header bg-primary text-white text-center py-3'> <h3>Professional</h3> </div> <div class='card-body d-flex flex-column'> <div class='text-center mb-4'> <span class='h2'>$99</span> <span class='text-muted'>/month</span> </div> <ul class='list-unstyled flex-grow-1'> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> 1,000 PDF conversions/month</li> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> Premium templates</li> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> Priority support</li> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> 50 GB storage</li> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> Priority processing</li> </ul> <button class='btn btn-primary w-100 mt-auto'>Get Started</button> </div> </div> </div> <div class='col-md-4'> <div class='card h-100 shadow-sm'> <div class='card-header bg-dark text-white text-center py-3'> <h3>Enterprise</h3> </div> <div class='card-body d-flex flex-column'> <div class='text-center mb-4'> <span class='h2'>$299</span> <span class='text-muted'>/month</span> </div> <ul class='list-unstyled flex-grow-1'> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> Unlimited conversions</li> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> Custom templates</li> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> Dedicated support</li> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> Unlimited storage</li> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> SLA guarantee</li> </ul> <button class='btn btn-dark w-100 mt-auto'>Contact Sales</button> </div> </div> </div> </div> </div> </body> </html>"; var pdf = renderer.RenderHtmlAsPdf(bootstrapPricing); pdf.SaveAs("pricing-table.pdf"); using IronPdf; var renderer = new ChromePdfRenderer(); string bootstrapPricing = @" <!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='text-center mb-5'>Service Plans</h1> <div class='row g-4'> <div class='col-md-4'> <div class='card h-100 shadow-sm'> <div class='card-header bg-light text-center py-3'> <h3>Starter</h3> </div> <div class='card-body d-flex flex-column'> <div class='text-center mb-4'> <span class='h2'>$29</span> <span class='text-muted'>/month</span> </div> <ul class='list-unstyled flex-grow-1'> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> 100 PDF conversions/month</li> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> Basic templates</li> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> Email support</li> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> 5 GB storage</li> <li class='mb-2 text-muted'><i class='bi bi-x-circle'></i> Priority processing</li> </ul> <button class='btn btn-outline-primary w-100 mt-auto'>Get Started</button> </div> </div> </div> <div class='col-md-4'> <div class='card h-100 shadow border-primary'> <div class='position-absolute top-0 start-50 translate-middle'> <span class='badge bg-primary'>Most Popular</span> </div> <div class='card-header bg-primary text-white text-center py-3'> <h3>Professional</h3> </div> <div class='card-body d-flex flex-column'> <div class='text-center mb-4'> <span class='h2'>$99</span> <span class='text-muted'>/month</span> </div> <ul class='list-unstyled flex-grow-1'> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> 1,000 PDF conversions/month</li> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> Premium templates</li> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> Priority support</li> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> 50 GB storage</li> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> Priority processing</li> </ul> <button class='btn btn-primary w-100 mt-auto'>Get Started</button> </div> </div> </div> <div class='col-md-4'> <div class='card h-100 shadow-sm'> <div class='card-header bg-dark text-white text-center py-3'> <h3>Enterprise</h3> </div> <div class='card-body d-flex flex-column'> <div class='text-center mb-4'> <span class='h2'>$299</span> <span class='text-muted'>/month</span> </div> <ul class='list-unstyled flex-grow-1'> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> Unlimited conversions</li> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> Custom templates</li> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> Dedicated support</li> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> Unlimited storage</li> <li class='mb-2'><i class='bi bi-check-circle text-success'></i> SLA guarantee</li> </ul> <button class='btn btn-dark w-100 mt-auto'>Contact Sales</button> </div> </div> </div> </div> </div> </body> </html>"; var pdf = renderer.RenderHtmlAsPdf(bootstrapPricing); pdf.SaveAs("pricing-table.pdf"); IRON VB CONVERTER ERROR developers@ironsoftware.com $vbLabelText $csharpLabel Output: A professional pricing table with Bootstrap's card grid, flexbox layouts, badge positioning, and responsive utilities—all accurately preserved in the PDF. ActivePDF WebGrabber: Limited Modern Framework Support ActivePDF WebGrabber provides HTML-to-PDF conversion but uses older rendering engines with significant limitations for modern CSS frameworks: Native Engine: Custom rendering with limited CSS3 support Internet Explorer Engine: Legacy IE rendering, no modern CSS features No Bootstrap 4/5 Support: Flexbox and CSS Grid features not supported Bootstrap 3 Limitations: Only table-based layouts work reliably JavaScript Limitations: Limited JavaScript execution compared to modern browsers Workarounds Required: Complex Bootstrap components need significant CSS modifications Common issues reported by developers: Bootstrap navigation bars rendering with layout problems Card components with flexbox not displaying correctly Responsive grid systems breaking in PDF output Need to simplify or rewrite Bootstrap components for compatibility Development impact: Applications built with modern Bootstrap versions (4+) require substantial additional work with ActivePDF WebGrabber. Teams must either: Maintain parallel simplified CSS for PDF generation (double maintenance burden) Limit web UI to Bootstrap 3 or older (sacrifices modern responsive features) Manually test and fix each Bootstrap component (time-consuming and error-prone) For projects heavily invested in Bootstrap or modern CSS frameworks, Active PDF WebGrabber's rendering limitations can significantly increase development costs and reduce design flexibility. For comprehensive Bootstrap framework compatibility guidance, see the Bootstrap & Flexbox CSS Guide. Why do developers choose IronPDF over ActivePDF? IronPDF's rendering speed completes HTML-to-PDF conversion in 835 milliseconds for static sites, offering consistent performance across different content types. The library's memory usage has been optimized to use less than 10MB typically, with 75% reduction in memory usage when rendering headers and footers. Developers appreciate IronPDF's straightforward API design that enables PDF generation with just three lines of code, compared to ActivePDF's more complex multi-step process. The comprehensive documentation includes over 100 code examples and detailed tutorials, making it easier for teams to get started quickly. When might ActivePDF be the better choice? ActivePDF excels in enterprise environments requiring: Automated batch processing with watched folders Support for 300+ file format conversions (via DocConverter) Legacy system integration on Windows Server Advanced form field manipulation and XFA form support Multiple PDF/A compliance levels for archival requirements Organizations with existing ActivePDF infrastructure or specific enterprise workflow requirements may find ActivePDF's modular approach beneficial, despite the higher cost and complexity. Comparison 1. ActivePDF vs IronPDF Feature Comparison Which library offers better HTML to PDF conversion capabilities? IronPDF uses a full Chrome V8 rendering engine, providing 98%+ browser fidelity with complete support for HTML5, CSS3, JavaScript, and web fonts. ActivePDF WebGrabber offers both Native and Internet Explorer engines, but with limited JavaScript execution and CSS3 support. The Native Engine doesn't honor CSS stylesheets, and the IE Engine relies on deprecated Internet Explorer 11, which lacks modern web standards. How do the libraries compare for document format support? While IronPDF focuses on common formats (HTML, DOCX, Images, RTF, Markdown), ActivePDF DocConverter supports over 300 file formats including CAD files, legacy document formats, and specialized enterprise formats. This makes ActivePDF more suitable for organizations dealing with diverse document types. What about PDF manipulation features? Both libraries offer comprehensive PDF manipulation capabilities: IronPDF provides: Built-in watermarking with HTML/CSS styling Simple API for headers/footers with predefined merge fields One-line methods for common tasks Integrated form creation and filling Digital signatures with visual representation ActivePDF offers: Advanced form field manipulation (through Toolkit) More granular control over PDF internals Enterprise-grade redaction capabilities Multiple PDF/A compliance levels Specialized components for specific tasks class="tutorial-segment-title">步骤 1: 安装 2. How to Install IronPDF Which installation method should I use for IronPDF? You can install IronPDF through multiple methods, with NuGet Package Manager being the most convenient: NuGet Package Manager Open the NuGet Package Manager in Visual Studio and search for IronPDF: :InstallCmd :InstallCmd SHELL Download IronPDF.dll manually Alternatively, download IronPDF.dll and add its reference to your project. Once installed, verify access by adding: using IronPdf; using IronPdf; Imports IronPdf $vbLabelText $csharpLabel IronPDF supports .NET 9 and 10, along with all modern .NET versions including Core, Standard, and Framework 4.6.2+. How to Install ActivePDF Components How do I install ActivePDF WebGrabber? ActivePDF WebGrabber requires a more complex installation process: Download the installer from the ActivePDF website Request a license key from ActivePDF sales (evaluation keys available) Run the installer with administrator privileges Configure the WebGrabber service during installation For Windows Server 2012+, create a dedicated user account for the service After installation, add the WebGrabber reference from: C:\Program Files\ActivePDF\WebGrabber\bin\APWebGrabber.Net45.dll How do I install ActivePDF DocConverter? DocConverter follows a similar installation pattern: Download the DocConverter installer Install with administrator rights Configure watched folders if using drag-and-drop conversion Set up the Configuration Manager for batch processing Note: ActivePDF components require Windows Server and don't support cross-platform deployment like IronPDF. How to Tutorials 3. Convert HTML String to PDF File Let's compare how both libraries handle a common task: converting an HTML string to a PDF file. 3.1. HTML String with IronPDF /** * HTML String to PDF * anchor-html-string-with-ironpdf **/ using IronPdf; static void Main(string[] args) { // Create rendering converter var renderer = new ChromePdfRenderer(); // HTML Source string html = "<h1>Hello World!</h1> <h2>Welcome to IronPDF</h2> "; // Convert HTML string to PDF file var pdf = renderer.RenderHtmlAsPdf(html); // Save the file pdf.SaveAs("E:/sample.pdf"); } /** * HTML String to PDF * anchor-html-string-with-ironpdf **/ using IronPdf; static void Main(string[] args) { // Create rendering converter var renderer = new ChromePdfRenderer(); // HTML Source string html = "<h1>Hello World!</h1> <h2>Welcome to IronPDF</h2> "; // Convert HTML string to PDF file var pdf = renderer.RenderHtmlAsPdf(html); // Save the file pdf.SaveAs("E:/sample.pdf"); } ''' ''' * HTML String to PDF ''' * anchor-html-string-with-ironpdf ''' * Imports IronPdf Shared Sub Main(ByVal args() As String) ' Create rendering converter Dim renderer = New ChromePdfRenderer() ' HTML Source Dim html As String = "<h1>Hello World!</h1> <h2>Welcome to IronPDF</h2> " ' Convert HTML string to PDF file Dim pdf = renderer.RenderHtmlAsPdf(html) ' Save the file pdf.SaveAs("E:/sample.pdf") End Sub $vbLabelText $csharpLabel Key advantages of IronPDF's approach: Only 3 lines of code for the conversion Automatic handling of encoding and rendering Built-in Chrome engine ensures accurate rendering No need for separate file path and name configuration 3.2. HTML String with ActivePDF WebGrabber using APWebGrabber; static void Main(string[] args) { // Instantiate Object WebGrabber wg = new WebGrabber(); // HTML Source string html = "<h1>Hello World!</h1> <h2>Welcome to ActivePDF WebGrabber</h2>"; // Assign source HTML to WebGrabber wg.CreateFromHTMLText = html; // Specify file directory wg.OutputDirectory = "E:/"; // File name wg.NewDocumentName = "sample.pdf"; // Convert source HTML to PDF file wg.ConvertToPDF(); } using APWebGrabber; static void Main(string[] args) { // Instantiate Object WebGrabber wg = new WebGrabber(); // HTML Source string html = "<h1>Hello World!</h1> <h2>Welcome to ActivePDF WebGrabber</h2>"; // Assign source HTML to WebGrabber wg.CreateFromHTMLText = html; // Specify file directory wg.OutputDirectory = "E:/"; // File name wg.NewDocumentName = "sample.pdf"; // Convert source HTML to PDF file wg.ConvertToPDF(); } Imports APWebGrabber Shared Sub Main(ByVal args() As String) ' Instantiate Object Dim wg As New WebGrabber() ' HTML Source Dim html As String = "<h1>Hello World!</h1> <h2>Welcome to ActivePDF WebGrabber</h2>" ' Assign source HTML to WebGrabber wg.CreateFromHTMLText = html ' Specify file directory wg.OutputDirectory = "E:/" ' File name wg.NewDocumentName = "sample.pdf" ' Convert source HTML to PDF file wg.ConvertToPDF() End Sub $vbLabelText $csharpLabel 3.3. Advanced HTML String Example with Both Libraries Let's see how both libraries handle more complex HTML with CSS styling: IronPDF Advanced Example: using IronPdf; var renderer = new ChromePdfRenderer(); // Configure rendering options renderer.RenderingOptions.CssMediaType = PdfCssMediaType.Print; renderer.RenderingOptions.PrintHtmlBackgrounds = true; renderer.RenderingOptions.CreatePdfFormsFromHtml = true; string advancedHtml = @" <html> <head> <style> body { font-family: Arial, sans-serif; } .invoice { border: 1px solid #ccc; padding: 20px; } .header { background-color: #f0f0f0; padding: 10px; } </style> </head> <body> <div class='invoice'> <div class='header'> <h1>Invoice #12345</h1> </div> <form> <input type='text' name='customer' placeholder='Customer Name'> </form> </div> </body> </html>"; var pdf = renderer.RenderHtmlAsPdf(advancedHtml); pdf.SaveAs("advanced-invoice.pdf"); using IronPdf; var renderer = new ChromePdfRenderer(); // Configure rendering options renderer.RenderingOptions.CssMediaType = PdfCssMediaType.Print; renderer.RenderingOptions.PrintHtmlBackgrounds = true; renderer.RenderingOptions.CreatePdfFormsFromHtml = true; string advancedHtml = @" <html> <head> <style> body { font-family: Arial, sans-serif; } .invoice { border: 1px solid #ccc; padding: 20px; } .header { background-color: #f0f0f0; padding: 10px; } </style> </head> <body> <div class='invoice'> <div class='header'> <h1>Invoice #12345</h1> </div> <form> <input type='text' name='customer' placeholder='Customer Name'> </form> </div> </body> </html>"; var pdf = renderer.RenderHtmlAsPdf(advancedHtml); pdf.SaveAs("advanced-invoice.pdf"); Imports IronPdf Private renderer = New ChromePdfRenderer() ' Configure rendering options renderer.RenderingOptions.CssMediaType = PdfCssMediaType.Print renderer.RenderingOptions.PrintHtmlBackgrounds = True renderer.RenderingOptions.CreatePdfFormsFromHtml = True Dim advancedHtml As String = " <html> <head> <style> body { font-family: Arial, sans-serif; } .invoice { border: 1px solid #ccc; padding: 20px; } .header { background-color: #f0f0f0; padding: 10px; } </style> </head> <body> <div class='invoice'> <div class='header'> <h1>Invoice #12345</h1> </div> <form> <input type='text' name='customer' placeholder='Customer Name'> </form> </div> </body> </html>" Dim pdf = renderer.RenderHtmlAsPdf(advancedHtml) pdf.SaveAs("advanced-invoice.pdf") $vbLabelText $csharpLabel The ChromePdfRenderer class provides extensive control over the rendering process, including CSS media type selection, background rendering, and automatic form field creation from HTML input elements. 4. Convert HTML File to PDF File 4.1. HTML File with IronPDF /** * HTML File to PDF * anchor-html-file-with-ironpdf **/ using IronPdf; static void Main(string[] args) { // Create rendering converter var renderer = new ChromePdfRenderer(); // Render HTML file to PDF var pdf = renderer.RenderHtmlFileAsPdf("E:/myHtmlFile.html"); // Save to target location pdf.SaveAs("E:/Sample.pdf"); } /** * HTML File to PDF * anchor-html-file-with-ironpdf **/ using IronPdf; static void Main(string[] args) { // Create rendering converter var renderer = new ChromePdfRenderer(); // Render HTML file to PDF var pdf = renderer.RenderHtmlFileAsPdf("E:/myHtmlFile.html"); // Save to target location pdf.SaveAs("E:/Sample.pdf"); } ''' ''' * HTML File to PDF ''' * anchor-html-file-with-ironpdf ''' * Imports IronPdf Shared Sub Main(ByVal args() As String) ' Create rendering converter Dim renderer = New ChromePdfRenderer() ' Render HTML file to PDF Dim pdf = renderer.RenderHtmlFileAsPdf("E:/myHtmlFile.html") ' Save to target location pdf.SaveAs("E:/Sample.pdf") End Sub $vbLabelText $csharpLabel IronPDF automatically handles: External CSS and JavaScript files Image references Font loading Relative path resolution 4.2. HTML File with ActivePDF WebGrabber using APWebGrabber; static void Main(string[] args) { // Instantiate Object WebGrabber wg = new WebGrabber(); // Specify file path to be converted wg.URL = "E:/myHtmlFile.html"; // Specify the directory for newly generated file wg.OutputDirectory = "E:/"; // Newly generated file name wg.NewDocumentName = "Sample.pdf"; // Convert HTML file to PDF wg.ConvertToPDF(); } using APWebGrabber; static void Main(string[] args) { // Instantiate Object WebGrabber wg = new WebGrabber(); // Specify file path to be converted wg.URL = "E:/myHtmlFile.html"; // Specify the directory for newly generated file wg.OutputDirectory = "E:/"; // Newly generated file name wg.NewDocumentName = "Sample.pdf"; // Convert HTML file to PDF wg.ConvertToPDF(); } Imports APWebGrabber Shared Sub Main(ByVal args() As String) ' Instantiate Object Dim wg As New WebGrabber() ' Specify file path to be converted wg.URL = "E:/myHtmlFile.html" ' Specify the directory for newly generated file wg.OutputDirectory = "E:/" ' Newly generated file name wg.NewDocumentName = "Sample.pdf" ' Convert HTML file to PDF wg.ConvertToPDF() End Sub $vbLabelText $csharpLabel Note that ActivePDF WebGrabber uses the URL property for local files, which can be confusing for developers expecting a file-specific method. 5. Convert URL to PDF File 5.1. URL with IronPDF /** * URL to PDF * anchor-url-with-ironpdf **/ using IronPdf; static void Main(string[] args) { // Create rendering converter var renderer = new ChromePdfRenderer(); // Specify URL var pdf = renderer.RenderUrlAsPdf("https://ironpdf.com"); // Save the file pdf.SaveAs("E:/Sample.pdf"); } /** * URL to PDF * anchor-url-with-ironpdf **/ using IronPdf; static void Main(string[] args) { // Create rendering converter var renderer = new ChromePdfRenderer(); // Specify URL var pdf = renderer.RenderUrlAsPdf("https://ironpdf.com"); // Save the file pdf.SaveAs("E:/Sample.pdf"); } ''' ''' * URL to PDF ''' * anchor-url-with-ironpdf ''' * Imports IronPdf Shared Sub Main(ByVal args() As String) ' Create rendering converter Dim renderer = New ChromePdfRenderer() ' Specify URL Dim pdf = renderer.RenderUrlAsPdf("https://ironpdf.com") ' Save the file pdf.SaveAs("E:/Sample.pdf") End Sub $vbLabelText $csharpLabel 5.2. Async URL Conversion with IronPDF IronPDF provides excellent async support for better performance: using IronPdf; using System.Threading.Tasks; static async Task Main(string[] args) { var renderer = new ChromePdfRenderer(); // Configure for complex pages renderer.RenderingOptions.WaitFor.RenderDelay(2000); // Wait 2 seconds renderer.RenderingOptions.WaitFor.JavaScript(1500); // Wait for JS // Async conversion var pdf = await renderer.RenderUrlAsPdfAsync("https://complex-spa.com"); await pdf.SaveAsAsync("E:/async-sample.pdf"); } using IronPdf; using System.Threading.Tasks; static async Task Main(string[] args) { var renderer = new ChromePdfRenderer(); // Configure for complex pages renderer.RenderingOptions.WaitFor.RenderDelay(2000); // Wait 2 seconds renderer.RenderingOptions.WaitFor.JavaScript(1500); // Wait for JS // Async conversion var pdf = await renderer.RenderUrlAsPdfAsync("https://complex-spa.com"); await pdf.SaveAsAsync("E:/async-sample.pdf"); } Imports IronPdf Imports System.Threading.Tasks Shared Async Function Main(ByVal args() As String) As Task Dim renderer = New ChromePdfRenderer() ' Configure for complex pages renderer.RenderingOptions.WaitFor.RenderDelay(2000) ' Wait 2 seconds renderer.RenderingOptions.WaitFor.JavaScript(1500) ' Wait for JS ' Async conversion Dim pdf = Await renderer.RenderUrlAsPdfAsync("https://complex-spa.com") Await pdf.SaveAsAsync("E:/async-sample.pdf") End Function $vbLabelText $csharpLabel The WaitFor class provides precise control over rendering timing, essential for JavaScript-heavy applications. You can wait for specific elements, network idle states, or custom JavaScript events. 5.3. URL with ActivePDF WebGrabber using APWebGrabber; static void Main(string[] args) { // Instantiate Object WebGrabber wg = new WebGrabber(); // Specify URL wg.URL = "https://www.example.com/"; // Specify the directory for newly generated file wg.OutputDirectory = "E:/"; // Specify file name wg.NewDocumentName = "Sample.pdf"; // Set timeout for conversion wg.TimeoutSpan = new TimeSpan(0, 0, 30); // Convert specified URL webpage to PDF wg.ConvertToPDF(); } using APWebGrabber; static void Main(string[] args) { // Instantiate Object WebGrabber wg = new WebGrabber(); // Specify URL wg.URL = "https://www.example.com/"; // Specify the directory for newly generated file wg.OutputDirectory = "E:/"; // Specify file name wg.NewDocumentName = "Sample.pdf"; // Set timeout for conversion wg.TimeoutSpan = new TimeSpan(0, 0, 30); // Convert specified URL webpage to PDF wg.ConvertToPDF(); } Imports APWebGrabber Shared Sub Main(ByVal args() As String) ' Instantiate Object Dim wg As New WebGrabber() ' Specify URL wg.URL = "https://www.example.com/" ' Specify the directory for newly generated file wg.OutputDirectory = "E:/" ' Specify file name wg.NewDocumentName = "Sample.pdf" ' Set timeout for conversion wg.TimeoutSpan = New TimeSpan(0, 0, 30) ' Convert specified URL webpage to PDF wg.ConvertToPDF() End Sub $vbLabelText $csharpLabel 6. Create a Watermark on PDF 6.1. Watermark with IronPDF IronPDF provides flexible watermarking through HTML/CSS: /** * Watermark PDF * anchor-watermark-with-ironpdf **/ using IronPdf; static void Main(string[] args) { var renderer = new ChromePdfRenderer(); // Source HTML string string html = "<h1 style='text-align:center'>WaterMark Example</h1>"; // Create PDF var pdf = renderer.RenderHtmlAsPdf(html); // Apply watermark with HTML/CSS pdf.ApplyWatermark("<h2 style='color:red; opacity:0.5'>CONFIDENTIAL</h2>", rotation: 30, opacity: 50); // Save the document pdf.SaveAs("E:/Sample.pdf"); } /** * Watermark PDF * anchor-watermark-with-ironpdf **/ using IronPdf; static void Main(string[] args) { var renderer = new ChromePdfRenderer(); // Source HTML string string html = "<h1 style='text-align:center'>WaterMark Example</h1>"; // Create PDF var pdf = renderer.RenderHtmlAsPdf(html); // Apply watermark with HTML/CSS pdf.ApplyWatermark("<h2 style='color:red; opacity:0.5'>CONFIDENTIAL</h2>", rotation: 30, opacity: 50); // Save the document pdf.SaveAs("E:/Sample.pdf"); } ''' ''' * Watermark PDF ''' * anchor-watermark-with-ironpdf ''' * Imports IronPdf Shared Sub Main(ByVal args() As String) Dim renderer = New ChromePdfRenderer() ' Source HTML string Dim html As String = "<h1 style='text-align:center'>WaterMark Example</h1>" ' Create PDF Dim pdf = renderer.RenderHtmlAsPdf(html) ' Apply watermark with HTML/CSS pdf.ApplyWatermark("<h2 style='color:red; opacity:0.5'>CONFIDENTIAL</h2>", rotation:= 30, opacity:= 50) ' Save the document pdf.SaveAs("E:/Sample.pdf") End Sub $vbLabelText $csharpLabel Advanced watermarking with IronPDF: // Image watermark pdf.ApplyWatermark($@"<img src='logo.png' style='width:200px'>", rotation: 0, opacity: 30, verticalAlignment: VerticalAlignment.Middle); // Complex HTML watermark with positioning string complexWatermark = @" <div style='text-align:center; font-family:Arial'> <h1 style='color:#ff0000'>DRAFT</h1> <p>Generated: " + DateTime.Now.ToString() + @"</p> </div>"; pdf.ApplyWatermark(complexWatermark, rotation: 45, opacity: 25); // Image watermark pdf.ApplyWatermark($@"<img src='logo.png' style='width:200px'>", rotation: 0, opacity: 30, verticalAlignment: VerticalAlignment.Middle); // Complex HTML watermark with positioning string complexWatermark = @" <div style='text-align:center; font-family:Arial'> <h1 style='color:#ff0000'>DRAFT</h1> <p>Generated: " + DateTime.Now.ToString() + @"</p> </div>"; pdf.ApplyWatermark(complexWatermark, rotation: 45, opacity: 25); ' Image watermark pdf.ApplyWatermark($"<img src='logo.png' style='width:200px'>", rotation:= 0, opacity:= 30, verticalAlignment:= VerticalAlignment.Middle) ' Complex HTML watermark with positioning Dim complexWatermark As String = " <div style='text-align:center; font-family:Arial'> <h1 style='color:#ff0000'>DRAFT</h1> <p>Generated: " & DateTime.Now.ToString() & "</p> </div>" pdf.ApplyWatermark(complexWatermark, rotation:= 45, opacity:= 25) $vbLabelText $csharpLabel 6.2. Watermark with ActivePDF WebGrabber ActivePDF requires using text stamps as a workaround: using APWebGrabber; static void Main(string[] args) { WebGrabber wg = new WebGrabber(); string html = "<h1 style='text-align:center'>WaterMark Example</h1>"; wg.CreateFromHTMLText = html; // Add text stamp as watermark wg.AddStampText(270.0f, 350.0f, "WaterMark"); // Configure stamp appearance wg.StampFontSize = 20; wg.StampFont = "Times New Roman"; wg.StampFontTransparency = 1f; wg.StampRotation = 45.0f; wg.StampColorNET = new ADK.PDF.Color() { Red = 255, Green = 0, Blue = 0, Gray = 0 }; wg.OutputDirectory = "E:/"; wg.NewDocumentName = "Sample.pdf"; wg.ConvertToPDF(); } using APWebGrabber; static void Main(string[] args) { WebGrabber wg = new WebGrabber(); string html = "<h1 style='text-align:center'>WaterMark Example</h1>"; wg.CreateFromHTMLText = html; // Add text stamp as watermark wg.AddStampText(270.0f, 350.0f, "WaterMark"); // Configure stamp appearance wg.StampFontSize = 20; wg.StampFont = "Times New Roman"; wg.StampFontTransparency = 1f; wg.StampRotation = 45.0f; wg.StampColorNET = new ADK.PDF.Color() { Red = 255, Green = 0, Blue = 0, Gray = 0 }; wg.OutputDirectory = "E:/"; wg.NewDocumentName = "Sample.pdf"; wg.ConvertToPDF(); } Imports APWebGrabber Shared Sub Main(ByVal args() As String) Dim wg As New WebGrabber() Dim html As String = "<h1 style='text-align:center'>WaterMark Example</h1>" wg.CreateFromHTMLText = html ' Add text stamp as watermark wg.AddStampText(270.0F, 350.0F, "WaterMark") ' Configure stamp appearance wg.StampFontSize = 20 wg.StampFont = "Times New Roman" wg.StampFontTransparency = 1F wg.StampRotation = 45.0F wg.StampColorNET = New ADK.PDF.Color() With { .Red = 255, .Green = 0, .Blue = 0, .Gray = 0 } wg.OutputDirectory = "E:/" wg.NewDocumentName = "Sample.pdf" wg.ConvertToPDF() End Sub $vbLabelText $csharpLabel The ActivePDF approach is limited to text-only watermarks and requires manual positioning calculations. 7. Set Headers and Footers for PDFs 7.1. Headers and Footers with IronPDF IronPDF offers both simple text and complex HTML headers/footers: /** * Set Header Footers * anchor-headers-and-footers-with-ironpdf **/ using IronPdf; static void Main(string[] args) { var renderer = new ChromePdfRenderer(); // Configure text header/footer renderer.RenderingOptions.TextHeader = new TextHeaderFooter() { LeftText = "Company Name", CenterText = "{page} of {total-pages}", RightText = "{date} {time}", DrawDividerLine = true, FontSize = 12, FontFamily = "Arial" }; renderer.RenderingOptions.TextFooter = new TextHeaderFooter() { CenterText = "Copyright © 2025", RightText = "Page {page}", FontSize = 10 }; // HTML content string html = "<h1>Document Content</h1><p>Lorem ipsum...</p>"; var pdf = renderer.RenderHtmlAsPdf(html); pdf.SaveAs("E:/document.pdf"); } /** * Set Header Footers * anchor-headers-and-footers-with-ironpdf **/ using IronPdf; static void Main(string[] args) { var renderer = new ChromePdfRenderer(); // Configure text header/footer renderer.RenderingOptions.TextHeader = new TextHeaderFooter() { LeftText = "Company Name", CenterText = "{page} of {total-pages}", RightText = "{date} {time}", DrawDividerLine = true, FontSize = 12, FontFamily = "Arial" }; renderer.RenderingOptions.TextFooter = new TextHeaderFooter() { CenterText = "Copyright © 2025", RightText = "Page {page}", FontSize = 10 }; // HTML content string html = "<h1>Document Content</h1><p>Lorem ipsum...</p>"; var pdf = renderer.RenderHtmlAsPdf(html); pdf.SaveAs("E:/document.pdf"); } ''' ''' * Set Header Footers ''' * anchor-headers-and-footers-with-ironpdf ''' * Imports IronPdf Shared Sub Main(ByVal args() As String) Dim renderer = New ChromePdfRenderer() ' Configure text header/footer renderer.RenderingOptions.TextHeader = New TextHeaderFooter() With { .LeftText = "Company Name", .CenterText = "{page} of {total-pages}", .RightText = "{date} {time}", .DrawDividerLine = True, .FontSize = 12, .FontFamily = "Arial" } renderer.RenderingOptions.TextFooter = New TextHeaderFooter() With { .CenterText = "Copyright © 2025", .RightText = "Page {page}", .FontSize = 10 } ' HTML content Dim html As String = "<h1>Document Content</h1><p>Lorem ipsum...</p>" Dim pdf = renderer.RenderHtmlAsPdf(html) pdf.SaveAs("E:/document.pdf") End Sub $vbLabelText $csharpLabel For more complex headers/footers using HTML: // HTML headers with dynamic content renderer.RenderingOptions.HtmlHeader = new HtmlHeaderFooter() { HtmlFragment = @" <div style='display: flex; justify-content: space-between; padding: 10px;'> <img src='logo.png' style='height: 30px;'> <div>{page} / {total-pages}</div> </div>", Height = 50 }; // HTML headers with dynamic content renderer.RenderingOptions.HtmlHeader = new HtmlHeaderFooter() { HtmlFragment = @" <div style='display: flex; justify-content: space-between; padding: 10px;'> <img src='logo.png' style='height: 30px;'> <div>{page} / {total-pages}</div> </div>", Height = 50 }; ' HTML headers with dynamic content renderer.RenderingOptions.HtmlHeader = New HtmlHeaderFooter() With { .HtmlFragment = " <div style='display: flex; justify-content: space-between; padding: 10px;'> <img src='logo.png' style='height: 30px;'> <div>{page} / {total-pages}</div> </div>", .Height = 50 } $vbLabelText $csharpLabel The predefined merge fields available in IronPDF include: {page} - Current page number {total-pages} - Total number of pages {url} - Source URL (if applicable) {date} - Current date {time} - Current time {html-title} - Title from HTML document {pdf-title} - PDF metadata title 7.2. Headers and Footers with ActivePDF WebGrabber using APWebGrabber; static void Main(string[] args) { WebGrabber wg = new WebGrabber(); string html = @"<h1 style='text-align:center;'>Page Content</h1>"; wg.CreateFromHTMLText = html; // Configure header wg.HeaderHeight = 0.5f; wg.HeaderHTML = "<div style='float: left;'>Header Text</div>"; wg.HeaderHTML += $"<div style='float: right;'>{DateTime.Now.ToShortDateString()}</div>"; // Configure footer wg.FooterHeight = 0.5f; wg.FooterHTML = "<div style='text-align: right;'>%cp% of %tp%</div>"; wg.OutputDirectory = "E:/"; wg.NewDocumentName = "Sample.pdf"; wg.ConvertToPDF(); } using APWebGrabber; static void Main(string[] args) { WebGrabber wg = new WebGrabber(); string html = @"<h1 style='text-align:center;'>Page Content</h1>"; wg.CreateFromHTMLText = html; // Configure header wg.HeaderHeight = 0.5f; wg.HeaderHTML = "<div style='float: left;'>Header Text</div>"; wg.HeaderHTML += $"<div style='float: right;'>{DateTime.Now.ToShortDateString()}</div>"; // Configure footer wg.FooterHeight = 0.5f; wg.FooterHTML = "<div style='text-align: right;'>%cp% of %tp%</div>"; wg.OutputDirectory = "E:/"; wg.NewDocumentName = "Sample.pdf"; wg.ConvertToPDF(); } Imports APWebGrabber Shared Sub Main(ByVal args() As String) Dim wg As New WebGrabber() Dim html As String = "<h1 style='text-align:center;'>Page Content</h1>" wg.CreateFromHTMLText = html ' Configure header wg.HeaderHeight = 0.5F wg.HeaderHTML = "<div style='float: left;'>Header Text</div>" wg.HeaderHTML += $"<div style='float: right;'>{DateTime.Now.ToShortDateString()}</div>" ' Configure footer wg.FooterHeight = 0.5F wg.FooterHTML = "<div style='text-align: right;'>%cp% of %tp%</div>" wg.OutputDirectory = "E:/" wg.NewDocumentName = "Sample.pdf" wg.ConvertToPDF() End Sub $vbLabelText $csharpLabel Note: ActivePDF uses proprietary placeholders (%cp% for current page, %tp% for total pages) and requires manual HTML construction. 8. Advanced PDF Features Comparison 8.1. PDF Form Creation and Manipulation IronPDF Form Example using IronPdf; // Create a PDF with form fields var renderer = new ChromePdfRenderer(); renderer.RenderingOptions.CreatePdfFormsFromHtml = true; string formHtml = @" <form> <label>Name: <input type='text' name='fullname'></label><br> <label>Email: <input type='email' name='email'></label><br> <label>Subscribe: <input type='checkbox' name='subscribe'></label><br> <label> Plan: <select name='plan'> <option>Basic</option> <option>Premium</option> </select> </label> </form>"; var pdf = renderer.RenderHtmlAsPdf(formHtml); // Fill form fields programmatically pdf.Form.FindFormField("fullname").Value = "John Doe"; pdf.Form.FindFormField("email").Value = "john@example.com"; pdf.Form.FindFormField("subscribe").Value = "Yes"; pdf.SaveAs("filled-form.pdf"); using IronPdf; // Create a PDF with form fields var renderer = new ChromePdfRenderer(); renderer.RenderingOptions.CreatePdfFormsFromHtml = true; string formHtml = @" <form> <label>Name: <input type='text' name='fullname'></label><br> <label>Email: <input type='email' name='email'></label><br> <label>Subscribe: <input type='checkbox' name='subscribe'></label><br> <label> Plan: <select name='plan'> <option>Basic</option> <option>Premium</option> </select> </label> </form>"; var pdf = renderer.RenderHtmlAsPdf(formHtml); // Fill form fields programmatically pdf.Form.FindFormField("fullname").Value = "John Doe"; pdf.Form.FindFormField("email").Value = "john@example.com"; pdf.Form.FindFormField("subscribe").Value = "Yes"; pdf.SaveAs("filled-form.pdf"); Imports IronPdf ' Create a PDF with form fields Private renderer = New ChromePdfRenderer() renderer.RenderingOptions.CreatePdfFormsFromHtml = True Dim formHtml As String = " <form> <label>Name: <input type='text' name='fullname'></label><br> <label>Email: <input type='email' name='email'></label><br> <label>Subscribe: <input type='checkbox' name='subscribe'></label><br> <label> Plan: <select name='plan'> <option>Basic</option> <option>Premium</option> </select> </label> </form>" Dim pdf = renderer.RenderHtmlAsPdf(formHtml) ' Fill form fields programmatically pdf.Form.FindFormField("fullname").Value = "John Doe" pdf.Form.FindFormField("email").Value = "john@example.com" pdf.Form.FindFormField("subscribe").Value = "Yes" pdf.SaveAs("filled-form.pdf") $vbLabelText $csharpLabel ActivePDF Toolkit Form Example // ActivePDF requires separate Toolkit component for forms APToolkitNET.Toolkit toolkit = new APToolkitNET.Toolkit(); // Open existing PDF toolkit.OpenInputFile("form-template.pdf"); // Set form field values toolkit.SetFormFieldData("fullname", "John Doe", -997); toolkit.SetFormFieldData("email", "john@example.com", -997); // Save filled form toolkit.CopyForm(0, 0); toolkit.SaveAs("filled-form.pdf"); // ActivePDF requires separate Toolkit component for forms APToolkitNET.Toolkit toolkit = new APToolkitNET.Toolkit(); // Open existing PDF toolkit.OpenInputFile("form-template.pdf"); // Set form field values toolkit.SetFormFieldData("fullname", "John Doe", -997); toolkit.SetFormFieldData("email", "john@example.com", -997); // Save filled form toolkit.CopyForm(0, 0); toolkit.SaveAs("filled-form.pdf"); ' ActivePDF requires separate Toolkit component for forms Dim toolkit As New APToolkitNET.Toolkit() ' Open existing PDF toolkit.OpenInputFile("form-template.pdf") ' Set form field values toolkit.SetFormFieldData("fullname", "John Doe", -997) toolkit.SetFormFieldData("email", "john@example.com", -997) ' Save filled form toolkit.CopyForm(0, 0) toolkit.SaveAs("filled-form.pdf") $vbLabelText $csharpLabel 8.2. PDF/A Compliance Both libraries support PDF/A, but with different approaches: IronPDF PDF/A using IronPdf; var renderer = new ChromePdfRenderer(); var pdf = renderer.RenderHtmlAsPdf("<h1>Archival Document</h1>"); // Convert to PDF/A-3B pdf.SaveAsPdfA("archive.pdf", PdfAVersions.PdfA3B); using IronPdf; var renderer = new ChromePdfRenderer(); var pdf = renderer.RenderHtmlAsPdf("<h1>Archival Document</h1>"); // Convert to PDF/A-3B pdf.SaveAsPdfA("archive.pdf", PdfAVersions.PdfA3B); Imports IronPdf Private renderer = New ChromePdfRenderer() Private pdf = renderer.RenderHtmlAsPdf("<h1>Archival Document</h1>") ' Convert to PDF/A-3B pdf.SaveAsPdfA("archive.pdf", PdfAVersions.PdfA3B) $vbLabelText $csharpLabel ActivePDF DocConverter PDF/A // Requires DocConverter component DocConverter dc = new DocConverter(); dc.SetPDFACompliance(PDFACompliance.PDFA2B); dc.ConvertToPDF("input.html", "output.pdf"); // Requires DocConverter component DocConverter dc = new DocConverter(); dc.SetPDFACompliance(PDFACompliance.PDFA2B); dc.ConvertToPDF("input.html", "output.pdf"); ' Requires DocConverter component Dim dc As New DocConverter() dc.SetPDFACompliance(PDFACompliance.PDFA2B) dc.ConvertToPDF("input.html", "output.pdf") $vbLabelText $csharpLabel 8.3. Digital Signatures IronPDF Digital Signature using IronPdf; using IronPdf.Signing; // Load or create PDF var pdf = PdfDocument.FromFile("document.pdf"); // Create signature with certificate var signature = new PdfSignature("certificate.pfx", "password"); // Configure signature appearance signature.SignatureImage = new PdfSignatureImage("signature.png"); signature.SigningContact = "john@company.com"; signature.SigningReason = "Document Approval"; // Apply signature pdf.Sign(signature); pdf.SaveAs("signed.pdf"); using IronPdf; using IronPdf.Signing; // Load or create PDF var pdf = PdfDocument.FromFile("document.pdf"); // Create signature with certificate var signature = new PdfSignature("certificate.pfx", "password"); // Configure signature appearance signature.SignatureImage = new PdfSignatureImage("signature.png"); signature.SigningContact = "john@company.com"; signature.SigningReason = "Document Approval"; // Apply signature pdf.Sign(signature); pdf.SaveAs("signed.pdf"); Imports IronPdf Imports IronPdf.Signing ' Load or create PDF Private pdf = PdfDocument.FromFile("document.pdf") ' Create signature with certificate Private signature = New PdfSignature("certificate.pfx", "password") ' Configure signature appearance signature.SignatureImage = New PdfSignatureImage("signature.png") signature.SigningContact = "john@company.com" signature.SigningReason = "Document Approval" ' Apply signature pdf.Sign(signature) pdf.SaveAs("signed.pdf") $vbLabelText $csharpLabel 8.4. Batch Processing Comparison IronPDF Batch Processing using IronPdf; using System.Threading.Tasks; using System.IO; static async Task BatchConvertAsync() { var renderer = new ChromePdfRenderer(); var tasks = new List<Task>(); foreach (var file in Directory.GetFiles("input", "*.html")) { tasks.Add(Task.Run(async () => { var pdf = await renderer.RenderHtmlFileAsPdfAsync(file); var outputPath = Path.Combine("output", Path.GetFileNameWithoutExtension(file) + ".pdf"); await pdf.SaveAsAsync(outputPath); })); } await Task.WhenAll(tasks); } using IronPdf; using System.Threading.Tasks; using System.IO; static async Task BatchConvertAsync() { var renderer = new ChromePdfRenderer(); var tasks = new List<Task>(); foreach (var file in Directory.GetFiles("input", "*.html")) { tasks.Add(Task.Run(async () => { var pdf = await renderer.RenderHtmlFileAsPdfAsync(file); var outputPath = Path.Combine("output", Path.GetFileNameWithoutExtension(file) + ".pdf"); await pdf.SaveAsAsync(outputPath); })); } await Task.WhenAll(tasks); } Imports IronPdf Imports System.Threading.Tasks Imports System.IO Shared Async Function BatchConvertAsync() As Task Dim renderer = New ChromePdfRenderer() Dim tasks = New List(Of Task)() For Each file In Directory.GetFiles("input", "*.html") tasks.Add(Task.Run(Async Function() Dim pdf = Await renderer.RenderHtmlFileAsPdfAsync(file) Dim outputPath = Path.Combine("output", Path.GetFileNameWithoutExtension(file) & ".pdf") Await pdf.SaveAsAsync(outputPath) End Function)) Next file Await Task.WhenAll(tasks) End Function $vbLabelText $csharpLabel ActivePDF DocConverter Batch Processing // DocConverter supports watched folders for automatic conversion DocConverter dc = new DocConverter(); // Configure watched folder dc.AddWatchedFolder(@"C:\Input", @"C:\Output", "*.html"); dc.StartWatching(); // Files dropped in the input folder are automatically converted // DocConverter supports watched folders for automatic conversion DocConverter dc = new DocConverter(); // Configure watched folder dc.AddWatchedFolder(@"C:\Input", @"C:\Output", "*.html"); dc.StartWatching(); // Files dropped in the input folder are automatically converted ' DocConverter supports watched folders for automatic conversion Dim dc As New DocConverter() ' Configure watched folder dc.AddWatchedFolder("C:\Input", "C:\Output", "*.html") dc.StartWatching() ' Files dropped in the input folder are automatically converted $vbLabelText $csharpLabel 9. Performance and Resource Comparison How do the libraries compare in terms of performance? Based on benchmark testing and real-world usage: IronPDF Performance Metrics HTML rendering: ~125ms for simple content Complex sites: 835ms (tested on static websites) Memory usage: Under 10MB typical Initial startup: 2-3 seconds (Chrome engine initialization) 75% reduction in memory usage for headers/footers 80% reduction in loading time for large documents ActivePDF Performance Characteristics Variable based on rendering engine selected Native engine: Faster for simple HTML IE engine: Slower but better compatibility with legacy content Service-based architecture adds overhead Better suited for batch processing scenarios Memory Management Best Practices IronPDF Memory Optimization // Dispose of resources properly using (var renderer = new ChromePdfRenderer()) { using (var pdf = renderer.RenderHtmlAsPdf(html)) { pdf.SaveAs("output.pdf"); } } // For large documents, use streaming await pdf.Stream.CopyToAsync(fileStream); // Dispose of resources properly using (var renderer = new ChromePdfRenderer()) { using (var pdf = renderer.RenderHtmlAsPdf(html)) { pdf.SaveAs("output.pdf"); } } // For large documents, use streaming await pdf.Stream.CopyToAsync(fileStream); ' Dispose of resources properly Using renderer = New ChromePdfRenderer() Using pdf = renderer.RenderHtmlAsPdf(html) pdf.SaveAs("output.pdf") End Using End Using ' For large documents, use streaming Await pdf.Stream.CopyToAsync(fileStream) $vbLabelText $csharpLabel ActivePDF Memory Considerations Service-based architecture isolates memory usage Automatic cleanup between conversions Configure service memory limits in Windows 10. ActivePDF Components Overview What other ActivePDF components are available? 元件 用途與功能 ActivePDF DocConverter 將300多種文件類型轉換為PDF。功能包括監控文件夾、批量處理和企業自動化。 ActivePDF WebGrabber 支持URL、文件和HTML字符串的HTML到PDF轉換。包含原生和IE渲染引擎。 ActivePDF Toolkit 高級PDF操作,包括表單、註釋、安全性和低級PDF操作。 ActivePDF Server 基於伺服器的網路環境PDF列印解決方案。 ActivePDF Meridian 網路PDF打印機,用於將文件列印到PDF而無需逐用戶費用。 ActivePDF OCR 光學字符識別,使掃描PDF可搜索。 ActivePDF Xtractor 從PDF文件中提取文本和圖像以進行數據處理。 ActivePDF Redactor 永久刪除PDF文檔中的敏感信息。 請注意許多這些元件需要單獨許可證,增加了全面PDF功能的總成本。 11. 許可證和定價比較 IronPDF和ActivePDF之間的許可證成本如何比較? IronPDF 許可證(透明定價,截至2025年) Lite許可證:$799(1位開發人員,1個地點,1個項目) Plus許可證:$1,199(3位開發人員,3個地點,3個項目) 專業許可證:$2,399(10位開發人員,10個地點,10個項目) 無限制許可證:自訂定價(無限開發者/項目) Iron Suite:$1,498(包含所有10個Iron Software產品) ActivePDF 許可證(每個元件) WebGrabber:起價$2,499(一次性付款) DocConverter:起價$2,999(一次性付款) Toolkit:起價$1,500+(功能不同價格不同) 支持:高級支持需額外費用 多個元件:成本迅速增加 總擁有成本示例 情境:小型開發團隊(3位開發人員) IronPDF Plus 許可證:$1,499(包含所有功能) ActivePDF WebGrabber + DocConverter:至少$5,498 IronPDF節省:73% 情境:企業團隊(10位開發人員) IronPDF 專業版:$2,999(包含所有功能) ActivePDF 套件(多個元件):$10,000+ IronPDF節省:70%+ 12. 支持和文檔 哪個庫提供更好的開發者支持? IronPDF 支持 24/5 工程支持包含在所有許可證內 直接訪問開發團隊 全面的文檔,包含100多個示例 活躍的社區和論壇 定期更新和改進 回應時間:約24-48小時 ActivePDF 支持 支持門戶網站訪問 知識庫文章 社區論壇 額外費用提供高級支持 舊版本的遺留文檔 結論:您應該選擇哪個PDF庫? 何時選擇IronPDF: 現代.NET 開發:完全支持.NET 9/10和跨平台部署 快速開發:直觀的API,所需代碼最小 Web應用程序:出色的HTML/CSS/JavaScript渲染,使用Chrome引擎 雲部署:為Azure、AWS和容器化環境優化 預算考量:較低的進入成本,包含所有功能 學習曲線:全面的文檔和示例,有助於快速採用 何時選擇ActivePDF: 遺留系統:現有的ActivePDF基礎設施或Windows伺服器環境 多樣的文件格式:需要將300多種文件類型轉換為PDF 企業工作流:監控文件夾和自動批量處理 高級表單:複雜的XFA表單或專門的表單要求 合規要求:多個PDF/A級別以滿足特定行業需求 最終建議 在大多數現代.NET開發情境中,IronPDF提供了最佳的功能、性能和價值的組合。 其直觀的API、全面的文檔和透明定價使其非常適合希望快速高效地實現PDF功能的團隊。 ActivePDF仍然是企業在文件格式支持、遺留系統集成或現有ActivePDF基礎設施方面具備特定要求時的可行選擇。 然而,模塊化的定價模式和複雜的安裝過程可能對小型團隊或新項目造成挑戰。 準備開始了嗎? 立即開始在您的項目中使用 IronPDF 並免費試用。 第一步: 免費啟動 請注意ActivePDF 是其各自所有者的註冊商標。 本網站與ActivePDF無關,亦未受其贊助或支持。 所有產品名稱、徽標和品牌均為其各自所有者的財產。 比較僅供信息參考,並反映撰寫時公開可用的信息。 常見問題解答 IronPDF 和 ActivePDF 在 .NET 中的 PDF 生成比較如何? IronPDF 提供了一種精簡的 PDF 生成方法,使用基於 Chrome 的渲染引擎和直觀的 API,支持現代 .NET 版本,包括 .NET 9 和 10。ActivePDF 提供了模塊化的組件,如 WebGrabber 和 DocConverter,用於企業場景,但需要更多的配置。 如何使用 C# 將 HTML 轉換為 PDF? 您可以使用 IronPDF 的 RenderHtmlAsPdf 方法快速將 HTML 字串轉換為 PDF。對於基於文件的轉換,可使用 RenderHtmlFileAsPdf 方法,兩者都提供高保真,支持 CSS3 和 JavaScript。 IronPDF 的性能基準是什麼? IronPDF 展示了快速的 HTML 到 PDF 渲染,完成任務約需 125-835 毫秒,內存使用率低於 10MB。它還提供了標題和頁腳內存和處理的顯著提升。 我可以用 IronPDF 自動批量 PDF 處理嗎? 可以,IronPDF 通過 async/await 模式支持批量處理,允許您使用如 RenderHtmlFileAsPdfAsync 等方法同時處理多個 PDF 轉換。 IronPDF 如何在 PDF 中處理數字簽名? IronPDF 提供了一個 PdfSignature 類,用於在 PDF 文檔中添加數字簽名。它支持基於證書的簽名,並允許自定義簽名的外觀和元數據。 在 .NET 開發中使用 IronPDF 的成本考量是什麼? IronPDF 許可證從 $749 起,面向單個開發人員,包括所有功能。相比之下,ActivePDF 組件單獨定價,導致類似功能的總成本更高。 IronPDF 如何確保跨平台兼容性? IronPDF 支持跨平台部署,包括 Windows、Linux、macOS 和 Docker 環境,適合多樣化的開發需求和基於雲的應用程序。 如何使用 IronPDF 向 PDF 添加標題和頁腳? IronPDF 提供 TextHeaderFooter 和 HtmlHeaderFooter 類,允許您使用簡單文本和複雜的 HTML/CSS 佈局添加標題和頁腳。 IronPDF 與現代 .NET 版本的集成效果如何? IronPDF 完全支持現代 .NET 版本,包括 .NET 9 和 10,以及 .NET Core、.NET Standard 和 .NET Framework 4.6.2+,確保廣泛的兼容性和未來的開發。 在 PDF 轉換過程中是否支持 JavaScript 執行? 是的,IronPDF 在渲染 PDF 之前完全執行 JavaScript,並有選項通過 WaitFor.JavaScript() 和 RenderDelay() 控制時機,確保完整和準確的轉換。 Jacob Mellor 立即與工程團隊聊天 首席技术官 Jacob Mellor 是 Iron Software 的首席技術官,作為 C# PDF 技術的先鋒工程師。作為 Iron Software 核心代碼的原作者,他自開始以來塑造了公司產品架構,與 CEO Cameron Rimington 一起將其轉變為一家擁有超過 50 名員工的公司,為 NASA、特斯拉 和 全世界政府機構服務。Jacob 持有曼徹斯特大學土木工程一級榮譽学士工程學位(BEng) (1998-2001)。他於 1999 年在倫敦開設了他的第一家軟件公司,並於 2005 年製作了他的首個 .NET 組件,專注於解決 Microsoft 生態系統內的複雜問題。他的旗艦產品 IronPDF & IronSuite .NET 庫在全球 NuGet 被安裝超過 3000 萬次,其基礎代碼繼續為世界各地的開發工具提供動力。擁有 25 年的商業經驗和 41 年的編碼專業知識,Jacob 仍專注於推動企業級 C#、Java 及 Python PDF 技術的創新,同時指導新一代技術領袖。 相關文章 發表日期 11月 13, 2025 C# HTML 與 PDF 開源版本比較 IronPDF 將開源 HTML 轉 PDF 庫與 IronPDF for C# 進行比較。探索哪種解決方案能為您的 .NET 專案提供最佳的 PDF 生成功能。 閱讀更多 發表日期 10月 27, 2025 哪個 ASP.NET Core PDF 庫具有最佳價值? 發現適用於 ASP.NET Core 應用程式的最佳 PDF 庫。比較 IronPDF 的 Chrome 引擎與 Aspose 和 Syncfusion 的替代方案。 閱讀更多 發表日期 10月 27, 2025 如何使用 Aspose C# 和 IronPDF 創建 PDF 通過這份針對開發人員設計的分步指南,學習如何使用 Aspose C# 與 IronPDF 創建 PDF。 閱讀更多 Aspose PDF轉換器替代項:IronPDF在.NET開發中的比較如何?SpirePDF C# HTML到PDF教程和庫比較
發表日期 11月 13, 2025 C# HTML 與 PDF 開源版本比較 IronPDF 將開源 HTML 轉 PDF 庫與 IronPDF for C# 進行比較。探索哪種解決方案能為您的 .NET 專案提供最佳的 PDF 生成功能。 閱讀更多
發表日期 10月 27, 2025 哪個 ASP.NET Core PDF 庫具有最佳價值? 發現適用於 ASP.NET Core 應用程式的最佳 PDF 庫。比較 IronPDF 的 Chrome 引擎與 Aspose 和 Syncfusion 的替代方案。 閱讀更多
發表日期 10月 27, 2025 如何使用 Aspose C# 和 IronPDF 創建 PDF 通過這份針對開發人員設計的分步指南,學習如何使用 Aspose C# 與 IronPDF 創建 PDF。 閱讀更多