---
title: "Choosing a C# PDF library"
url: https://recursiveai.org/onepdf/articles/csharp-pdf-library/
description: "C# PDF libraries compared by license, price and job: OnePDF, PdfPig, PDFsharp, QuestPDF, iText, IronPDF, Aspose.PDF and Syncfusion, with every term sourced."
date: 2026-10-26
author: OnePDF team
---

# Choosing a C# PDF library

C# PDF libraries compared by license, price and job: OnePDF, PdfPig, PDFsharp, QuestPDF, iText, IronPDF, Aspose.PDF and Syncfusion, with every term sourced.

October 26, 2026 · OnePDF team

A C# PDF library is chosen by its license first and its features second. Of the libraries compared here, three are permissively licensed, so their licenses place no copyleft or revenue conditions on closed-source commercial use: OnePDF (MIT OR Apache-2.0), PdfPig (Apache-2.0), and PDFsharp with MigraDoc up to version 6.2.4 (MIT). PDFsharp and MigraDoc 6.5.0 moved to AGPL or a paid commercial license, iText is AGPL or commercial, and QuestPDF is free under its Community License only for eligible users, such as organizations under USD 1 million in annual revenue. IronPDF, Aspose.PDF and Syncfusion are commercial products. After the license, choose by the job: generating documents, reading text, editing existing files, or converting HTML.

Every fact below comes from the publisher’s own license page, pricing page or NuGet listing. Each one is linked, and all were read on 26 October 2026. Licenses change: PDFsharp’s changed in October 2026. Check the current page and the license text before you decide, and take legal questions to a lawyer.

## C# PDF libraries at a glance: license and price

| Library, version read and license | Closed-source commercial use, per the publisher | Paid option, as published | Native binaries |
|---|---|---|---|
| [OnePDF](https://www.nuget.org/packages/RecursiveAI.OnePdf/1.11.0) 1.11.0: MIT OR Apache-2.0 | Permissive license: no revenue or source-disclosure conditions | None | None |
| [PdfPig](https://www.nuget.org/packages/PdfPig/0.1.16) 0.1.16: Apache-2.0 | Permissive license: no revenue or source-disclosure conditions | None | None |
| [PDFsharp](https://www.nuget.org/packages/PDFsharp/6.5.0) and [MigraDoc](https://www.nuget.org/packages/PDFsharp-MigraDoc/6.5.0) 6.5.0: AGPL-3.0 or commercial ([6.2.4](https://www.nuget.org/packages/PDFsharp/6.2.4) and earlier: MIT) | Needs the commercial license ([pricing](https://pdfsharp.com/Pricing)) | €750, perpetual, unlimited developers (B2B, VAT not included) | None |
| [QuestPDF](https://www.nuget.org/packages/QuestPDF/2026.9.1) 2026.9.1: QuestPDF licenses, source-available | Free under the Community License if eligible, for example under USD 1M annual revenue ([guide](https://www.questpdf.com/license/guide.html)) | Professional $1,999, Enterprise $4,999, plus tax ([pricing](https://www.questpdf.com/pricing.html)) | Skia and qpdf, 8 runtimes |
| [iText](https://www.nuget.org/packages/itext/9.8.0) 9.8.0: AGPL-3.0 or commercial | AGPL requires disclosing your application’s source, network use included ([iText](https://itextpdf.com/how-buy/AGPLv3-license)) | By quote: OEM, or a subscription priced by PDF volume ([how to buy](https://itextpdf.com/how-buy)) | None |
| [IronPDF](https://www.nuget.org/packages/IronPdf/2026.10.3) 2026.10.3: commercial EULA | Paid license; 30-day trial | From $999, perpetual, 1 developer, 1 location, 1 project ([licensing](https://ironpdf.com/licensing/)) | Chrome, through a package dependency |
| [Aspose.PDF](https://www.nuget.org/packages/Aspose.PDF/26.10.0) 26.10.0: commercial EULA | Paid license; free temporary license to evaluate | From US$1,199 for 1 developer and 1 location, or metered from US$1,999 a month ([pricing](https://purchase.aspose.com/pricing/pdf/net/)) | None |
| [Syncfusion](https://www.nuget.org/packages/Syncfusion.Pdf.Net.Core/35.1.41) 35.1.41: Syncfusion license | Free under the Community License if eligible, for example under $1M annual revenue and 5 or fewer developers ([terms](https://www.syncfusion.com/products/communitylicense)) | Not covered here ([pricing](https://www.syncfusion.com/sales/pricing)) | None |

Licenses are as the NuGet listing of the version named shows them. The native-binaries column comes from listing the files of each published package: OnePDF is one managed DLL (OnePdf.Layout adds a second), and Aspose.PDF is one managed DLL in a 199 MB package. The QuestPDF package carries `libQuestPdfSkia` and `libqpdf` under `runtimes/` for Linux, macOS and Windows on x64 and Arm. IronPDF depends on the `IronPdf.Native.Chrome.Windows` package.

## What each library is for

### OnePDF

One library for the whole life of a PDF: open and repair real-world files, decrypt, extract text in reading order, edit pages, fill and flatten forms, redact, sign and verify signatures, and save as PDF/A or PDF/UA. Its companion package, `RecursiveAI.OnePdf.Layout`, generates new documents from code. It targets .NET 10 only. More on it [below](#onepdf).

### PdfPig

“PdfPig supports reading text and content from PDF files. It also supports basic PDF file creation” ([README](https://github.com/UglyToad/PdfPig)). The same README lists what its document builder does not support: editing forms, copying or changing annotations, metadata or document structure, and adding or removing text with existing fonts. It targets .NET Framework 4.6.2 and 4.7.1, .NET Standard 2.0 and 2.1, and .NET 6, 8 and 9 ([NuGet](https://www.nuget.org/packages/PdfPig/0.1.16)). It is still below 1.0, and the README warns that “minor versions will change the public API without warning”.

### PDFsharp and MigraDoc

PDFsharp is “the Open Source library for creating and modifying PDF documents using .NET” ([NuGet](https://www.nuget.org/packages/PDFsharp/6.5.0)), and MigraDoc builds on it to lay out documents. Version 6.5.0 is the license break: “Beginning with version 6.5.0, your code must select the type of license to be used”, either `PdfSharpLicense.SetAgplLicense()` or a commercial key ([readme for 6.5](https://docs.pdfsharp.net/link/readme-v6.5.html), [license](https://docs.pdfsharp.net/General/License/License.html)). Its pricing page puts it plainly: “For using PDFsharp and MigraDoc in closed‑source or differently licensed products, you have to purchase a commercial license.” That license is €750, perpetual, for unlimited developers, projects and deployments, with updates for the 6.5.x and 7.0.x lines. Version 6.2.4 and earlier are still on NuGet under MIT.

What changed in 6.5.0, the license exception and the fix: [PDFsharp license](https://recursiveai.org/onepdf/articles/pdfsharp-license/).

### QuestPDF

A document generator: “a modern PDF generation library for C# and .NET … a code-first alternative to HTML-to-PDF conversion”, which can also merge and edit documents and write PDF/A and PDF/UA ([NuGet](https://www.nuget.org/packages/QuestPDF/2026.9.1)). The Community License is free for individuals and organizations under USD 1 million in annual gross revenue, qualifying charities, public or non-profit academic institutions, and open-source projects under an OSI-approved license. Public-sector bodies and publicly traded companies aren’t eligible at any revenue ([License Selection Guide](https://www.questpdf.com/license/guide.html)). Its source is public, but QuestPDF says “your right to use QuestPDF comes from one of our licenses, including the free Community License, not from an OSI-approved open-source license such as MIT” ([pricing FAQ](https://www.questpdf.com/pricing.html)). Paid licenses are perpetual with a year of updates, cover unlimited developers, and are priced per legal entity: Professional covers one, and Enterprise adds its affiliates (guide version 3.0, effective 6 July 2026).

### iText

iText Core creates, edits and enhances PDF documents ([NuGet](https://www.nuget.org/packages/itext/9.8.0)). The 9.8.0 package includes its forms, PDF/A, PDF/UA and signing assemblies. HTML conversion is the [pdfHTML](https://www.nuget.org/packages/itext.pdfhtml/6.3.4) add-on, also AGPL on NuGet. Under the AGPL, iText lists these obligations: disclose the source of your own application, including network deployments; disclose changes to iText; and “retain the producer line in every PDF that is created or manipulated using iText” ([AGPLv3 license](https://itextpdf.com/how-buy/AGPLv3-license)). Commercial licenses remove those restrictions, and prices are by quote.

Plans, AGPL obligations and what iText publishes about pricing: [iText license](https://recursiveai.org/onepdf/articles/itext-license/).

### IronPDF

Iron Software describes IronPDF as “Create, read, and edit PDFs. HTML to PDF for .NET” ([licensing page](https://ironpdf.com/licensing/)). The package depends on a native Chrome package. Licenses count developers, locations and projects, and SaaS or OEM redistribution is an add-on.

### Aspose.PDF and Syncfusion

Both are broad commercial PDF libraries: reading, writing and changing documents, with forms (both), and tables, digital signatures and encryption (Syncfusion), according to their [NuGet](https://www.nuget.org/packages/Aspose.PDF/26.10.0) [descriptions](https://www.nuget.org/packages/Syncfusion.Pdf.Net.Core/35.1.41). Aspose prices per developer and deployment location, or by metered use. Syncfusion includes its PDF library in a suite that is free under its Community License to companies and individuals with under $1 million in annual gross revenue, 5 or fewer developers and 10 or fewer employees, that have never taken more than $3 million in outside capital.

## HTML to PDF needs an HTML engine

If your documents start life as HTML and CSS, you need a library with a browser or HTML layout engine inside, such as IronPDF or iText with pdfHTML. A code-first library is a different approach: you describe the document in C#, which skips the browser and its dependencies. OnePDF has no HTML engine. Its [document generation](https://recursiveai.org/onepdf/articles/create-pdf-csharp/) is code-first, like QuestPDF and MigraDoc.

## OnePDF: read, edit and generate under MIT or Apache-2.0

OnePDF is written in C# with no dependency beyond .NET itself. It has no native binaries and no `unsafe` code, and it supports NativeAOT and trimming. It was built to be safe on files you didn’t write: limits on decoded size, nesting and object counts are checked before the work they guard, and it never runs a document’s scripts or touches the network. This program generates a page, merges it with an existing PDF ([IRS Form W-9](https://www.irs.gov/pub/irs-pdf/fw9.pdf)) and reads the result back:

*Program.cs · OnePDF 1.11.0 · .NET 10*

```
using OnePdf;
using OnePdf.Layout;
 
// 1. Generate a page from code.
LayoutDocument.Compose(doc =>
{
    doc.Title("Cover letter").Language("en-US");
    doc.Page(page =>
    {
        page.Size(PageSize.Letter);
        page.Margin(72);
        page.Content().Column(col =>
        {
            col.Spacing(12);
            col.Item().Heading(1).Text("New vendor packet").FontSize(22).Bold();
            col.Item().Text("Please complete the attached Form W-9 and return it with your first invoice.");
        });
    });
}).Save("cover.pdf");
 
// 2. Merge it with an existing PDF.
using (PdfDocument cover = PdfDocument.Open("cover.pdf"))
using (PdfDocument form = PdfDocument.Open("fw9.pdf"))
using (PdfDocument packet = PdfDocument.Merge([cover, form]))
{
    packet.SetInfo("Title", "New vendor packet");
    packet.Save("packet.pdf");
}
 
// 3. Read it back, in reading order.
using PdfDocument result = PdfDocument.Open("packet.pdf");
Console.WriteLine($"{result.PageCount} pages, title: {result.Info.Title}");
Console.WriteLine(result.Pages[0].ExtractText().Text);
```

*Output · Console*

```
7 pages, title: New vendor packet
New vendor packet
 
Please complete the attached Form W-9 and return it with your first invoice.
```

The packet has the cover page plus the W-9’s six pages, with the W-9’s form fields carried over. The two packages it uses are `RecursiveAI.OnePdf` and `RecursiveAI.OnePdf.Layout`, both at 1.11.0. Beyond this sample, the same library covers:

- **Text:** words, lines and blocks with positions, in reading order from the structure tree or the page geometry, right-to-left text included. See [extract text from a PDF in C#](https://recursiveai.org/onepdf/articles/extract-text-from-pdf-csharp/).
- **Pages:** [merge](https://recursiveai.org/onepdf/cookbook/merge-pdfs/), [split](https://recursiveai.org/onepdf/cookbook/split-pdf/), [rotate, delete and reorder](https://recursiveai.org/onepdf/cookbook/rotate-delete-pages/), keeping bookmarks, links, form fields and tags.
- **Forms and content:** [fill and flatten form fields](https://recursiveai.org/onepdf/cookbook/fill-flatten-forms/), [add images and watermarks](https://recursiveai.org/onepdf/cookbook/add-image-watermark/), [redact](https://recursiveai.org/onepdf/cookbook/redact/).
- **Security:** [decrypt](https://recursiveai.org/onepdf/cookbook/decrypt-pdf/) (RC4 to AES-256) and encrypt (AES), [sign (PAdES B-B and B-T) and verify signatures](https://recursiveai.org/onepdf/cookbook/sign-and-verify/), [repair damaged files](https://recursiveai.org/onepdf/cookbook/repair-damaged-pdf/).
- **Standards:** [PDF/A-2 and PDF/A-3](https://recursiveai.org/onepdf/cookbook/create-pdf-a/), [PDF/UA-1 and PDF/UA-2](https://recursiveai.org/onepdf/cookbook/create-pdf-ua/). A save that can’t conform is refused, with every violation listed.
- **Generation:** OnePdf.Layout lays out shaped text (Latin, Arabic, Indic and more), tables, lists, images, SVG, headers, footers and page X of Y, and writes a tagged PDF page by page. See [create a PDF in C#](https://recursiveai.org/onepdf/articles/create-pdf-csharp/).

### Published benchmarks

The project’s [benchmarks](https://github.com/recursive-ai-oss/onepdf-csharp/blob/v1.11.0/README.md#benchmarks) compare OnePDF with PdfPig 0.1.16 and OnePdf.Layout with MigraDoc 6.2.4 on the same files. They ran on an AMD Ryzen 9 7950X3D (16 cores) under Linux Mint 22.3 with .NET 10.0.13, and times are BenchmarkDotNet means.

- **Reading, against PdfPig:** faster on every task measured (opening files, metadata, full text, and words with positions), from 1.10× to 8.50×.
- **Text quality:** on a generated set of 62 files with exact reference text, character error on content was 0.3% for OnePDF, against 5.6% for PdfPig’s layout pipeline and 21.9% for its default `Page.Text`. On 92 real-world files in 11 categories, it was 5.6% against 13.5% for the better of PdfPig’s two methods.
- **Generation, against MigraDoc:** a 50-page report with tables, images and page X of Y took 37.1 ms against 175 ms, and a 10,000-row table took 362 ms against 1,191 ms. Published as NativeAOT, OnePDF’s first invoice in a fresh process takes 4 ms.

### What OnePDF doesn’t do

- **HTML to PDF:** no HTML engine. Build documents with OnePdf.Layout instead.
- **Rendering:** the core library turns a page into drawing calls but doesn’t produce pixels. For PNG or JPEG pages, the separate [RecursiveAI.OneImage.Pdf](https://www.nuget.org/packages/RecursiveAI.OneImage.Pdf) package (MIT OR Apache-2.0) renders them: see [convert a PDF to an image in C#](https://recursiveai.org/oneimage/articles/pdf-to-image-csharp/).
- **OCR:** a scanned page without a text layer gives no text.
- **Older frameworks:** it targets `net10.0` only, so .NET Framework and .NET 8 projects can’t use it.
- **Some conversions and edge features:** no conversion of arbitrary files to PDF/A (files that don’t conform are refused, not rewritten), no XFA form filling, no public-key encryption, and no long-term validation data (PAdES B-LT or B-LTA) when signing.

## How to choose a C# PDF library

- **You need a permissive license and more than one job (read, edit, generate) on .NET 10:** OnePDF.
- **You only read text, and you target .NET Framework or an older .NET:** PdfPig.
- **You already use PDFsharp or MigraDoc:** versions up to 6.2.4 are MIT, and 6.5.0 and later need the AGPL or a €750 commercial license. Our [PDFsharp migration guide](https://recursiveai.org/onepdf/docs/migrating-from-pdfsharp/) maps the common calls.
- **You generate documents and qualify for QuestPDF’s Community License, or accept its paid tiers:** QuestPDF. The [QuestPDF migration guide](https://recursiveai.org/onepdf/docs/migrating-from-questpdf/) shows the OnePdf.Layout equivalents.
- **Your documents are HTML templates:** IronPDF, or iText with pdfHTML.
- **Your project is itself AGPL, or you buy a commercial license:** iText, whose add-ons include [HTML conversion](https://itextpdf.com/products/convert-html-css-to-pdf-pdfhtml) and [OCR](https://itextpdf.com/products/pdf-ocr-text-recognition).
- **You want a commercial vendor and a support contract:** compare the published terms of Aspose.PDF, Syncfusion and IronPDF in the table above.

## Common questions

### Is there a free C# PDF library for commercial use?

Yes. OnePDF (MIT OR Apache-2.0), PdfPig (Apache-2.0) and PDFsharp/MigraDoc 6.2.4 and earlier (MIT) are permissively licensed. QuestPDF and Syncfusion are free for some users under their community licenses, subject to revenue and other conditions.

### Is iText free?

iText is free under the AGPLv3, which iText says requires disclosing the full source code of your own application, including web applications. If you can’t meet those terms, iText sells commercial licenses, priced by quote.

### Is PDFsharp still MIT?

Not from 6.5.0. PDFsharp and MigraDoc 6.5.0 and later, and 7.0.0 Preview 2 and later, are AGPL or commercial, and your code has to load one of the two licenses. Version 6.2.4 and earlier were published under MIT.

### How do I read a PDF file in C#?

Open it and extract the text. In OnePDF, `PdfDocument.Open` followed by `ExtractText()` returns each page’s text in reading order. The full walkthrough is [extract text from a PDF in C#](https://recursiveai.org/onepdf/articles/extract-text-from-pdf-csharp/).

### How do I generate a PDF in C#?

Describe the document in code and save it. With OnePdf.Layout you describe the pages in `LayoutDocument.Compose` and call `Save`, as shown in [create a PDF in C#](https://recursiveai.org/onepdf/articles/create-pdf-csharp/).

To start with OnePDF, run `dotnet add package RecursiveAI.OnePdf` and follow [getting started](https://recursiveai.org/onepdf/docs/getting-started/), or browse the [cookbook](https://recursiveai.org/onepdf/cookbook/) and the [OnePDF overview](https://recursiveai.org/onepdf/).
