Skip to footer content
PRODUCT COMPARISONS

IronPDF vs ExpertPDF: Which C# PDF Library Should Senior .NET Developers Choose?

IronPDF excels in HTML-to-PDF conversion with Chrome V8 engine precision and intuitive APIs, while ExpertPDF offers basic PDF capabilities with more complex configuration requirements for .NET production systems.

C# developers often face challenges when handling PDFs, whether reading, writing, creating, or converting between formats. Many libraries have emerged to address these needs, offering smooth integration for C# applications. When developing C# PDF reports, selecting the right library significantly impacts development time and output quality. For complete PDF generation in C#, understanding library capabilities proves essential.

This article compares two PDF libraries for .NET developers:

Both libraries provide methods to generate, convert, and edit PDFs in .NET environments. The key consideration involves determining which library best suits specific project requirements. This analysis highlights essential features to inform decision-making. Whether implementing HTML to PDF conversion, PDF editing capabilities, or document organization features, choosing the appropriate library proves crucial.

What is the IronPDF Library?

IronPDF provides a complete .NET PDF solution, particularly beneficial for C# developers. The library enables implementation of all necessary PDF functionality within C# applications. Supporting Azure deployment and AWS Lambda, the library suits cloud-native architectures. Developers benefit from excellent Windows support, Linux deployment, and macOS compatibility. The installation overview provides complete setup guidance.

IronPDF incorporates a .NET Chromium engine that renders HTML content to PDF, simplifying document design without complex APIs. The HTML to PDF converter creates documents using HTML5, CSS, JavaScript, and images. Additionally, developers can edit PDFs, add headers and footers, and extract images. The library simplifies text reading through reliable text extraction capabilities. For production environments, the Chrome rendering engine ensures accurate rendering.

What Are the Key Features of IronPDF?

How Do I Create PDF Files from HTML?

How Can I Edit PDFs Without Adobe Acrobat Reader?

How Do I Manipulate PDF Documents?

What File Formats Can I Convert to PDF?

How Do I Save and Print PDFs?

What is ExpertPDF?

Visit ExpertPDF's Official Site to explore their .NET library offering HTML-to-PDF conversion. The library enables PDF report generation without complex reporting software. For developers seeking complete documentation and API reference, consider using IronPDF instead of ExpertPDF for far greater resource availability.

ExpertPDF provides straightforward PDF editing capabilities. The HTML-to-PDF converter integrates into .NET applications quickly. Compatible with .NET Framework, .NET Core, .NET 5, and .NET 6, though lacking Linux deployment and macOS support. For containerized deployments, IronPDF offers Docker support while ExpertPDF does not. IronPDF also supports remote container deployment and native vs remote engine options.

This library creates PDFs from webpage URLs or raw HTML markup in .NET applications. For advanced scenarios like rendering WebGL sites or JavaScript-heavy applications, IronPDF provides superior rendering capabilities. The quickstart guide helps developers begin rapidly.

What Are the Key Features of ExpertPDF?

Notable features include:

  • Convert URL webpages to PDF
  • Convert HTML strings to PDF
  • Multiple output file options
  • Set page margins and size
  • Set headers and footers
  • Add automatic and custom page breaks
  • Convert specific webpage parts to PDF
  • Hide elements during conversion
  • Merge multiple webpages into single PDFs
  • Convert authenticated webpages to PDF
  • Select CSS media type for rendering
  • Bookmarks support
  • Digital signing support
  • Retrieve HTML element positions in PDF
  • Support for HTML5/CSS3
  • Support for web fonts
  • File Type Conversions:
    • PDF to Text Converter
    • HTML to PDF Converter
    • HTML to Image Converter
    • PDF to Image Converter
    • RTF to PDF Converter

The following sections cover:

  1. Create a Console Project
  2. IronPDF Installation
  3. ExpertPDF Installation
  4. Create PDF from a URL
  5. Create PDF from HTML Input String
  6. Merge Multiple PDFs into Single PDF
  7. Convert Images to PDF
  8. Licensing and Pricing
  9. Conclusion

How Do I Create a Console Project?

Follow these steps to create a console application using Visual Studio 2022:

  • Open Visual Studio 2022 and click create a new project

    Visual Studio 2022 welcome screen with dark theme interface showing four primary development options: Clone a repository for collaborative projects, Open a project or solution for existing work, Open a local folder for file exploration, and Create a new project for starting fresh development

  • Select C# Console App and click next

    Visual Studio's Create a new project dialog showcasing various .NET project templates with cross-platform support indicators for Windows, Linux, and macOS, featuring Console App, Class Library, and MSTest Test Project options with language and project type filters

  • Enter project name and click next

    Visual Studio project configuration window displaying setup options for a new cross-platform C# Console Application named 'DemoApp' with platform targeting choices for Linux, macOS, Windows, and console environments

  • Choose .NET Framework version (using latest 6.0)

    Visual Studio project creation wizard showing the Additional information step with Console App template selected and .NET 6.0 framework chosen, displaying cross-platform support tags for C#, Linux, macOS, Windows, and Console applications

The console project is created and ready for library testing. Both libraries require installation before use. Refer to the quickstart guide for more details. The overview documentation provides complete information.

How Do I Install IronPDF?

Multiple installation methods are available:

  1. Using Visual Studio
  2. Download the NuGet Package directly
  3. Download the IronPDF .DLL Library

Refer to the installation overview for more details. The library supports Windows installer for system-wide deployment. Advanced options include NuGet installation and using license keys.

How Do I Install Using Visual Studio?

Visual Studio provides NuGet Package Manager for installing packages:

  • Access through Project Menu Tools, or
  • Right-click the project in Solution Explorer

    Visual Studio Solution Explorer context menu displaying various project management options with the 'Manage NuGet Packages' option prominently highlighted for easy access to package management functionality

    Visual Studio IDE Tools menu expanded to show the NuGet Package Manager submenu featuring 'Manage NuGet Packages for Solution' option for centralized dependency management across all projects in the solution

Browse for IronPDF NuGet package and install. Refer to the NuGet installation guide for more details. Platform-specific guides include Android integration, F# development, and VB.NET usage. For troubleshooting deployment, see failed to deploy NuGet package guide.

How Do I Download the NuGet Package Directly?

Download IronPDF from the NuGet website:

  • Visit NuGet IronPDF Package
  • Select "Download Package"
  • Double-click the downloaded package
  • The package installs automatically
  • Reload Visual Studio

How Do I Download and Install the IronPDF DLL?

Download the IronPDF .DLL directly from IronPDF website. Click Download IronPDF DLL.

Reference IronPDF in the project:

  • Right-click Solution in Solution Explorer
  • Select "Add Reference"
  • Browse for IronPDF.dll library
  • Click OK

IronPDF installation is complete. For additional options including Docker deployment and remote engine setup, refer to the installation overview. For troubleshooting, see quick troubleshooting guide or explore initial render performance and GPU process optimization. The runtimes folder guide helps with dependency management.

How Do I Install ExpertPDF?

Two installation methods exist:

  • Using Visual Studio NuGet Package Manager
  • Downloading assemblies (older .NET versions)

Install ExpertPDF using NuGet Package Manager for modern .NET frameworks. Consider using IronPDF in place of ExpertPDF for far greater flexibility with advanced installation methods and package size optimization.

How Do I Install Using Visual Studio NuGet Package Manager?

Access NuGet Package Manager:

  • Project Menu Tools
  • Right-click project in Solution Explorer

    Visual Studio NuGet Package Manager interface showing IronPDF package search results with multiple library versions, download counts (3.88M for main package), and installation options for various platforms and rendering engines

    Visual Studio Solution Explorer context menu with the 'Manage NuGet Packages' option highlighted in the Add submenu, providing quick access to package management and dependency installation features

Browse for ExpertPDF NuGet package and install. For improve setup, consider IronPDF's using declaration guide.

Note: ExpertPDF supports only Windows, while IronPDF supports Windows, Linux, and macOS. For cloud deployments, IronPDF offers Azure integration and AWS Lambda support. IronPDF provides complete performance optimization and memory management guidance. For specific platforms, see Red Hat Enterprise Linux support and AWS Lambda on Amazon Linux 2.

How Do I Create PDF from a URL?

Both libraries convert HTML to PDF. Refer to the URL to PDF guide for more details. Complex websites may require custom render delays or JavaScript execution handling. For authenticated sites, see TLS website and system logins guide. IronPDF excels with pixel-perfect HTML to PDF conversion using Chrome rendering.

How Does IronPDF Convert URL to PDF?

IronPDF renders HTML from URLs as PDF efficiently. The library provides high-level support for CSS, JavaScript, images, and Forms. Using Chrome rendering engine ensures pixel-perfect HTML to PDF conversion. For rendering issues, see pixel-perfect HTML formatting guide. Advanced rendering options include custom paper sizes and viewport configuration. The JavaScript message listener enables dynamic content handling.

This code example shows how IronPDF allows developers to create PDFs from website URLs:

// Import the IronPdf library
using IronPdf;

// Initialize a new renderer
ChromePdfRenderer renderer = new ChromePdfRenderer();
// Render the specified URL as a PDF
var pdf = renderer.RenderUrlAsPdf("___PROTECTED_URL_190___");
// Save the rendered PDF to a file
pdf.SaveAs("url.pdf");
// Import the IronPdf library
using IronPdf;

// Initialize a new renderer
ChromePdfRenderer renderer = new ChromePdfRenderer();
// Render the specified URL as a PDF
var pdf = renderer.RenderUrlAsPdf("___PROTECTED_URL_190___");
// Save the rendered PDF to a file
pdf.SaveAs("url.pdf");
$vbLabelText   $csharpLabel

For authenticated URLs, see TLS website and system logins guide. Configure cookies and custom HTTP headers for authenticated requests. Secure sites may require Kerberos authentication. For debugging, use Chrome debugging guide. Additional examples show converting URLs to PDF.

How Does ExpertPDF Convert URL to PDF?

ExpertPDF converts URLs using savePdfFromUrlToFile method, preserving page formatting:

// Import the ExpertPdf.HtmlToPdf namespace
using ExpertPdf.HtmlToPdf;

// Initialize a new PdfConverter
PdfConverter pdfConverter = new PdfConverter();
// Use PdfConverter to save a webpage URL directly to a PDF file
pdfConverter.SavePdfFromUrlToFile("___PROTECTED_URL_191___", "output.pdf");
// Import the ExpertPdf.HtmlToPdf namespace
using ExpertPdf.HtmlToPdf;

// Initialize a new PdfConverter
PdfConverter pdfConverter = new PdfConverter();
// Use PdfConverter to save a webpage URL directly to a PDF file
pdfConverter.SavePdfFromUrlToFile("___PROTECTED_URL_191___", "output.pdf");
$vbLabelText   $csharpLabel

Behind the scenes, IronPDF use its Chrome rendering engine to provide better HTML5 and CSS3 support.

How Do I Create PDF from HTML Input String?

Both libraries create PDFs from HTML strings. Refer to the HTML string to PDF guide for more details. Use CSS for screen and print and incorporate web fonts and icon fonts. IronPDF provides excellent Bootstrap and Flexbox CSS support. The using HTML to create a PDF example demonstrates practical implementation.

How Does IronPDF Convert HTML String to PDF?

This code example shows how IronPDF allows developers to generate PDF documents from HTML strings:

// Import the IronPdf library
using IronPdf;

// Initialize a new renderer
ChromePdfRenderer renderer = new ChromePdfRenderer();
// Render a PDF from HTML string and save it
var pdfDoc1 = renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>");
pdfDoc1.SaveAs("pixel-perfect.pdf");

// Render HTML with external assets and save it
var pdfDoc2 = renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", @"C:\site\assets\");
pdfDoc2.SaveAs("html-with-assets.pdf");
// Import the IronPdf library
using IronPdf;

// Initialize a new renderer
ChromePdfRenderer renderer = new ChromePdfRenderer();
// Render a PDF from HTML string and save it
var pdfDoc1 = renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>");
pdfDoc1.SaveAs("pixel-perfect.pdf");

// Render HTML with external assets and save it
var pdfDoc2 = renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", @"C:\site\assets\");
pdfDoc2.SaveAs("html-with-assets.pdf");
$vbLabelText   $csharpLabel

IronPDF supports base URLs for relative paths and DataURIs for embedding images. For complex HTML, see HTML file to PDF guide. For specific viewports, refer to the viewport and zoom settings guide. The library handles international languages and UTF-8 seamlessly. Advanced features include HTML rendering settings and responsive HTML to PDF conversion.

How Does ExpertPDF Convert HTML String to PDF?

ExpertPDF HTML To PDF converter supports HTML string conversion:

// Import the ExpertPdf.HtmlToPdf namespace
using ExpertPdf.HtmlToPdf;

// Initialize a new PdfConverter
PdfConverter pdfConverter = new PdfConverter();
// Use PdfConverter to save an HTML string to a PDF file
pdfConverter.SavePdfFromHtmlStringToFile("<h1>PDF using Expert PDF</h1>", "html-to-pdf.pdf");
// Import the ExpertPdf.HtmlToPdf namespace
using ExpertPdf.HtmlToPdf;

// Initialize a new PdfConverter
PdfConverter pdfConverter = new PdfConverter();
// Use PdfConverter to save an HTML string to a PDF file
pdfConverter.SavePdfFromHtmlStringToFile("<h1>PDF using Expert PDF</h1>", "html-to-pdf.pdf");
$vbLabelText   $csharpLabel

The first argument specifies HTML string, the second specifies output filename. Consider using IronPDF's Unicode and UTF-8 support in place of basic HTML rendering for far greater international language support.

How Can I Generate Technical Documentation PDFs?

Technical documentation benefits from structured layouts with code examples. This Bootstrap 5 demonstration shows IronPDF's ability to render documentation with syntax highlighting and alerts. Refer to the Bootstrap and Flexbox CSS support guide for more details. IronPDF supports font management and font kerning for professional typography. For improve results, check fonts troubleshooting guide and international languages support.

using IronPdf;

var renderer = new ChromePdfRenderer();

string technicalDocs = @"
<!DOCTYPE html>
<html>
<head>
    <meta charset='utf-8'>
    <link href='___PROTECTED_URL_192___ rel='stylesheet'>
    <style>
        .code-block { background: #f8f9fa; border-left: 3px solid #0d6efd; padding: 15px; border-radius: 4px; }
        .api-method { font-family: 'Courier New', monospace; color: #0d6efd; }
        @media print { .card, .alert { page-break-inside: avoid; } }
    </style>
</head>
<body class='bg-light'>
    <div class='container py-4'>
        <div class='card shadow-sm mb-4'>
            <div class='card-header bg-dark text-white'>
                <h2 class='mb-0'>API Reference - HTML to PDF Conversion</h2>
            </div>
            <div class='card-body'>
                <h4>RenderHtmlAsPdf() Method</h4>
                <p class='lead'>Converts HTML content to PDF with full CSS3 and JavaScript support.</p>

                <div class='code-block mb-3'>
                    <code class='api-method'>PdfDocument RenderHtmlAsPdf(string htmlContent)</code>
                </div>

                <div class='row mt-4'>
                    <div class='col-md-6'>
                        <h5 class='text-primary'>Parameters</h5>
                        <table class='table table-sm table-bordered'>
                            <tr>
                                <td><code>htmlContent</code></td>
                                <td>String containing HTML to convert</td>
                            </tr>
                        </table>
                    </div>
                    <div class='col-md-6'>
                        <h5 class='text-success'>Returns</h5>
                        <table class='table table-sm table-bordered'>
                            <tr>
                                <td><code>PdfDocument</code></td>
                                <td>Generated PDF document object</td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>

        <div class='row g-3 mb-4'>
            <div class='col-md-4'>
                <div class='alert alert-success mb-0'>
                    <h6 class='alert-heading'>✓ Supported Features</h6>
                    <ul class='mb-0 small'>
                        <li>HTML5 semantic tags</li>
                        <li>CSS3 with Flexbox/Grid</li>
                        <li>JavaScript execution</li>
                        <li>External stylesheets</li>
                    </ul>
                </div>
            </div>
            <div class='col-md-4'>
                <div class='alert alert-info mb-0'>
                    <h6 class='alert-heading'>ⓘ Rendering Engine</h6>
                    <ul class='mb-0 small'>
                        <li>Chrome V8 Engine</li>
                        <li>98% browser fidelity</li>
                        <li>Sub-second rendering</li>
                        <li>Async/await support</li>
                    </ul>
                </div>
            </div>
            <div class='col-md-4'>
                <div class='alert alert-warning mb-0'>
                    <h6 class='alert-heading'>⚠ ExpertPDF Notes</h6>
                    <ul class='mb-0 small'>
                        <li>Complex API structure</li>
                        <li>Limited CSS3 support</li>
                        <li>No native JavaScript</li>
                        <li>Requires configuration</li>
                    </ul>
                </div>
            </div>
        </div>

        <div class='card shadow-sm'>
            <div class='card-header bg-primary text-white'>
                <h5 class='mb-0'>Code Example Comparison</h5>
            </div>
            <div class='card-body'>
                <div class='row'>
                    <div class='col-md-6'>
                        <h6 class='text-primary'>IronPDF (Simple)</h6>
                        <div class='code-block'>
                            <pre class='mb-0'><code>var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("output.pdf");</code></pre>
                        </div>
                        <div class='badge bg-success mt-2'>3 Lines</div>
                    </div>
                    <div class='col-md-6'>
                        <h6 class='text-warning'>ExpertPDF (Complex)</h6>
                        <div class='code-block'>
                            <pre class='mb-0'><code>var converter = new HtmlToPdfConverter();
converter.PdfDocumentOptions.PdfPageSize = PdfPageSize.A4;
converter.NavigationTimeout = 60;
byte[] result = converter.GetPdfBytesFromHtmlString(html);
File.WriteAllBytes("output.pdf", result);</code></pre>
                        </div>
                        <div class='badge bg-warning text-dark mt-2'>5+ Lines</div>
                    </div>
                </div>
            </div>
            <div class='card-footer text-muted'>
                <small><strong>Comparison:</strong> IronPDF provides a more intuitive API with less configuration overhead for common use cases.</small>
            </div>
        </div>
    </div>
</body>
</html>";

var pdf = renderer.RenderHtmlAsPdf(technicalDocs);
pdf.SaveAs("technical-documentation.pdf");
using IronPdf;

var renderer = new ChromePdfRenderer();

string technicalDocs = @"
<!DOCTYPE html>
<html>
<head>
    <meta charset='utf-8'>
    <link href='___PROTECTED_URL_192___ rel='stylesheet'>
    <style>
        .code-block { background: #f8f9fa; border-left: 3px solid #0d6efd; padding: 15px; border-radius: 4px; }
        .api-method { font-family: 'Courier New', monospace; color: #0d6efd; }
        @media print { .card, .alert { page-break-inside: avoid; } }
    </style>
</head>
<body class='bg-light'>
    <div class='container py-4'>
        <div class='card shadow-sm mb-4'>
            <div class='card-header bg-dark text-white'>
                <h2 class='mb-0'>API Reference - HTML to PDF Conversion</h2>
            </div>
            <div class='card-body'>
                <h4>RenderHtmlAsPdf() Method</h4>
                <p class='lead'>Converts HTML content to PDF with full CSS3 and JavaScript support.</p>

                <div class='code-block mb-3'>
                    <code class='api-method'>PdfDocument RenderHtmlAsPdf(string htmlContent)</code>
                </div>

                <div class='row mt-4'>
                    <div class='col-md-6'>
                        <h5 class='text-primary'>Parameters</h5>
                        <table class='table table-sm table-bordered'>
                            <tr>
                                <td><code>htmlContent</code></td>
                                <td>String containing HTML to convert</td>
                            </tr>
                        </table>
                    </div>
                    <div class='col-md-6'>
                        <h5 class='text-success'>Returns</h5>
                        <table class='table table-sm table-bordered'>
                            <tr>
                                <td><code>PdfDocument</code></td>
                                <td>Generated PDF document object</td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>

        <div class='row g-3 mb-4'>
            <div class='col-md-4'>
                <div class='alert alert-success mb-0'>
                    <h6 class='alert-heading'>✓ Supported Features</h6>
                    <ul class='mb-0 small'>
                        <li>HTML5 semantic tags</li>
                        <li>CSS3 with Flexbox/Grid</li>
                        <li>JavaScript execution</li>
                        <li>External stylesheets</li>
                    </ul>
                </div>
            </div>
            <div class='col-md-4'>
                <div class='alert alert-info mb-0'>
                    <h6 class='alert-heading'>ⓘ Rendering Engine</h6>
                    <ul class='mb-0 small'>
                        <li>Chrome V8 Engine</li>
                        <li>98% browser fidelity</li>
                        <li>Sub-second rendering</li>
                        <li>Async/await support</li>
                    </ul>
                </div>
            </div>
            <div class='col-md-4'>
                <div class='alert alert-warning mb-0'>
                    <h6 class='alert-heading'>⚠ ExpertPDF Notes</h6>
                    <ul class='mb-0 small'>
                        <li>Complex API structure</li>
                        <li>Limited CSS3 support</li>
                        <li>No native JavaScript</li>
                        <li>Requires configuration</li>
                    </ul>
                </div>
            </div>
        </div>

        <div class='card shadow-sm'>
            <div class='card-header bg-primary text-white'>
                <h5 class='mb-0'>Code Example Comparison</h5>
            </div>
            <div class='card-body'>
                <div class='row'>
                    <div class='col-md-6'>
                        <h6 class='text-primary'>IronPDF (Simple)</h6>
                        <div class='code-block'>
                            <pre class='mb-0'><code>var renderer = new ChromePdfRenderer();
var pdf = renderer.RenderHtmlAsPdf(html);
pdf.SaveAs("output.pdf");</code></pre>
                        </div>
                        <div class='badge bg-success mt-2'>3 Lines</div>
                    </div>
                    <div class='col-md-6'>
                        <h6 class='text-warning'>ExpertPDF (Complex)</h6>
                        <div class='code-block'>
                            <pre class='mb-0'><code>var converter = new HtmlToPdfConverter();
converter.PdfDocumentOptions.PdfPageSize = PdfPageSize.A4;
converter.NavigationTimeout = 60;
byte[] result = converter.GetPdfBytesFromHtmlString(html);
File.WriteAllBytes("output.pdf", result);</code></pre>
                        </div>
                        <div class='badge bg-warning text-dark mt-2'>5+ Lines</div>
                    </div>
                </div>
            </div>
            <div class='card-footer text-muted'>
                <small><strong>Comparison:</strong> IronPDF provides a more intuitive API with less configuration overhead for common use cases.</small>
            </div>
        </div>
    </div>
</body>
</html>";

var pdf = renderer.RenderHtmlAsPdf(technicalDocs);
pdf.SaveAs("technical-documentation.pdf");
$vbLabelText   $csharpLabel

Output: A professional technical documentation PDF with Bootstrap 5 cards, alerts, tables, and code blocks. IronPDF accurately renders all typography, spacing utilities, and grid layouts, demonstrating superior documentation generation capabilities.

How Can I Create Financial Reports with Complex Layouts?

Financial reporting requires precise table formatting and calculations. This example demonstrates IronPDF's complex financial layout rendering with CSS Grid and dynamic JavaScript. Refer to the JavaScript in PDFs guide including custom JavaScript execution for more details. Financial documents may need PDF compression for file optimization and metadata management for compliance. The rendering charts in PDFs guide helps with data visualization.

using IronPdf;

var renderer = new ChromePdfRenderer();
// Enable JavaScript for dynamic calculations
renderer.RenderingOptions.EnableJavaScript = true;
renderer.RenderingOptions.RenderDelay = 500; // Allow JS to execute

string financialReport = @"
<!DOCTYPE html>
<html>
<head>
    <meta charset='utf-8'>
    <style>
        @page { size: A4; margin: 20mm; }
        body { font-family: Arial, sans-serif; line-height: 1.6; }
        .header { text-align: center; margin-bottom: 30px; }
        .financial-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; margin-bottom: 20px; }
        .grid-header { background: #2c3e50; color: white; padding: 10px; font-weight: bold; }
        .grid-row { padding: 10px; border-bottom: 1px solid #ddd; }
        .grid-row:hover { background: #f9f9f9; }
        .amount { text-align: right; font-family: 'Courier New', monospace; }
        .positive { color: #27ae60; }
        .negative { color: #e74c3c; }
        .total-row { background: #ecf0f1; font-weight: bold; margin-top: 10px; }
        .footer-note { font-size: 0.8em; color: #666; margin-top: 30px; text-align: center; }
        @media print { 
            .grid-row:hover { background: transparent; }
            .financial-grid { page-break-inside: avoid; }
        }
    </style>
</head>
<body>
    <div class='header'>
        <h1>Quarterly Financial Report</h1>
        <p>Q4 2023 - Consolidated Statement</p>
    </div>

    <div class='financial-grid'>
        <div class='grid-header'>Revenue Stream</div>
        <div class='grid-header amount'>Q3 2023</div>
        <div class='grid-header amount'>Q4 2023</div>

        <div class='grid-row'>Software Licenses</div>
        <div class='grid-row amount'>$2,150,000</div>
        <div class='grid-row amount positive'>$2,875,000</div>

        <div class='grid-row'>Support Services</div>
        <div class='grid-row amount'>$850,000</div>
        <div class='grid-row amount positive'>$975,000</div>

        <div class='grid-row'>Consulting</div>
        <div class='grid-row amount'>$425,000</div>
        <div class='grid-row amount negative'>$380,000</div>

        <div class='grid-row total-row'>Total Revenue</div>
        <div class='grid-row total-row amount'>$3,425,000</div>
        <div class='grid-row total-row amount positive' id='total'>$4,230,000</div>
    </div>

    <div class='financial-grid'>
        <div class='grid-header'>Operating Expenses</div>
        <div class='grid-header amount'>Q3 2023</div>
        <div class='grid-header amount'>Q4 2023</div>

        <div class='grid-row'>R&D</div>
        <div class='grid-row amount'>$1,200,000</div>
        <div class='grid-row amount'>$1,350,000</div>

        <div class='grid-row'>Sales & Marketing</div>
        <div class='grid-row amount'>$800,000</div>
        <div class='grid-row amount'>$950,000</div>

        <div class='grid-row'>General & Admin</div>
        <div class='grid-row amount'>$400,000</div>
        <div class='grid-row amount'>$425,000</div>

        <div class='grid-row total-row'>Total Expenses</div>
        <div class='grid-row total-row amount'>$2,400,000</div>
        <div class='grid-row total-row amount'>$2,725,000</div>
    </div>

    <script>
        // Calculate growth percentage
        const q3Total = 3425000;
        const q4Total = 4230000;
        const growth = ((q4Total - q3Total) / q3Total * 100).toFixed(1);

        // Add growth indicator
        const totalEl = document.getElementById('total');
        totalEl.innerHTML += ` <small>(+${growth}%)</small>`;
    </script>

    <div class='footer-note'>
        <p>This report was generated using IronPDF's advanced rendering engine.<br>
        All financial figures are in USD. Report generated on: <span id='date'></span></p>
    </div>

    <script>
        document.getElementById('date').textContent = new Date().toLocaleDateString();
    </script>
</body>
</html>";

var pdf = renderer.RenderHtmlAsPdf(financialReport);
pdf.SaveAs("financial-report.pdf");
using IronPdf;

var renderer = new ChromePdfRenderer();
// Enable JavaScript for dynamic calculations
renderer.RenderingOptions.EnableJavaScript = true;
renderer.RenderingOptions.RenderDelay = 500; // Allow JS to execute

string financialReport = @"
<!DOCTYPE html>
<html>
<head>
    <meta charset='utf-8'>
    <style>
        @page { size: A4; margin: 20mm; }
        body { font-family: Arial, sans-serif; line-height: 1.6; }
        .header { text-align: center; margin-bottom: 30px; }
        .financial-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; margin-bottom: 20px; }
        .grid-header { background: #2c3e50; color: white; padding: 10px; font-weight: bold; }
        .grid-row { padding: 10px; border-bottom: 1px solid #ddd; }
        .grid-row:hover { background: #f9f9f9; }
        .amount { text-align: right; font-family: 'Courier New', monospace; }
        .positive { color: #27ae60; }
        .negative { color: #e74c3c; }
        .total-row { background: #ecf0f1; font-weight: bold; margin-top: 10px; }
        .footer-note { font-size: 0.8em; color: #666; margin-top: 30px; text-align: center; }
        @media print { 
            .grid-row:hover { background: transparent; }
            .financial-grid { page-break-inside: avoid; }
        }
    </style>
</head>
<body>
    <div class='header'>
        <h1>Quarterly Financial Report</h1>
        <p>Q4 2023 - Consolidated Statement</p>
    </div>

    <div class='financial-grid'>
        <div class='grid-header'>Revenue Stream</div>
        <div class='grid-header amount'>Q3 2023</div>
        <div class='grid-header amount'>Q4 2023</div>

        <div class='grid-row'>Software Licenses</div>
        <div class='grid-row amount'>$2,150,000</div>
        <div class='grid-row amount positive'>$2,875,000</div>

        <div class='grid-row'>Support Services</div>
        <div class='grid-row amount'>$850,000</div>
        <div class='grid-row amount positive'>$975,000</div>

        <div class='grid-row'>Consulting</div>
        <div class='grid-row amount'>$425,000</div>
        <div class='grid-row amount negative'>$380,000</div>

        <div class='grid-row total-row'>Total Revenue</div>
        <div class='grid-row total-row amount'>$3,425,000</div>
        <div class='grid-row total-row amount positive' id='total'>$4,230,000</div>
    </div>

    <div class='financial-grid'>
        <div class='grid-header'>Operating Expenses</div>
        <div class='grid-header amount'>Q3 2023</div>
        <div class='grid-header amount'>Q4 2023</div>

        <div class='grid-row'>R&D</div>
        <div class='grid-row amount'>$1,200,000</div>
        <div class='grid-row amount'>$1,350,000</div>

        <div class='grid-row'>Sales & Marketing</div>
        <div class='grid-row amount'>$800,000</div>
        <div class='grid-row amount'>$950,000</div>

        <div class='grid-row'>General & Admin</div>
        <div class='grid-row amount'>$400,000</div>
        <div class='grid-row amount'>$425,000</div>

        <div class='grid-row total-row'>Total Expenses</div>
        <div class='grid-row total-row amount'>$2,400,000</div>
        <div class='grid-row total-row amount'>$2,725,000</div>
    </div>

    <script>
        // Calculate growth percentage
        const q3Total = 3425000;
        const q4Total = 4230000;
        const growth = ((q4Total - q3Total) / q3Total * 100).toFixed(1);

        // Add growth indicator
        const totalEl = document.getElementById('total');
        totalEl.innerHTML += ` <small>(+${growth}%)</small>`;
    </script>

    <div class='footer-note'>
        <p>This report was generated using IronPDF's advanced rendering engine.<br>
        All financial figures are in USD. Report generated on: <span id='date'></span></p>
    </div>

    <script>
        document.getElementById('date').textContent = new Date().toLocaleDateString();
    </script>
</body>
</html>";

var pdf = renderer.RenderHtmlAsPdf(financialReport);
pdf.SaveAs("financial-report.pdf");
$vbLabelText   $csharpLabel

This code example shows how IronPDF allows developers to use CSS Grid layouts, JavaScript execution, and print-specific CSS. Add custom headers and footers to reports, implement backgrounds and foregrounds for branding, watermarks for security, and digital signatures for authentication. Refer to the generate PDF reports guide for more details.

How Do I Merge Multiple PDF Files into a Single PDF?

Both libraries merge multiple PDFs into single documents, consolidating data for efficient transmission. Refer to the merge or split PDFs guide for more details. Multi-page documents may require page management or splitting multipage PDFs. For large file performance, consider async PDF generation or parallel processing. The merge two or more PDFs example provides practical implementation. For organizing PDFs, IronPDF offers complete tools.

How Does IronPDF Merge PDF Files?

This code example shows how IronPDF allows developers to render two PDFs from HTML strings and merge them. The straightforward approach offers additional settings options. For page numbers and page breaks in merged documents, see respective guides. Also copy pages between PDFs for granular control. For forms, see form management and edit forms documentation. The page numbers and page breaks example shows combined implementation.

// Import the IronPdf library
using IronPdf;

// Define HTML strings to convert to PDF
var htmlA = @"<p> [PDF_A] </p>
        <p> [PDF_A] 1st Page </p>
        <div style='page-break-after: always;'></div>
        <p> [PDF_A] 2nd Page</p>";

var htmlB = @"<p> [PDF_B] </p>
        <p> [PDF_B] 1st Page </p>
        <div style='page-break-after: always;'></div>
        <p> [PDF_B] 2nd Page</p>";

// Initialize a new renderer
var renderer = new ChromePdfRenderer();

// Render HTML strings as PDFs
var pdfDocA = renderer.RenderHtmlAsPdf(htmlA);
var pdfDocB = renderer.RenderHtmlAsPdf(htmlB);

// Merge the PDF documents
var mergedPdf = PdfDocument.Merge(pdfDocA, pdfDocB);

// Save the merged PDF
mergedPdf.SaveAs("Merged.pdf");
// Import the IronPdf library
using IronPdf;

// Define HTML strings to convert to PDF
var htmlA = @"<p> [PDF_A] </p>
        <p> [PDF_A] 1st Page </p>
        <div style='page-break-after: always;'></div>
        <p> [PDF_A] 2nd Page</p>";

var htmlB = @"<p> [PDF_B] </p>
        <p> [PDF_B] 1st Page </p>
        <div style='page-break-after: always;'></div>
        <p> [PDF_B] 2nd Page</p>";

// Initialize a new renderer
var renderer = new ChromePdfRenderer();

// Render HTML strings as PDFs
var pdfDocA = renderer.RenderHtmlAsPdf(htmlA);
var pdfDocB = renderer.RenderHtmlAsPdf(htmlB);

// Merge the PDF documents
var mergedPdf = PdfDocument.Merge(pdfDocA, pdfDocB);

// Save the merged PDF
mergedPdf.SaveAs("Merged.pdf");
$vbLabelText   $csharpLabel

The Merge method accepts multiple documents as Enumerable objects. See IronPDF Code Example for Merging PDFs. For adding cover pages or creating table of contents, see specialized guides. Also stamp new content or add attachments. The split a PDF and extract pages example demonstrates reverse operations.

Note that merged PDFs containing editable forms have form field names appended with index numbers. Refer to the form data handling guide for more details.

How Does ExpertPDF Merge PDF Files?

ExpertPDF uses a Merge PDF component requiring separate installation. The AppendPDFFile method appends files to PDFMerge objects:

// Import the ExpertPdf.MergePdf namespace
using ExpertPdf.MergePdf;

// Initialize a new PDFMerge object
PDFMerge pdfMerge = new PDFMerge();
// Append PDF files to the merge object
pdfMerge.AppendPDFFile("output.pdf");
pdfMerge.AppendPDFFile("html-to-pdf.pdf");
// Save the merged PDF to a file
pdfMerge.SaveMergedPDFToFile("merged.pdf");
// Import the ExpertPdf.MergePdf namespace
using ExpertPdf.MergePdf;

// Initialize a new PDFMerge object
PDFMerge pdfMerge = new PDFMerge();
// Append PDF files to the merge object
pdfMerge.AppendPDFFile("output.pdf");
pdfMerge.AppendPDFFile("html-to-pdf.pdf");
// Save the merged PDF to a file
pdfMerge.SaveMergedPDFToFile("merged.pdf");
$vbLabelText   $csharpLabel

Behind the scenes, IronPDF use more efficient merging algorithms. Consider using IronPDF's async PDF generation and multi-threaded generation in place of synchronous operations for far greater performance.

How Can I Implement Advanced PDF Merging with Document Organization?

Enterprise applications require advanced features like bookmarks, page organization, and metadata preservation when merging PDFs. This example demonstrates bookmark management, metadata handling, and document organization. For compliance, implement revision history, PDF/A conversion, and PDF/UA accessibility. The outlines & bookmarks example provides additional implementation details. Refer to the set & edit metadata guide and metadata visibility troubleshooting for more details.

using IronPdf;
using System.Collections.Generic;
using System.Linq;

public class AdvancedPdfMerger
{
    public static void MergeDocumentsWithBookmarks()
    {
        var renderer = new ChromePdfRenderer();
        var documentsToMerge = new List<PdfDocument>();

        // Create chapter PDFs with proper structure
        string[] chapters = { "Introduction", "Technical Overview", "Implementation", "Conclusion" };

        foreach (var chapter in chapters)
        {
            string html = $@"
                <html>
                <head>
                    <style>
                        body {{ font-family: Georgia, serif; margin: 40px; }}
                        h1 {{ color: #2c3e50; border-bottom: 2px solid #3498db; padding-bottom: 10px; }}
                        .chapter-number {{ color: #7f8c8d; font-size: 0.8em; }}
                    </style>
                </head>
                <body>
                    <h1><span class='chapter-number'>Chapter {Array.IndexOf(chapters, chapter) + 1}</span><br>{chapter}</h1>
                    <p>This is the content for the {chapter} chapter. In a real document, this would contain 
                    extensive content, diagrams, and detailed explanations.</p>
                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor 
                    incididunt ut labore et dolore magna aliqua.</p>
                </body>
                </html>";

            var pdf = renderer.RenderHtmlAsPdf(html);

            // Add metadata to each chapter
            pdf.MetaData.Title = $"Chapter: {chapter}";
            pdf.MetaData.Author = "Technical Documentation Team";
            pdf.MetaData.Subject = "Enterprise PDF Generation";

            documentsToMerge.Add(pdf);
        }

        // Create a table of contents
        string tocHtml = @"
            <html>
            <head>
                <style>
                    body { font-family: Georgia, serif; margin: 40px; }
                    h1 { text-align: center; color: #2c3e50; margin-bottom: 40px; }
                    .toc-entry { margin: 15px 0; font-size: 1.1em; }
                    .toc-entry a { text-decoration: none; color: #3498db; }
                    .page-number { float: right; color: #7f8c8d; }
                </style>
            </head>
            <body>
                <h1>Table of Contents</h1>";

        int pageNumber = 2; // Starting after TOC page
        foreach (var chapter in chapters)
        {
            tocHtml += $@"
                <div class='toc-entry'>
                    <a href='#'>Chapter {Array.IndexOf(chapters, chapter) + 1}: {chapter}</a>
                    <span class='page-number'>{pageNumber}</span>
                </div>";
            pageNumber += 2; // Assuming each chapter is 2 pages
        }

        tocHtml += @"
            </body>
            </html>";

        var tocPdf = renderer.RenderHtmlAsPdf(tocHtml);

        // Merge all documents with TOC first
        var allDocuments = new List<PdfDocument> { tocPdf };
        allDocuments.AddRange(documentsToMerge);

        var finalPdf = PdfDocument.Merge(allDocuments);

        // Add bookmarks for navigation
        finalPdf.BookMarks.AddBookMarkAtStart("Table of Contents", 0);
        int currentPage = 1; // After TOC
        foreach (var chapter in chapters)
        {
            finalPdf.BookMarks.AddBookMarkAtStart($"Chapter {Array.IndexOf(chapters, chapter) + 1}: {chapter}", currentPage);
            currentPage += 2;
        }

        // Set document properties
        finalPdf.MetaData.Title = "Complete Technical Documentation";
        finalPdf.MetaData.Keywords = "IronPDF, Documentation, Enterprise, .NET";
        finalPdf.MetaData.CreationDate = System.DateTime.Now;

        // Add page numbers to footer
        finalPdf.AddTextFooters("Page {page} of {total-pages}", 
            new ChromePdfRenderer.ChromePdfRenderOptions() 
            { 
                MarginBottom = 20,
                MarginLeft = 50,
                MarginRight = 50
            });

        finalPdf.SaveAs("advanced-merged-document.pdf");
    }
}
using IronPdf;
using System.Collections.Generic;
using System.Linq;

public class AdvancedPdfMerger
{
    public static void MergeDocumentsWithBookmarks()
    {
        var renderer = new ChromePdfRenderer();
        var documentsToMerge = new List<PdfDocument>();

        // Create chapter PDFs with proper structure
        string[] chapters = { "Introduction", "Technical Overview", "Implementation", "Conclusion" };

        foreach (var chapter in chapters)
        {
            string html = $@"
                <html>
                <head>
                    <style>
                        body {{ font-family: Georgia, serif; margin: 40px; }}
                        h1 {{ color: #2c3e50; border-bottom: 2px solid #3498db; padding-bottom: 10px; }}
                        .chapter-number {{ color: #7f8c8d; font-size: 0.8em; }}
                    </style>
                </head>
                <body>
                    <h1><span class='chapter-number'>Chapter {Array.IndexOf(chapters, chapter) + 1}</span><br>{chapter}</h1>
                    <p>This is the content for the {chapter} chapter. In a real document, this would contain 
                    extensive content, diagrams, and detailed explanations.</p>
                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor 
                    incididunt ut labore et dolore magna aliqua.</p>
                </body>
                </html>";

            var pdf = renderer.RenderHtmlAsPdf(html);

            // Add metadata to each chapter
            pdf.MetaData.Title = $"Chapter: {chapter}";
            pdf.MetaData.Author = "Technical Documentation Team";
            pdf.MetaData.Subject = "Enterprise PDF Generation";

            documentsToMerge.Add(pdf);
        }

        // Create a table of contents
        string tocHtml = @"
            <html>
            <head>
                <style>
                    body { font-family: Georgia, serif; margin: 40px; }
                    h1 { text-align: center; color: #2c3e50; margin-bottom: 40px; }
                    .toc-entry { margin: 15px 0; font-size: 1.1em; }
                    .toc-entry a { text-decoration: none; color: #3498db; }
                    .page-number { float: right; color: #7f8c8d; }
                </style>
            </head>
            <body>
                <h1>Table of Contents</h1>";

        int pageNumber = 2; // Starting after TOC page
        foreach (var chapter in chapters)
        {
            tocHtml += $@"
                <div class='toc-entry'>
                    <a href='#'>Chapter {Array.IndexOf(chapters, chapter) + 1}: {chapter}</a>
                    <span class='page-number'>{pageNumber}</span>
                </div>";
            pageNumber += 2; // Assuming each chapter is 2 pages
        }

        tocHtml += @"
            </body>
            </html>";

        var tocPdf = renderer.RenderHtmlAsPdf(tocHtml);

        // Merge all documents with TOC first
        var allDocuments = new List<PdfDocument> { tocPdf };
        allDocuments.AddRange(documentsToMerge);

        var finalPdf = PdfDocument.Merge(allDocuments);

        // Add bookmarks for navigation
        finalPdf.BookMarks.AddBookMarkAtStart("Table of Contents", 0);
        int currentPage = 1; // After TOC
        foreach (var chapter in chapters)
        {
            finalPdf.BookMarks.AddBookMarkAtStart($"Chapter {Array.IndexOf(chapters, chapter) + 1}: {chapter}", currentPage);
            currentPage += 2;
        }

        // Set document properties
        finalPdf.MetaData.Title = "Complete Technical Documentation";
        finalPdf.MetaData.Keywords = "IronPDF, Documentation, Enterprise, .NET";
        finalPdf.MetaData.CreationDate = System.DateTime.Now;

        // Add page numbers to footer
        finalPdf.AddTextFooters("Page {page} of {total-pages}", 
            new ChromePdfRenderer.ChromePdfRenderOptions() 
            { 
                MarginBottom = 20,
                MarginLeft = 50,
                MarginRight = 50
            });

        finalPdf.SaveAs("advanced-merged-document.pdf");
    }
}
$vbLabelText   $csharpLabel

This advanced implementation demonstrates bookmark management, metadata handling, and page numbering. Refer to the organize PDFs tutorial for more details. Explore PDF compression techniques after merging. For security, implement password protection and encryption. The add classic text headers & footers example provides formatting options. For additional features, explore add page numbers and add a table of contents guides. The passwords, security & metadata example shows integrated implementation.

How Do I Convert Images to PDF?

IronPDF converts various images to PDF, a feature unavailable in ExpertPDF. However, ExpertPDF extracts images from PDFs and converts PDFs to images, capabilities IronPDF also provides. Refer to the image to PDF guide for more details. IronPDF supports rasterizing PDFs to images and extracting text and images. For advanced scenarios, draw text and bitmaps or draw lines and rectangles. The images to PDF example demonstrates practical implementation. For image quality, see C# PDF to image without losing quality example.

How Does IronPDF Convert Images to PDF?

Creating PDFs from images uses the ImageToPdfConverter class. Images load from any folder, supporting various formats including multi-page TIFF files. Also add images to existing PDFs or work with SVG graphics. For memory efficiency, use rasterize to images using MemoryStream. The custom PDF size example helps with layout control.

// Import the IronPdf namespace
using IronPdf;

// Specify the folder containing the image files
var imageFiles = System.IO.Directory.EnumerateFiles(@"C:\project\assets")
                  .Where(file => file.EndsWith(".jpg") || file.EndsWith(".jpeg"));

// Convert the images to a PDF document
var pdfDocument = ImageToPdfConverter.ImageToPdf(imageFiles);
// Save the PDF document
pdfDocument.SaveAs(@"C:\project\composite.pdf");
// Import the IronPdf namespace
using IronPdf;

// Specify the folder containing the image files
var imageFiles = System.IO.Directory.EnumerateFiles(@"C:\project\assets")
                  .Where(file => file.EndsWith(".jpg") || file.EndsWith(".jpeg"));

// Convert the images to a PDF document
var pdfDocument = ImageToPdfConverter.ImageToPdf(imageFiles);
// Save the PDF document
pdfDocument.SaveAs(@"C:\project\composite.pdf");
$vbLabelText   $csharpLabel

Beyond converting images to PDF, IronPDF converts scanned documents and business documents to images using rasterize to images. The library also extracts images from various file types. Refer to the rasterizing to images using MemoryStream guide for memory operations. For large images, consider ImageToPDF file size optimization. The portrait & landscape orientation example helps with page setup. For advanced image handling, see embedding bitmaps and images example.

How Can I Create Advanced Image to PDF Conversions with Layout Control?

For controlled image placement and professional layouts, this photo album example demonstrates embedding images and layout creation. For cloud storage, see Azure Blob Storage images guide. The set grayscale example shows image processing options:

using IronPdf;
using System.IO;

public class PhotoAlbumCreator
{
    public static void CreatePhotoAlbum(string imagesFolder, string outputPath)
    {
        var renderer = new ChromePdfRenderer();
        renderer.RenderingOptions.PaperSize = IronPdf.Rendering.PdfPaperSize.A4;
        renderer.RenderingOptions.MarginTop = 20;
        renderer.RenderingOptions.MarginBottom = 20;
        renderer.RenderingOptions.MarginLeft = 20;
        renderer.RenderingOptions.MarginRight = 20;

        string htmlContent = @"
            <!DOCTYPE html>
            <html>
            <head>
                <style>
                    body { font-family: Arial, sans-serif; }
                    .album-title { text-align: center; font-size: 2em; margin-bottom: 30px; color: #2c3e50; }
                    .photo-container { margin-bottom: 30px; text-align: center; page-break-inside: avoid; }
                    .photo { max-width: 100%; max-height: 500px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
                    .caption { margin-top: 10px; font-style: italic; color: #666; }
                    .page-break { page-break-after: always; }
                </style>
            </head>
            <body>
                <h1 class='album-title'>My Photo Album</h1>";

        var imageFiles = Directory.GetFiles(imagesFolder, "*.*")
            .Where(file => new[] { ".jpg", ".jpeg", ".png", ".gif" }
            .Contains(Path.GetExtension(file).ToLower()))
            .ToList();

        for (int i = 0; i < imageFiles.Count; i++)
        {
            string base64Image = Convert.ToBase64String(File.ReadAllBytes(imageFiles[i]));
            string fileName = Path.GetFileNameWithoutExtension(imageFiles[i]);

            htmlContent += $@"
                <div class='photo-container'>
                    <img class='photo' src='data:image/jpeg;base64,{base64Image}' alt='{fileName}'>
                    <div class='caption'>Photo {i + 1}: {fileName}</div>
                </div>";

            // Add page break every 2 photos
            if ((i + 1) % 2 == 0 && i < imageFiles.Count - 1)
            {
                htmlContent += "<div class='page-break'></div>";
            }
        }

        htmlContent += @"
                <div style='text-align: center; margin-top: 40px; color: #999;'>
                    <small>Created with IronPDF - Total Photos: " + imageFiles.Count + @"</small>
                </div>
            </body>
            </html>";

        var pdf = renderer.RenderHtmlAsPdf(htmlContent);
        pdf.SaveAs(outputPath);
    }
}

// Usage
PhotoAlbumCreator.CreatePhotoAlbum(@"C:\MyPhotos", @"C:\MyPhotoAlbum.pdf");
using IronPdf;
using System.IO;

public class PhotoAlbumCreator
{
    public static void CreatePhotoAlbum(string imagesFolder, string outputPath)
    {
        var renderer = new ChromePdfRenderer();
        renderer.RenderingOptions.PaperSize = IronPdf.Rendering.PdfPaperSize.A4;
        renderer.RenderingOptions.MarginTop = 20;
        renderer.RenderingOptions.MarginBottom = 20;
        renderer.RenderingOptions.MarginLeft = 20;
        renderer.RenderingOptions.MarginRight = 20;

        string htmlContent = @"
            <!DOCTYPE html>
            <html>
            <head>
                <style>
                    body { font-family: Arial, sans-serif; }
                    .album-title { text-align: center; font-size: 2em; margin-bottom: 30px; color: #2c3e50; }
                    .photo-container { margin-bottom: 30px; text-align: center; page-break-inside: avoid; }
                    .photo { max-width: 100%; max-height: 500px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
                    .caption { margin-top: 10px; font-style: italic; color: #666; }
                    .page-break { page-break-after: always; }
                </style>
            </head>
            <body>
                <h1 class='album-title'>My Photo Album</h1>";

        var imageFiles = Directory.GetFiles(imagesFolder, "*.*")
            .Where(file => new[] { ".jpg", ".jpeg", ".png", ".gif" }
            .Contains(Path.GetExtension(file).ToLower()))
            .ToList();

        for (int i = 0; i < imageFiles.Count; i++)
        {
            string base64Image = Convert.ToBase64String(File.ReadAllBytes(imageFiles[i]));
            string fileName = Path.GetFileNameWithoutExtension(imageFiles[i]);

            htmlContent += $@"
                <div class='photo-container'>
                    <img class='photo' src='data:image/jpeg;base64,{base64Image}' alt='{fileName}'>
                    <div class='caption'>Photo {i + 1}: {fileName}</div>
                </div>";

            // Add page break every 2 photos
            if ((i + 1) % 2 == 0 && i < imageFiles.Count - 1)
            {
                htmlContent += "<div class='page-break'></div>";
            }
        }

        htmlContent += @"
                <div style='text-align: center; margin-top: 40px; color: #999;'>
                    <small>Created with IronPDF - Total Photos: " + imageFiles.Count + @"</small>
                </div>
            </body>
            </html>";

        var pdf = renderer.RenderHtmlAsPdf(htmlContent);
        pdf.SaveAs(outputPath);
    }
}

// Usage
PhotoAlbumCreator.CreatePhotoAlbum(@"C:\MyPhotos", @"C:\MyPhotoAlbum.pdf");
$vbLabelText   $csharpLabel

This code example shows how IronPDF allows developers to implement embedding images with DataURIs, managing page breaks, and creating professional layouts. For cloud images, see Azure Blob Storage images guide. For large files, consider ImageToPDF file size optimization. Also scale PDF objects and translate PDF objects for precise positioning. The export PDFs to memory example helps with memory-efficient workflows. Refer to the adding HTML content efficiently guide for batch processing.

What Are the Licensing and Pricing Options?

IronPDF is a commercial C# PDF library available on the IronPDF website. Free for private development, licensed for commercial use. Various Licenses are available for single projects, developers, agencies, and corporations. Supports SaaS and OEM redistribution. Refer to the license keys guide for implementation details. When deploying, apply a license key properly. For web applications, set license keys in Web.config. For licensing server connection issues, consult troubleshooting guide. The using license keys guide provides complete implementation details.

Visual Studio IDE Tools menu showing NuGet Package Manager options including Package Manager Console and Manage NuGet Packages for Solution, providing centralized dependency management for .NET development projects

All licenses include 30-day money-back guarantee, one year support, and product updates. Perpetual licenses require one-time purchase without extra fees. Lite package for single developer/project starts from $799. For support beyond first year, see license extensions. To upgrade for additional features or deployment, check licensing upgrades. For IronPDF and IIS deployment or adding IronPDF to software installers, see specialized guides. The ClickOnce version incompatibility guide helps with deployment issues.

ExpertPDF offers per-developer or per-company licenses. Try ExpertPDF free. Check license features below. Consider using IronPDF's transparent licensing options in place of ExpertPDF for far greater value and complete support.

NuGet Package Manager interface displaying six ExpertPDF libraries with download statistics, showing HTML to PDF converter (145K downloads) and various specialized PDF manipulation tools, all at version 11.0.2.0

ExpertComponents Toolkit Total developer license starts from $850, ExpertPDF Toolkit from $750. Purchase single components separately. View Full Pricing for ExpertPDF. For enterprise requirements, IronPDF's licensing offers better value with complete feature sets.

Which PDF Library Should I Choose?

IronPDF renders HTML to PDF locally without internet connection, simulating standards-compliant web browsers. The HTML render produces precise, vector-format output suitable for commercial printing. Licensed for commercial use with transparent pricing. For enterprise deployments, IronPDF offers Docker support and remote engine capabilities. Refer to the guides on running IronPDF as remote container and native vs remote engine options. The library provides IronPDF.Slim for reduced deployment size and supports package size optimization. The IronPdf.Slim v2025.5.6 deployment exception guide helps with specific version issues.

ExpertPDF's HTML-to-PDF Converter Library converts webpages and HTML to PDFs, generates reports from ASP.NET, and signs contracts electronically. Free to use with licensed additional features. Unlike IronPDF's complete platform support including Android deployment, ExpertPDF limits to Windows platforms. Behind the scenes, IronPDF use advanced security features and regular product updates. The milestones overview showcases continuous improvement including Chrome rendering milestone, compatibility milestone, and stability & performance milestone.

While both libraries handle PDFs and convert from popular formats, IronPDF offers advantages over ExpertPDF. IronPDF converts from wider format ranges including XML, images, AngularJS, Markdown, and RTF, with reliable PDF generation, formatting, and editing features. This ensures that developers achieve efficiency for pragmatic development. The library excels in performance improvement with async support for high-throughput scenarios. For concurrent processing, IronPDF supports parallel PDF generation and multi-threaded generation. Refer to the initial render slow troubleshooting guide for optimization details.

ExpertPDF requires separate component installation, whereas IronPDF integrates all functionality. This is particularly useful when projects require complete PDF features. IronPDF packages offer lifetime licenses without ongoing costs, while ExpertPDF requires renewals. Additionally, IronPDF provides complete documentation, API reference, and code examples for quick starts. The demos section showcases real implementations. For troubleshooting, see quick troubleshooting guide or explore initial render performance and GPU process optimization. The getting the best support guide ensures efficient issue resolution.

For production deployments, IronPDF offers superior debugging capabilities, custom logging, and extensive troubleshooting guides. The library supports advanced features: PDF/A compliance, PDF/UA accessibility, digital signatures with HSM, and sanitization for secure handling. For enterprise security, IronPDF provides encryption and decryption, password protection, and complete security features. Advanced features include redacting text, flattening PDFs, and managing PDF versions. The convert PDF to base64 guide helps with data transmission.

Regarding support and development, IronPDF offers engineering support with detailed guides for making support requests. Library product updates and milestones demonstrate continuous improvement. For .NET MAUI developers, IronPDF provides PDF viewing capabilities and XAML to PDF conversion. Blazor developers use Blazor Server integration and Razor to PDF conversion. The library supports CSHTML to PDF conversion for MVC applications and headless CSHTML rendering. Refer to the Blazor Server / WebAssembly guide for limitations.

For specialized uses, IronPDF excels with OpenAI integration for intelligent processing, rendering charts in PDFs, converting CSHTML to PDF in MVC applications, and supporting international languages and UTF-8. The library handles complex scenarios: flattening PDFs, linearizing for fast web view, and creating PDF forms. Explore transforming PDF pages, removing PDF objects, and setting custom temp paths. IronPDF's complete feature overview showcases capabilities for creating PDFs, converting PDFs, editing PDFs, organizing PDFs, and securing PDFs. Additional features include read PDF files in C#, text find and replace, and remove specific PDF pages.

For deployment considerations, see debugging Azure Functions on local machine, Azure log files management, AWS log files handling, and solutions for 502 bad gateway errors. IronPDF provides complete error handling including access to path denied solutions, Chrome dependencies deployment, PDFium dependencies deployment, and bad allocation error solutions. Platform-specific support includes Linux-specific guides, macOS native exceptions, and Windows Nano Server limitations. Security features include Log4j vulnerability status and protection against segmentation faults on AWS Lambda.

Please noteExpertPDF is a registered trademark of its respective owner. This site is not affiliated with, endorsed by, or sponsored by ExpertPDF. All product names, logos, and brands are property of their respective owners. Comparisons are for informational purposes only and reflect publicly available information at the time of writing.

Frequently Asked Questions

How can I convert HTML to PDF in C#?

You can use IronPDF's RenderHtmlAsPdf method to convert HTML strings into PDFs. You can also convert HTML files into PDFs using RenderHtmlFileAsPdf.

What are the main differences between IronPDF and ExpertPDF?

IronPDF offers broader format support and integrated functionality, including PDF creation from HTML, editing, and format conversion. ExpertPDF provides straightforward HTML to PDF conversion with options for output file configurations and digital signatures.

Can I extract text and images from a PDF using these libraries?

Yes, IronPDF allows you to extract text and images from PDF documents, making it easy to manipulate and analyze PDF content within .NET applications.

What installation options are available for these PDF libraries?

Both IronPDF and ExpertPDF can be installed using Visual Studio's NuGet Package Manager. Additionally, IronPDF's .DLL library can be downloaded directly from the IronPDF website.

Is it possible to merge multiple PDF files into a single document?

Yes, IronPDF provides a Merge method to combine multiple PDFs into one document. ExpertPDF also offers a PDFMerge component for merging PDFs.

Does IronPDF require an internet connection for HTML to PDF conversion?

No, IronPDF does not require an internet connection for HTML to PDF conversion, making it a reliable option for offline applications.

What are the licensing options available for IronPDF?

IronPDF offers various licensing options, including single project, developer, agency, and corporate licenses. All licenses are perpetual and include a 30-day money-back guarantee and one year of support and updates.

Can ExpertPDF handle digital signatures for PDF documents?

Yes, ExpertPDF supports digital signing of PDF documents, allowing for secure and authenticated PDF files.

What challenges do C# developers face when working with PDFs, and how do these libraries help?

C# developers often face challenges in reading, writing, creating, and converting PDFs. Libraries like IronPDF and ExpertPDF simplify these tasks by providing powerful tools for HTML to PDF conversion, PDF editing, and more, facilitating easy integration into C# applications.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...

Read More