Skip to footer content
USING IRONPDF

How to Choose the Right PDF SDK for .NET in C#

Many .NET developers searching for a PDF SDK encounter the same problem: libraries that demand extensive setup, opaque licensing tiers, and APIs that were clearly designed around the PDF specification rather than developer ergonomics. IronPDF is a .NET PDF library built to eliminate that friction. It delivers PDF creation, editing, form handling, and document security through a single NuGet package that works across .NET Framework, .NET Core, and .NET 10.

Start your free trial and join teams at NASA, Tesla, and 3M who rely on IronPDF for their document workflows.

What Criteria Matter When Choosing a .NET PDF SDK?

Selecting a PDF library for production use requires evaluating trade-offs that a quick NuGet install test will not reveal. Four criteria consistently separate adequate libraries from production-ready ones.

Rendering Accuracy and HTML Engine Quality

The most consequential choice is whether the library uses a real browser engine (Chromium or WebKit) or a custom HTML-to-PDF renderer. Custom renderers support a CSS2 subset -- basic typography and floats work, but flexbox, CSS Grid, and JavaScript-rendered content fail. A Chromium-based engine renders HTML exactly as Chrome does, so existing Razor views, report templates, and client-side JavaScript produce accurate output without manual layout adjustments. To test rendering accuracy, render a document that uses CSS Grid and JavaScript-generated content; libraries with limited CSS support will misplace elements or fall back to unstyled output.

Cross-Platform and Linux Container Support

A .NET PDF SDK must run on Linux without requiring Microsoft Office or COM automation. Libraries that delegate HTML rendering to Word interop cannot run in a Linux Docker container. Chromium-based libraries ship the rendering engine as a native binary and require only standard system packages (libgdiplus, fontconfig) on Debian or Ubuntu hosts. The .NET documentation on cross-platform deployment covers runtime identifier conventions relevant when targeting Linux or Alpine Docker images.

Thread Safety and Concurrency in ASP.NET Core

Many PDF libraries document thread-safety only in a footnote. For ASP.NET Core applications generating PDFs per HTTP request, this matters directly. IronPDF's ChromePdfRenderer is not thread-safe -- each concurrent task must own its own instance. Using Parallel.ForEach with one renderer per iteration and a concurrency limit avoids contention and matches the guidance in the async and multithreading how-to guide. For batch jobs, one renderer per worker thread scales linearly with CPU core count.

Licensing Model Alignment

License structures affect total cost of ownership at scale. Per-developer licenses (IronPDF, Syncfusion) charge based on the number of developers who build and deploy the application. AGPL licenses (iText Core) require distributing application source code unless a commercial license is purchased. MIT licenses (QuestPDF, PDFsharp) impose no distribution restrictions but carry no commercial support. For regulated environments requiring long-term archiving, compliance with the ISO 19005 PDF/A standard is a distinct requirement from the license model -- verify it separately.

Use-Case Decision Guide

If the primary requirement is converting existing HTML templates or Razor views to PDF, a Chromium-based library is the correct choice. Layout work done for the web translates directly to PDF without a separate design pass.

If the requirement is generating structured documents from data without any HTML template, QuestPDF (MIT licensed) is a reasonable option for low-volume internal tooling. It does not support HTML input and cannot read or edit existing PDFs, but it eliminates the Chromium runtime dependency.

If the requirement is manipulating existing PDFs -- merging, splitting, redacting, or signing documents produced by other systems -- most commercial .NET PDF libraries handle this adequately. The differentiator is licensing cost and API ergonomics rather than rendering capability.

How Do You Install IronPDF in a .NET Project?

Adding IronPDF to a project takes under a minute via the NuGet Package Manager. Open the Package Manager Console in Visual Studio and run:

PM> Install-Package IronPdf
PM> Install-Package IronPdf
SHELL

Alternatively, add the package through the NuGet GUI by searching for IronPdf. The package targets .NET Standard 2.0, so it works with .NET Framework 4.6.2 and later, .NET Core 2.0 and later, and every modern .NET release through .NET 10.

After installation, apply a license key before rendering. For evaluation, call IronPdf.License.LicenseKey = "IRONPDF-TRIAL-KEY"; at application startup, or use the free trial license available from the IronPDF website. No license key is required to run the library locally during development.

IronPDF ships a pre-built Chromium engine as a native binary. The first time the engine initializes on a new machine it extracts its runtime to a temp folder, which takes a few seconds. Subsequent calls are fast. On Linux and Docker, ensure libgdiplus and font packages are installed - the Linux deployment guide covers distribution-specific requirements.

How Do You Create a PDF from HTML in C#?

HTML-to-PDF conversion is the most common starting point for .NET PDF SDK workflows. IronPDF uses a Chromium-based rendering engine to convert HTML strings, local files, or live URLs into pixel-accurate PDFs, preserving CSS3 layouts, Google Fonts, and JavaScript-rendered content.

using IronPdf;

// Apply license key (omit for trial watermarked output)
// IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";

var renderer = new ChromePdfRenderer();

// Configure page layout
renderer.RenderingOptions.PaperSize = IronPdf.Rendering.PdfPaperSize.A4;
renderer.RenderingOptions.MarginTop = 20;
renderer.RenderingOptions.MarginBottom = 20;
renderer.RenderingOptions.MarginLeft = 15;
renderer.RenderingOptions.MarginRight = 15;

// Render an HTML string to PDF
string htmlContent = @"
    <html>
    <head><style>body { font-family: Arial; } h1 { color: #333; }</style></head>
    <body>
        <h1>Customer Registration</h1>
        <p>Form generated on: <span id='date'></span></p>
        <form>
            <label>Full Name: <input type='text' name='name' /></label><br/>
            <label>Email: <input type='email' name='email' /></label>
        </form>
        <script>document.getElementById('date').textContent = new Date().toLocaleDateString();</script>
    </body>
    </html>";

PdfDocument pdf = renderer.RenderHtmlAsPdf(htmlContent);
pdf.SaveAs("registration-form.pdf");
using IronPdf;

// Apply license key (omit for trial watermarked output)
// IronPdf.License.LicenseKey = "YOUR-LICENSE-KEY";

var renderer = new ChromePdfRenderer();

// Configure page layout
renderer.RenderingOptions.PaperSize = IronPdf.Rendering.PdfPaperSize.A4;
renderer.RenderingOptions.MarginTop = 20;
renderer.RenderingOptions.MarginBottom = 20;
renderer.RenderingOptions.MarginLeft = 15;
renderer.RenderingOptions.MarginRight = 15;

// Render an HTML string to PDF
string htmlContent = @"
    <html>
    <head><style>body { font-family: Arial; } h1 { color: #333; }</style></head>
    <body>
        <h1>Customer Registration</h1>
        <p>Form generated on: <span id='date'></span></p>
        <form>
            <label>Full Name: <input type='text' name='name' /></label><br/>
            <label>Email: <input type='email' name='email' /></label>
        </form>
        <script>document.getElementById('date').textContent = new Date().toLocaleDateString();</script>
    </body>
    </html>";

PdfDocument pdf = renderer.RenderHtmlAsPdf(htmlContent);
pdf.SaveAs("registration-form.pdf");
$vbLabelText   $csharpLabel

Rendering Options and Page Layout

The ChromePdfRenderer class exposes a RenderingOptions property that controls every aspect of PDF layout. Set PaperSize to any standard ISO or ANSI size, or define custom dimensions in millimeters using CustomPaperWidth and CustomPaperHeight. Margin values are specified in millimeters, and PrintHtmlBackgrounds ensures background colors and images render correctly.

For URL-to-PDF conversion, pass the target address to RenderUrlAsPdf. The renderer handles cookies, HTTP headers, and custom user agents, making it suitable for authenticated pages and single-page applications. The HTML to PDF guide covers authentication, JavaScript wait conditions, and lazy-loaded content in detail.

IronPDF rendering an HTML invoice to PDF with CSS3 layout fidelity in C# IronPDF ChromePdfRenderer output: HTML template rendered to A4 PDF with CSS3 styles preserved

Rendering from File Paths and URLs

using IronPdf;

var renderer = new ChromePdfRenderer();

// Render from a URL (async variant for ASP.NET Core)
PdfDocument fromUrl = await renderer.RenderUrlAsPdfAsync("https://example.com/report");
fromUrl.SaveAs("url-report.pdf");

// Render from a local HTML file
PdfDocument fromFile = renderer.RenderHtmlFileAsPdf("templates/invoice.html");
fromFile.SaveAs("invoice.pdf");
using IronPdf;

var renderer = new ChromePdfRenderer();

// Render from a URL (async variant for ASP.NET Core)
PdfDocument fromUrl = await renderer.RenderUrlAsPdfAsync("https://example.com/report");
fromUrl.SaveAs("url-report.pdf");

// Render from a local HTML file
PdfDocument fromFile = renderer.RenderHtmlFileAsPdf("templates/invoice.html");
fromFile.SaveAs("invoice.pdf");
$vbLabelText   $csharpLabel

The RenderUrlAsPdfAsync method returns a Task<PdfDocument>, so it integrates directly with async/await patterns in ASP.NET Core controllers and background services. The async rendering guide explains thread safety and connection pool configuration for high-throughput scenarios.

How Do You Convert Images and Extract PDF Content?

Many .NET applications need to convert image files to PDF or pull images and text out of existing documents. IronPDF handles both directions without requiring intermediate file formats or external tools.

using IronPdf;

// Convert a list of image files to a single multi-page PDF
var imageFiles = new System.Collections.Generic.List<string>
{
    "scans/page1.png",
    "scans/page2.jpg",
    "scans/page3.tiff"
};

PdfDocument pdfFromImages = ImageToPdfConverter.ImageToPdf(imageFiles);
pdfFromImages.SaveAs("scanned-document.pdf");

// Extract images from an existing document
PdfDocument existing = PdfDocument.FromFile("annual-report.pdf");
var images = existing.ExtractAllImages();
int index = 0;
foreach (var img in images)
{
    img.SaveAs($"extracted/image_{index++}.png");
}

// Extract all text content for indexing or search
string fullText = existing.ExtractAllText();
System.IO.File.WriteAllText("report-text.txt", fullText);
using IronPdf;

// Convert a list of image files to a single multi-page PDF
var imageFiles = new System.Collections.Generic.List<string>
{
    "scans/page1.png",
    "scans/page2.jpg",
    "scans/page3.tiff"
};

PdfDocument pdfFromImages = ImageToPdfConverter.ImageToPdf(imageFiles);
pdfFromImages.SaveAs("scanned-document.pdf");

// Extract images from an existing document
PdfDocument existing = PdfDocument.FromFile("annual-report.pdf");
var images = existing.ExtractAllImages();
int index = 0;
foreach (var img in images)
{
    img.SaveAs($"extracted/image_{index++}.png");
}

// Extract all text content for indexing or search
string fullText = existing.ExtractAllText();
System.IO.File.WriteAllText("report-text.txt", fullText);
$vbLabelText   $csharpLabel

Working with ImageToPdfConverter and Text Extraction

The ImageToPdfConverter class preserves original image dimensions by default, but you can scale images to a target paper size by specifying IronPdf.Imaging.ImageBehavior.CenterImage or FitToPage. JPEG, PNG, GIF, TIFF, BMP, and WebP formats are all supported.

Text extraction via ExtractAllText() returns machine-readable text from both native PDFs and image-based (scanned) documents, provided the PDF contains an embedded text layer. For scanned PDFs with no text layer, pairing IronPDF with IronOCR adds optical character recognition in a single NuGet install. The ExtractAllImages() method returns a collection of AnyBitmap objects that can be saved, resized, or passed directly to other image processing libraries.

IronPDF ImageToPdfConverter converting PNG and JPEG files to a multi-page PDF ImageToPdfConverter output: three source image files combined into a single multi-page PDF document

How Do You Secure PDF Documents with Passwords and Digital Signatures?

Enterprise PDF workflows routinely require documents that are encrypted, digitally signed, or both. IronPDF exposes these capabilities through the SecuritySettings property and the PdfSignature class.

using IronPdf;
using IronPdf.Signing;

// Load an existing contract
PdfDocument contract = PdfDocument.FromFile("contracts/service-agreement.pdf");

// Apply AES-256 encryption with separate owner and user passwords
contract.SecuritySettings.OwnerPassword = "owner-admin-2024";
contract.SecuritySettings.UserPassword = "client-readonly";
contract.SecuritySettings.AllowUserPrinting = IronPdf.Security.PdfPrintSecurity.FullPrintRights;
contract.SecuritySettings.AllowUserEdits = IronPdf.Security.PdfEditSecurity.NoEdit;
contract.SecuritySettings.AllowUserCopyPasteContent = false;

// Apply a digital signature from a .pfx certificate
var signature = new PdfSignature("certs/company.pfx", "cert-password")
{
    SigningContact = "legal@company.com",
    SigningLocation = "Chicago, IL",
    SigningReason = "Contract Authorization"
};

contract.Sign(signature);
contract.SaveAs("contracts/service-agreement-signed.pdf");
using IronPdf;
using IronPdf.Signing;

// Load an existing contract
PdfDocument contract = PdfDocument.FromFile("contracts/service-agreement.pdf");

// Apply AES-256 encryption with separate owner and user passwords
contract.SecuritySettings.OwnerPassword = "owner-admin-2024";
contract.SecuritySettings.UserPassword = "client-readonly";
contract.SecuritySettings.AllowUserPrinting = IronPdf.Security.PdfPrintSecurity.FullPrintRights;
contract.SecuritySettings.AllowUserEdits = IronPdf.Security.PdfEditSecurity.NoEdit;
contract.SecuritySettings.AllowUserCopyPasteContent = false;

// Apply a digital signature from a .pfx certificate
var signature = new PdfSignature("certs/company.pfx", "cert-password")
{
    SigningContact = "legal@company.com",
    SigningLocation = "Chicago, IL",
    SigningReason = "Contract Authorization"
};

contract.Sign(signature);
contract.SaveAs("contracts/service-agreement-signed.pdf");
$vbLabelText   $csharpLabel

Security Settings and Permission Controls

The SecuritySettings property maps directly to PDF permissions as defined in the PDF 1.7 specification. Setting OwnerPassword alone restricts editing and printing at the PDF reader level; adding UserPassword requires the password to open the file at all.

Digital signatures use X.509 certificates in .pfx format, the same format used by Windows certificate stores and most certificate authorities. The signature includes contact, location, and reason fields visible in Adobe Acrobat's signature panel, satisfying many electronic signature compliance requirements. For PDF documents that may contain scripts or embedded metadata posing a security exposure, the sanitize method strips JavaScript, embedded files, and hidden metadata before distribution.

IronPDF digital signature applied to a PDF contract showing verified signature in Adobe Acrobat IronPDF PdfSignature result: X.509 certificate applied to a contract, signature panel visible in Adobe Acrobat

How Do You Fill and Read PDF Form Fields?

AcroForm and XFA form handling is a frequent requirement in insurance, healthcare, and legal document workflows. IronPDF reads field names from existing forms and writes values programmatically without requiring Acrobat or any PDF viewer.

using IronPdf;

// Open a PDF containing AcroForm fields
PdfDocument form = PdfDocument.FromFile("forms/application-form.pdf");

// List all field names for discovery
foreach (var field in form.Form.Fields)
{
    System.Console.WriteLine($"Field: {field.Name}, Type: {field.GetType().Name}");
}

// Set field values by name
form.Form.FindFormField("applicant_name").Value = "Jane Smith";
form.Form.FindFormField("date_of_birth").Value = "1985-04-12";
form.Form.FindFormField("agree_terms").Value = "true"; // checkbox

// Flatten the form to prevent further editing
form.Form.Flatten();
form.SaveAs("forms/completed-application.pdf");
using IronPdf;

// Open a PDF containing AcroForm fields
PdfDocument form = PdfDocument.FromFile("forms/application-form.pdf");

// List all field names for discovery
foreach (var field in form.Form.Fields)
{
    System.Console.WriteLine($"Field: {field.Name}, Type: {field.GetType().Name}");
}

// Set field values by name
form.Form.FindFormField("applicant_name").Value = "Jane Smith";
form.Form.FindFormField("date_of_birth").Value = "1985-04-12";
form.Form.FindFormField("agree_terms").Value = "true"; // checkbox

// Flatten the form to prevent further editing
form.Form.Flatten();
form.SaveAs("forms/completed-application.pdf");
$vbLabelText   $csharpLabel

Programmatic Form Handling with AcroForms

IronPDF's form API uses field names as identifiers, so the code maps directly to the field structure visible in Acrobat. The Flatten() method converts interactive fields to static content, producing a read-only PDF suitable for archiving or transmission. Full details on form types, radio groups, and drop-down lists are in the PDF form guide.

For generating new forms from scratch, use HTML with <input>, <select>, and <textarea> elements. The Chromium renderer converts standard HTML form elements into AcroForm fields automatically, which means existing HTML forms used in web applications can generate fillable PDFs without any structural changes. The create PDF forms how-to walks through the full workflow including radio buttons, date pickers, and multi-select fields.

How Does IronPDF Compare to Other .NET PDF Libraries?

Developers evaluating a PDF SDK for .NET typically consider rendering quality, API accessibility, deployment complexity, and licensing terms. The following table positions IronPDF relative to common .NET alternatives across these criteria.

Comparison of .NET PDF libraries by key developer criteria
Library HTML-to-PDF .NET 10 Support Form Handling Digital Signatures License Model
IronPDF Chromium-based (full CSS3/JS) Yes AcroForm + XFA Yes (.pfx) Per-developer, royalty-free
QuestPDF No (code-first layout engine) Yes No No MIT (community), commercial
iText Core Via add-on only Yes AcroForm Yes AGPL or commercial
Syncfusion PDF Partial (CSS2 subset) Yes AcroForm Yes Per-developer or revenue-based
PDFsharp No Yes (v6+) Limited No MIT

IronPDF's licensing page covers SaaS deployment, OEM redistribution, and the Iron Suite bundle that includes IronPDF alongside IronOCR, IronBarcode, and IronXL at a significant discount over purchasing each product individually.

The main differentiator for IronPDF is HTML rendering quality. Libraries built around low-level PDF drawing APIs require developers to replicate CSS layout logic manually. When existing HTML templates or Razor views already define document structure, converting them directly to PDF is faster and more maintainable than rebuilding layouts using a code-first drawing API.

What Are the Key Capabilities to Look for in a .NET PDF SDK?

Choosing a PDF library for a production application involves more than confirming that it creates PDFs. Document-intensive applications require specific capabilities that only become apparent once initial proof-of-concept work starts scaling to real data volumes and deployment environments.

Cross-Platform Deployment

A production-grade .NET PDF SDK must run on Windows Server, Linux containers, and macOS development machines without platform-specific code paths. IronPDF supports all three out of the box; the same NuGet package deploys to Azure App Service, AWS Lambda, and Docker with no platform switches in application code.

PDF/A and PDF/UA Standards Compliance

Regulated industries including government, finance, and healthcare often mandate PDF/A compliance for long-term archiving. The ISO 19005 PDF/A standard defines PDF/A-1b and PDF/A-3b, which restrict embedded JavaScript and unembedded fonts, ensuring documents remain readable without the originating application. IronPDF converts existing PDFs to PDF/A and validates compliance, returning a flag that indicates whether the output meets the standard. PDF/UA (accessibility) compliance is also available for documents that must meet WCAG or Section 508 requirements.

Batch Processing and Memory Management

Generating thousands of PDFs in a scheduled job or processing an upload queue requires predictable memory behavior. IronPDF's mixed raster content (MRC) compression reduces file size for documents containing both text and high-resolution images. For high-volume batch jobs, the multithreading guide demonstrates using Parallel.ForEach with ChromePdfRenderer instances - the renderer is not thread-safe, so each task should own its own instance.

DOCX and Excel to PDF Conversion

Beyond HTML, IronPDF converts Word documents (.docx) and spreadsheets directly to PDF, which removes dependencies on Microsoft Office interop or COM automation for document export workflows. Pairing IronPDF with IronXL gives a full spreadsheet-to-PDF pipeline without any Office installation on the server.

What Are Your Next Steps?

IronPDF converts complex PDF workflows into maintainable C# code. From HTML-to-PDF with full CSS3 fidelity to digital signatures, form handling, and PDF/A archiving, the library covers the full document lifecycle in a single NuGet package.

Start with the IronPDF documentation hub to explore tutorials, how-to guides, and the API reference. The examples gallery provides runnable code for the most common PDF tasks, including merging PDFs, adding watermarks, stamping headers and footers, and redacting sensitive content.

Purchase a license for production deployment or start your free trial to evaluate the full feature set without any commitment.

Get stated with IronPDF now.
green arrow pointer

Frequently Asked Questions

What is the best PDF SDK for .NET developers?

IronPDF is a strong choice for .NET developers who need HTML-to-PDF with full CSS3 and JavaScript support. It installs as a single NuGet package (IronPdf), supports .NET 10 and .NET Framework 4.6.2+, and runs on Windows, Linux, macOS, Azure, AWS, and Docker without configuration changes. For code-first layout generation without HTML, QuestPDF is a free MIT-licensed alternative, though it does not support reading or editing existing PDFs.

How do I install IronPDF in a .NET project?

Run 'Install-Package IronPdf' in the Visual Studio Package Manager Console, or search for 'IronPdf' in the NuGet GUI. The package targets .NET Standard 2.0, so it works with .NET Framework 4.6.2+, .NET Core 2.0+, and .NET 5 through .NET 10.

Can IronPDF convert HTML to PDF with CSS3 and JavaScript?

Yes. IronPDF uses a Chromium-based engine that renders HTML with full CSS3 layout support, Google Fonts, flexbox, grid, and JavaScript. Pass an HTML string to ChromePdfRenderer.RenderHtmlAsPdf, or a URL to RenderUrlAsPdf or RenderUrlAsPdfAsync.

Does IronPDF support digital signatures?

Yes. Use the PdfSignature class with a .pfx certificate file. Set SigningContact, SigningLocation, and SigningReason, then call PdfDocument.Sign(signature). The resulting signature is visible in Adobe Acrobat's signature panel and satisfies many electronic signature compliance requirements.

How do I fill PDF form fields with IronPDF in C#?

Load the PDF with PdfDocument.FromFile, then use form.Form.FindFormField("fieldName").Value to set values. Call form.Form.Flatten() to convert interactive fields to static content before saving. IronPDF supports AcroForm text fields, checkboxes, radio buttons, and drop-downs.

What PDF security features does IronPDF provide?

IronPDF's SecuritySettings property supports AES-256 encryption with separate owner and user passwords. You can restrict printing, editing, and copy-paste independently. The Sanitize method removes JavaScript, embedded files, and metadata from documents before distribution.

Does IronPDF support PDF/A for archiving compliance?

Yes. IronPDF can convert existing PDFs to PDF/A-1b or PDF/A-3b format and validate compliance. Use the how-to guide at ironpdf.com/how-to/pdf-a-compliance/ for the conversion API and compliance flags.

How does IronPDF compare to iText for .NET?

IronPDF and iText Core both support AcroForm handling and digital signatures. The main differences are licensing and HTML rendering. iText Core is AGPL-licensed (requiring commercial license for proprietary apps) and uses an add-on for HTML conversion. IronPDF is commercially licensed with per-developer pricing and uses a built-in Chromium engine for HTML-to-PDF with full CSS3 support.

Can IronPDF run on Linux and Docker?

Yes. The same NuGet package runs on Ubuntu, Debian, CentOS, and Alpine-based Docker images. On Linux, install libgdiplus and font packages (e.g., fontconfig, libfreetype6). The Linux deployment guide at ironpdf.com/get-started/linux/ lists distribution-specific package requirements.

How do I convert images to PDF with IronPDF?

Use ImageToPdfConverter.ImageToPdf(imageFileList) to combine JPEG, PNG, TIFF, BMP, GIF, or WebP files into a single multi-page PDF. Specify IronPdf.Imaging.ImageBehavior.FitToPage or CenterImage to control scaling behavior.

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

Iron Support Team

We're online 24 hours, 5 days a week.
Chat
Email
Call Me