7 Things You Can Do with a PDF Library .NET Developers Actually Want to Use

Xceed PDF Library for .NET 2.0 ships with digital signing, bookmarks, form fields, and cross-platform support. This guide covers what it does, how it compares, and includes a working demo project on .NET 10.

Every .NET developer eventually faces the same moment: someone asks you to generate a PDF. Maybe it’s an invoice. Maybe a report. Maybe a signed contract. And suddenly you’re staring at a dozen NuGet packages, half of them abandoned, wondering which one won’t waste your afternoon.

Le PDF library .NET ecosystem is crowded — but most options fall into two traps. They either try to do everything (and cost a fortune), or they cover the basics while quietly breaking on anything beyond “Hello World.” Finding something in the middle — lightweight, genuinely capable, reasonably priced — has always been the hard part.

Xceed released PDF Library for .NET 2.0 in March 2026. It creates, edits, signs, and extracts PDF documents from pure C# code. No Adobe Acrobat dependency, no Interop hacks, no spawning external processes. Just a single NuGet package that targets .NET 5 through .NET 10 and runs on Windows, macOS, and Linux.

Here’s what it actually does — with code you can copy and run today.

Getting started: one NuGet package, zero dependencies

Installer le C# PDF library from NuGet:

dotnet add package Xceed.PdfLibrary.NET

That pulls in version 2.0.26166.7850. The package has no external dependencies on .NET 5+ (only System.Security.Cryptography.Pkcs for digital signing, which ships with the runtime). Your project file stays clean:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net10.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Xceed.PdfLibrary.NET" Version="2.0.26166.7850" />
  </ItemGroup>
</Project>

Before creating or loading any PDF, set your license key. You can grab a free 45-day trial from the product page:

using Xceed.PdfLibrary.NET;

Licenser.LicenseKey = "YOUR-LICENSE-KEY-HERE";

That’s it. No installer, no COM registration, no runtime prerequisites beyond .NET itself.

1. Create a PDF from scratch in C#

This is the feature most developers reach for first. Here’s how you create PDF C# documents with Xceed:

using var doc = PdfDocument.Create("output/hello.pdf");

var page = doc.Pages[0];
var helvetica = doc.Fonts.GetStandardFont(StandardFontType.Helvetica);
var titleStyle = TextStyle.WithFont(helvetica, 24)
                          .SetBrush(new SolidColorBrush(Color.DarkBlue));
var bodyStyle = TextStyle.WithFont(helvetica, 12);

// Title positioned explicitly, then body text below
page.AddText("Xceed PDF Library for .NET 2.0",
             new Rectangle(50, 50, 500, 40),
             titleStyle);

page.AddText(
    "This document was generated entirely in C# using Xceed PdfLibrary " +
    "for .NET. No Adobe Acrobat, no Interop, no external processes — " +
    "just a NuGet package and a few lines of code.",
    new Rectangle(50, 110, 500, 80),
    bodyStyle);

// Add a second page
var page2 = doc.Pages.Add();
page2.AddText("Second Page",
              new Rectangle(50, 50, 500, 40),
              titleStyle);

doc.Save();

PdfDocument.Create gives you a document with one blank page. AddText places content at exact coordinates using a Rectangle (x, y, width, height), so you control the layout precisely. The API uses immutable style objects — you build a TextStyle once and reuse it throughout your document. Consequently, your code stays readable even when generating complex multi-page reports.

Creating a PDF from scratch with Xceed PDF library .NET — C# code output

2. Add interactive form fields

Need fillable PDFs? The library supports text boxes, checkboxes, combo boxes, list boxes, radio buttons, date fields, number fields, and signature fields. Here’s how you build a simple intake form:

using var doc = PdfDocument.Create("output/form.pdf");

var page = doc.Pages[0];
var helvetica = doc.Fonts.GetStandardFont(StandardFontType.Helvetica);
var labelStyle = TextStyle.WithFont(helvetica, 11);

page.AddText("Full Name:", new Point(50, 50), labelStyle);
var nameField = new TextBoxFormField("",
                                    new Rectangle(150, 45, 250, 22),
                                    labelStyle);
nameField.Name = "FullName";
page.FormFields.Add(nameField);

page.AddText("Subscribe to newsletter:", new Point(50, 90), labelStyle);
var checkBox = new CheckBoxFormField(false, new Rectangle(230, 87, 16, 16));
checkBox.Name = "Newsletter";
page.FormFields.Add(checkBox);

page.AddText("Country:", new Point(50, 130), labelStyle);
var countries = new List<ListItem>
{
    new ListItem("United States", "US"),
    new ListItem("Canada", "CA"),
    new ListItem("United Kingdom", "UK"),
    new ListItem("France", "FR"),
    new ListItem("Germany", "DE")
};
var combo = new ComboBoxFormField(countries, new Rectangle(150, 125, 180, 22));
combo.Name = "Country";
page.FormFields.Add(combo);

doc.Save();

Each form field takes a Rectangle for positioning and a TextStyle for appearance. As a result, you control the exact layout. If you later load this PDF, you can read the field values back — which makes it useful for round-trip workflows where users fill out forms and your backend processes the responses.

3. Build hierarchical bookmarks and watermarks

Version 2.0 overhauled the bookmark system with a dedicated BookmarkCollection class. You can now create parent-child bookmark hierarchies, style them with bold and italic text, and even set title colors. Meanwhile, watermarks apply across the entire document with a single call:

using var doc = PdfDocument.Create("output/bookmarks.pdf");

var helvetica = doc.Fonts.GetStandardFont(StandardFontType.Helvetica);
var titleStyle = TextStyle.WithFont(helvetica, 20);

var page1 = doc.Pages[0];
page1.AddParagraph("Chapter 1: Introduction",
                   titleStyle,
                   new ParagraphStyle(ParagraphHorizontalAlignment.Left));

var page2 = doc.Pages.Add();
page2.AddParagraph("Chapter 2: Getting Started",
                   titleStyle,
                   new ParagraphStyle(ParagraphHorizontalAlignment.Left));

var page3 = doc.Pages.Add();
page3.AddParagraph("Chapter 3: Advanced Topics",
                   titleStyle,
                   new ParagraphStyle(ParagraphHorizontalAlignment.Left));

// Hierarchical bookmarks (TargetPage is a zero-based page index)
var bk1 = new Bookmark("Introduction") { TargetPage = 0, IsBold = true };
var bk2 = new Bookmark("Getting Started") { TargetPage = 1, IsBold = true };
var bk3 = new Bookmark("Advanced Topics") { TargetPage = 2, IsBold = true };

// Nest a child bookmark
var bk3Child = new Bookmark("Digital Signatures") { TargetPage = 2 };
bk3.Children.Add(bk3Child);

doc.Bookmarks.Add(bk1);
doc.Bookmarks.Add(bk2);
doc.Bookmarks.Add(bk3);

// Watermark applied to all pages
var watermarkStyle = TextStyle.WithFont(helvetica, 48)
                              .SetBrush(new SolidColorBrush(new Color(200, 200, 200)))
                              .SetRotationAngle(45);
doc.Watermarks.Add(new Watermark("DRAFT", watermarkStyle));

doc.Save();

Bookmarks and watermarks matter for any document that’s longer than a couple of pages. Specifically, bookmarks give readers a navigation panel in their PDF viewer, while watermarks communicate document status without editing the actual content.

4. Extract text and metadata from existing PDFs

Loading and reading PDFs is just as straightforward. You can pull text from each page, read form field values, access bookmark trees, and retrieve document metadata:

using var doc = PdfDocument.Load("output/hello.pdf");

for (int i = 0; i < doc.Pages.Count; i++)
{
    string? text = doc.Pages[i].Text;
    Console.WriteLine($"--- Page {i + 1} ---");
    Console.WriteLine(text?.Trim() ?? "(empty)");
}

Console.WriteLine($"Total pages: {doc.Pages.Count}");

For more targeted extraction, use GetTextFromArea with a Rectangle to pull text from a specific region of the page. Additionally, the Words collection gives you individual word objects with their bounding boxes — useful for building search indexes or analyzing document layouts.

5. Split and merge documents

Version 2.0 added flexible splitting options. You can extract a single page, a range, or split every page into its own file:

using var doc = PdfDocument.Load("output/bookmarks.pdf");

// Extract page 2 (index 1) to its own file
doc.Split(SplitByPageOptions.ToPath(1, "output/chapter2-only.pdf"));

Merging works in the other direction — combine multiple PdfDocument instances into one using MergeOptions. You can also split by bookmarks with SplitByBookmarkOptions, so a document that’s organized into chapters can automatically break apart at each chapter boundary. Therefore, batch processing workflows become simpler to build.

6. Digital signatures and certification

This is the headline feature of version 2.0. You can now sign PDF documents with PFX certificates, validate existing signatures, and certify documents to prevent further modifications. The library supports SHA-256, SHA-384, and SHA-512 digest algorithms.

Signing locks the document at that point — any subsequent modifications invalidate the signature, exactly as the PDF specification requires. For compliance-driven workflows (contracts, legal filings, medical records), this feature alone justifies upgrading from 1.0.

7. Images, hyperlinks, and drawing

Beyond text and forms, you can insert images from file paths or streams, add clickable hyperlinks to specific regions, and draw shapes on a page’s Graphics canvas. The Canvas object supports lines, rectangles, and image placement with precise coordinate control. Because the coordinate system uses points (1/72 inch), you get print-accurate positioning.

How it compares to other C# PDF libraries

The .NET PDF landscape has a lot of options. Here’s an honest comparison:

Fonctionnalité Xceed PDF Library iText 7 QuestPDF PDFsharp IronPDF
Create PDFs from code Oui Oui Oui Oui Yes (via HTML)
Load and edit existing PDFs Oui Oui No Limited Oui
Form fields (read/write) Oui Oui No No Limited
Digital signatures Yes (v2.0) Oui No No Oui
Text extraction Oui Oui No No Oui
Split and merge Oui Oui No Oui Oui
Cross-platform Oui Oui Oui Partial Oui
License Commercial ($850) AGPL or $15K+/yr MIT (<$1M) MIT $749+
NuGet package size ~940 KB ~30 MB+ ~2 MB ~4 MB ~50 MB+

iText 7 is the most feature-rich option, but its AGPL license means you must open-source your application — or pay $15,000+ per year for a commercial license. For many teams, that’s a non-starter.

QuestPDF excels at creating beautiful documents with its fluent API, and it’s free under $1M revenue. However, it can only generate new PDFs. It can’t load existing documents, read form fields, extract text, or add signatures.

PDFsharp is free and open-source, but it lacks form field support, digital signatures, and reliable cross-platform behavior. Similarly, its text extraction capabilities are minimal.

IronPDF takes an HTML-to-PDF approach with a Chromium engine, which produces pixel-perfect output but ships a ~50 MB package. In contrast, Xceed’s package is under 1 MB because it works with the PDF specification directly instead of bundling a browser engine.

Xceed’s PDF library .NET sits in the practical middle ground: it handles the full create-edit-sign-extract lifecycle at a one-time cost of $849.95. No recurring subscription, no AGPL complications. For businesses under $1M revenue, a small business license brings that down to $659.95.

When NOT to use Xceed PDF Library

Honesty matters. Here are cases where a different tool might serve you better:

  • HTML-to-PDF rendering: If your PDFs are basically styled web pages, an HTML-based engine like IronPDF or Puppeteer will be faster to develop against. Xceed works at the PDF-primitive level (text, rectangles, coordinates), not the CSS level.
  • High-fidelity document design: QuestPDF’s fluent layout API is better suited for pixel-perfect invoice or report templates where you want a declarative, component-based design.
  • Free and open-source requirement: If your project mandates an MIT/Apache license, PDFsharp or QuestPDF are your best options. Xceed is a commercial product.

Pick the tool that matches your actual requirements — not the one with the most features on paper.

Running the demo project on .NET 10

Every code snippet in this article comes from a working demo project. You can find it in the XceedPdfDemo folder alongside this article. The project targets .NET 10 and compiles with zero errors.

To run it yourself:

  • Clone the project and open it in Visual Studio 2022 or Rider
  • Insert your license key in Program.cs (get a free 45-day trial)
  • Run with dotnet run
  • Check the output/ folder for the generated PDFs

The demo covers all seven scenarios: creating documents, form fields, bookmarks with watermarks, text extraction, and document splitting.

Try Xceed PDF Library for .NET

Build, edit, sign, and extract PDFs from pure C# — on Windows, macOS, or Linux. One NuGet package, zero external dependencies.

Download Free Trial View on NuGet

What’s new in version 2.0

The March 2026 release brought significant changes to the library. Because version 2.0 removed the dependency on Xceed.Drawing.NET.dll, colors now come directly from the Xceed.PdfLibrary namespace. Furthermore, PageSettings properties became immutable — you use setter methods like SetHeight and SetWidth instead of direct assignment.

Key additions in 2.0:

  • Digital signatures and certification — sign with PFX, validate existing signatures, certify documents
  • Image insertion — add images from streams or file paths via the Canvas API
  • Hierarchical bookmarks — parent-child relationships with styling (bold, italic, color)
  • Page manipulation — insert at specific indices, reorder with Move, remove pages
  • Document splitting — split by page ranges or by bookmark structure
  • RTL text support — right-to-left text direction for Arabic and Hebrew
  • Font embedding modes — Simple for western languages (smaller files), Full for CJK support

These are breaking changes from 1.0. If you’re upgrading, review the notes de mise à jour carefully — property names like StrokeColor (now Color) and StrokeWidth (now Thickness) on Pen objects have changed.

Questions fréquemment posées

Does the Xceed PDF library .NET package work on Linux and macOS?

Yes. The PDF library .NET package targets .NET 5+ with no Windows-specific dependencies. It runs on any platform that .NET supports — Windows, macOS, and Linux. You can use it in ASP.NET Core web applications, Azure Functions, Docker containers, and any other .NET host.

Can I create PDF files in C# without Adobe Acrobat installed?

Absolutely. You can create PDF C# files by writing the PDF specification directly — no Adobe Acrobat, no Office Interop, no external processes. You just need the NuGet package and a .NET runtime. This makes it ideal for server-side generation where installing desktop software isn’t an option.

How does this C# PDF library handle digital signatures?

Version 2.0 added full digital signature support. You can sign documents using PFX certificates with SHA-256, SHA-384, or SHA-512 algorithms. The library also validates existing signatures and supports document certification, which prevents further modifications after signing. For compliance workflows, you can control which form fields remain editable after a signature.

What’s the difference between Xceed PDF Library and Xceed Words for .NET?

Words for .NET creates and edits Microsoft Word (.docx) documents. PDF Library for .NET creates and edits PDF documents. They serve different formats, but you can bundle both for $100 during the current promotional offer. If your workflow involves generating Word documents and then converting to PDF, you might want both.

Is there a free trial for the Xceed C# PDF library?

Yes. Xceed offers a free 45-day trial with full functionality. The library compiles without a license key, but you need one to create PDF C# documents at runtime. After the trial, a standard license costs $849.95 (one-time, no subscription). Small businesses under $1M revenue qualify for $659.95.

Can I extract text and form field data from existing PDFs?

Yes. Load any PDF with PdfDocument.Load, then access each page’s Text property for full-text content or GetTextFromArea for region-based extraction. Form field values are available through the FormFields collection — you can read TextBoxFormField.Text, CheckBoxFormField.IsChecked, and other typed properties. Additionally, the Words collection provides individual word objects with positional data.

PDF Library for .NET is now out! Bundle it with Words for .Net for only 100$ for a limited time at checkout