Top C# and .NET PDF Generation Libraries Compared

The .NET ecosystem offers a rich variety of libraries for PDF generation. From creating documents from scratch to converting HTML to PDF or generating reports with complex layouts, C# developers have several proven options to pick from. This article covers the most popular PDF libraries available for C# and .NET, with download statistics, key features, installation guides, and practical code examples to help you choose the right tool for your project.
PDFBolt's HTML to PDF API wraps the same Chrome engine behind a REST endpoint – call it with any .NET HTTP client like HttpClient or RestSharp in a few lines. No license fees, no NuGet packages with native binary dependencies, no version drift across .NET releases. 100 free conversions per month, no credit card required.
Most Popular C# PDF Generation Libraries: NuGet Download Statistics
Here's a comparison of NuGet download statistics for the PDF generation libraries available on NuGet. These numbers reflect the community's trust and adoption, giving insight into which libraries developers prefer for PDF creation and HTML to PDF conversion in C# applications:
| Library | Total Downloads | Per Day Average |
|---|---|---|
| PDFsharp | 34.9M | 7.0K |
| iText7 | 30.3M | 9.7K |
| Microsoft.Playwright | 25.6M | 17.7K |
| PuppeteerSharp | 18.5M | 6.7K |
| DinkToPdf | 16.8M | 5.7K |
| QuestPDF | 9.7M | 5.9K |
Download Trends for C# PDF Libraries
Below are charts illustrating the download trends for the C# PDF generation libraries. These visualizations help identify the most popular libraries along with emerging trends and momentum shifts in the .NET ecosystem.
Long-Term Popularity Trends of C# PDF Libraries – Last 10 Years
The following chart shows the download trends for C# PDF libraries over the past decade, sourced from NuGet Trends:

This long-term view reveals key shifts in library adoption patterns:
-
Microsoft.Playwright – rapid rise since 2021, accumulating ~25M downloads.
-
iText7 – consistent growth since 2018, reaching ~30M downloads by 2025.
-
PDFsharp – early adoption with apparent tracking issues in the visualization after 2019, despite its continued popularity (actual total: 34.9M downloads).
-
PuppeteerSharp and DinkToPdf following similar trajectories since 2020-2021.
-
QuestPDF showing strong momentum despite being the newest library.
Overall acceleration in PDF library adoption from 2021 onward, reflecting increased demand for document generation in modern .NET applications.
Usage Trends of C# PDF Libraries – Last 12 Months
For a closer look at current momentum, the chart below displays download trends over the past year:

The 12-month chart reveals consistent growth across all tracked C# PDF libraries. iText maintains the top position while Microsoft.Playwright shows the steepest growth curve. PuppeteerSharp and DinkToPdf follow similar moderate growth patterns, and QuestPDF demonstrates steady adoption despite being newer. This recent data highlights Microsoft.Playwright's accelerating momentum, suggesting increasing developer preference for browser-based PDF generation solutions in the .NET ecosystem.
Detailed Review of Top C# PDF Generation Libraries
PDFsharp

PDFsharp is an open-source library for creating and processing PDF documents entirely with C# code. It provides a full-featured API for programmatic PDF generation from scratch with precise control over layout and content.
➡️ Key Features:
- Full control over page layout and content positioning.
- Text, vector graphics, and image support.
- Document manipulation (merging, splitting).
- Low-level PDF structure access.
- Compatible with .NET Framework and .NET Core/.NET 5+.
➡️ Key Constraints:
- No HTML to PDF conversion capability.
- Requires manual positioning of all elements.
- Steeper learning curve for complex layouts.
➡️ Installation:
dotnet add package PDFsharp
➡️ Basic Document Creation:
- Code
- PDF Preview
using PdfSharp.Pdf;
using PdfSharp.Drawing;
// Create a new PDF document
PdfDocument document = new PdfDocument();
document.Info.Title = "PDFsharp Example";
document.Info.Author = "Your Name";
// Create a new page
PdfPage page = document.AddPage();
// Get an XGraphics object for drawing on the page
XGraphics gfx = XGraphics.FromPdfPage(page);
// Create fonts for our text
XFont titleFont = new XFont("Arial", 28, XFontStyleEx.Bold);
XFont normalFont = new XFont("Arial", 22, XFontStyleEx.Regular);
// Draw text on the page
gfx.DrawString("PDF Generated with PDFsharp", titleFont, XBrushes.Blue,
new XPoint(50, 50), XStringFormats.TopLeft);
gfx.DrawString("• Why do C# developers never get lost?", normalFont, XBrushes.DarkBlue,
new XPoint(50, 100), XStringFormats.TopLeft);
gfx.DrawString("• Because they always follow the C# path!", normalFont, XBrushes.Black,
new XPoint(50, 140), XStringFormats.TopLeft);
// Save the document
const string filename = "PDFsharpExample.pdf";
document.Save(filename);
Console.WriteLine($"PDF created successfully: {filename}");

For a full guide on using PDFsharp, check our detailed tutorial: How to Generate PDF in C#/.NET with PDFsharp.
iText 7

iText 7 is a mature PDF library for .NET that enables full document processing with an intuitive object-oriented architecture. As the modern successor to iTextSharp, it provides enhanced capabilities for creating, manipulating, and processing PDF documents programmatically. It also offers HTML to PDF conversion through its pdfHTML add-on, allowing developers to convert web content into PDF documents.
➡️ Key Features:
- High-performance PDF generation.
- Advanced text and layout capabilities.
- HTML to PDF conversion.
- Digital signatures and encryption.
- PDF/A compliance for archiving.
- Form filling and creation.
➡️ Key Constraints:
- Commercial licensing required for commercial business applications.
- HTML to PDF requires additional pdfHTML add-on.
- More complex API compared to newer alternatives.
➡️ Installation:
dotnet add package itext7
For HTML to PDF conversion, add the pdfHTML add-on:
dotnet add package itext7.pdfhtml
➡️ HTML to PDF Conversion Example:
- Code
- PDF Preview
using iText.Html2pdf;
using iText.Kernel.Geom;
using iText.Kernel.Pdf;
class Program
{
// Main entry point of the program
static void Main()
{
ConvertHtmlToPdf();
Console.WriteLine("PDF has been generated successfully.");
}
// Method to convert HTML to PDF
static void ConvertHtmlToPdf()
{
// Define HTML content
string htmlContent = @"
<!DOCTYPE html>
<html>
<head>
<title>iText 7 HTML to PDF</title>
<style>
body { font-family: Arial, sans-serif; text-align: center; }
h1 { color: darkorange; }
p { margin: 20px 0; font-size: 26px; }
</style>
</head>
<body>
<h1>PDF Generated with iText 7</h1>
<p>Why was the C# developer always calm?</p>
<p><strong>Because they had a good `Try` and always `Catch` themselves.</strong></p>
</body>
</html>";
// Create output file stream
using (FileStream pdfDest = new FileStream("itext7-document.pdf", FileMode.Create))
{
// Initialize PDF document
PdfWriter writer = new PdfWriter(pdfDest);
PdfDocument pdf = new PdfDocument(writer);
pdf.SetDefaultPageSize(PageSize.A4);
// Convert HTML to PDF
ConverterProperties converterProperties = new ConverterProperties();
HtmlConverter.ConvertToPdf(htmlContent, pdf, converterProperties);
}
}
}

Explore our detailed guide: HTML to PDF in C#/.NET with iText 7.
Playwright for .NET

Playwright for .NET is Microsoft's browser automation library that provides a unified API to control Chromium, Firefox, and WebKit browsers. Originally developed for Node.js and later ported to the .NET ecosystem, it gives C# developers a reliable tool for browser automation and PDF generation. Playwright converts dynamic web pages into high-fidelity PDFs with excellent support for modern CSS and JavaScript, which works well for capturing interactive content.
