Zurück zum Ranking

QuestPDF/QuestPDF

C#questpdf.com

QuestPDF is a modern library for PDF document generation. Its fluent C# API lets you design complex layouts with clean, readable code. Create documents using a flexible, component-based approach.

pdfnugetc-sharpdotnet-corelibraryexportgenerationhtmlinvoicereport
Sterne-Wachstum
Sterne
14.1k
Forks
765
Wochenwachstum
Issues
71
5k10k
Jan. 2023März 2024Mai 2025Juli 2026
README


Modern PDF library for C# developers

QuestPDF is a production-ready library that lets you design documents the way you design software: with clean, maintainable, strong-typed C# code. Stop fighting with HTML-to-PDF conversion. Build pixel-perfect reports, invoices, and exports using the language and tools you already love.

The library is free for individuals, non-profits, open-source projects, and organizations under $1M in annual gross revenue. Read more


GitHub Stars and Stargazers
Nuget package download
QuestPDF License



Home Page   •   Quick Start   •   Invoice Tutorial   •   Features Overview   •   Pricing   •   License   •   NuGet



🚀 Quick start

Learn how easy it is to design, implement and generate PDF documents using QuestPDF.
Effortlessly create documents of all types such as invoices and reports.

using QuestPDF.Fluent;
using QuestPDF.Helpers;
using QuestPDF.Infrastructure;

// set your license here:
// QuestPDF.Settings.License = LicenseType.Evaluation;

Document.Create(container =>
{
    container.Page(page =>
    {
        page.Size(PageSizes.A4);
        page.Margin(2, Unit.Centimetre);
        page.PageColor(Colors.White);
        page.DefaultTextStyle(x => x.FontSize(20));
        
        page.Header()
            .Text("Hello PDF!")
            .SemiBold().FontSize(36).FontColor(Colors.Blue.Medium);
        
        page.Content()
            .PaddingVertical(1, Unit.Centimetre)
            .Column(x =>
            {
                x.Spacing(20);
                
                x.Item().Text(Placeholders.LoremIpsum());
                x.Item().Image(Placeholders.Image(200, 100));
            });
        
        page.Footer()
            .AlignCenter()
            .Text(x =>
            {
                x.Span("Page ");
                x.CurrentPageNumber();
            });
    });
})
.GeneratePdf("hello.pdf");

The code above produces the following PDF document:

image


Please help by giving a star ⭐

GitHub stars guide developers toward great tools. If you find this project valuable, please give it a star – it helps the community and takes just a second!



Installation

QuestPDF is available as a NuGet package. You can install it through your IDE by searching for phrase QuestPDF. If you are not familiar how to do that, please refer to the following guides:

Or use the following command in your terminal:

dotnet add package QuestPDF


Everything you need to generate PDFs

QuestPDF provides 60+ production-ready features for building complex, data-driven PDF documents with clean and maintainable C# code.


🧱 Layout:
Page setup, headers, footers, watermarks, tables, rows, columns, lists, layers, inlined content, multi-column flow, sections, decorations


🎨 Visual Content:
Rich text, fonts, colors, backgrounds, borders, rounded corners, shadows, lines, raster images, SVG, placeholders, canvas graphics


📐 Positioning:
Alignment, width, height, padding, aspect ratio, rotation, scaling, scale-to-fit, offset, flip, extend, shrink, unconstrained layout, Z-index


🌊 Content Flow:
Page breaks, prevent page breaks, ensure space, show entire, repeat, show once, skip once, conditional rendering, stop paging


🧩 Dynamic Documents:
Loops, conditions, reusable components, dynamic components, lazy loading, custom helpers, extension methods, strongly-typed models


🌍 Internationalization:
RTL layout direction, bidirectional text, advanced text shaping, font fallback, multilingual documents, accessibility support


Explore All QuestPDF Features



Familiar Programming Patterns

Use your existing programming language and patterns to ship faster with less training.

Loops, conditionals, functions are natively supported. Leverage IntelliSense, inspections, navigation, and safe refactoring.

container.Column(column =>
{
    column.Item().Text("Order Items").Bold();

    if (Model.ShowSummary)
        column.Item().Element(ComposeOrderSummary);

    foreach (var item in Model.Items)
        column.Item().Element(c => ComposeItem(c, item));
});

Review document changes like any other code. Get clean diffs, PR approvals, and traceable history.

void ComposeItem(IContainer container, OrderItem item)
{
    container
        .Border(1, Colors.Grey.Darken2)
        .Background(item.HighlightColor)
-       .Padding(12)
+       .Padding(16)
        .Row(row =>
        {
            row.RelativeItem().Text(item.Name);
            row.AutoItem().Text($"{item.Price:F2} USD");
        });
}


Companion App

Accelerate development with live document preview and hot-reload capability. See your changes instantly without recompiling.

  • 🧭 Explore PDF document hierarchy and navigate its structure
  • 🔍 Quickly magnify and measure content
  • 🐞 Debug runtime exceptions with stack traces and code snippets
  • 🛠️ Identify, understand and solve layout errors

Learn about QuestPDF Companion App Learn about QuestPDF Companion App



Enterprise-grade foundations

🧩 Dynamic Content Is Just Code
Use your existing programming language and development patterns to ship faster with less training. Loops, conditionals, functions, reusable components, and data-driven generation are supported natively.


🔀 Version Control Friendly
Review document changes like any other code. Get clean diffs, pull request approvals, traceable history, and safer collaboration across your team.


✨ Ready for AI
QuestPDF’s semantic Fluent API helps AI assistants generate layouts, refactor components, explain document structure, and troubleshoot issues more effectively.


🎯 Predictable Development
Eliminate CSS debugging, browser quirks, and layout surprises common with HTML-to-PDF tools. What you code is what you get.


👁️ Source-available
Entire QuestPDF source code is available for review and customization, ensuring transparency and compliance with your organization's requirements.


🔒 Complete Data Privacy
QuestPDF runs entirely within your infrastructure with no external API calls, internet requirement, or background data collection. As a company, we do not access, collect, store, or process your private data.


🏗️ Comprehensive Layout Engine
A powerful layout engine built specifically for PDF generation. Gain full control over document structure, precise content positioning, and automatic pagination.


🌐 Advanced Language Support
Create multilingual documents with full RTL language support, advanced text shaping, and bi-directional layout handling.


⚡ High Performance
Generate thousands of pages per second while maintaining minimal CPU and memory usage. Perfect for high-throughput enterprise applications.


📦 Optimized File Size
Drastically reduce file sizes without compromising quality. Benefit from automatic font subsetting, optimal image compression, and efficient file compression.



Perform common PDF operations

Leverage a powerful C# Fluent API to create, customize, and manage your PDF documents with ease.

  • 🔗 Merge documents
  • 📎 Attach files
  • ✂️ Extract pages
  • 🔐 Encrypt / decrypt
  • 🏷️ Extend metadata
  • 🚫 Limit access
  • ⚡ Optimize for Web
  • 📑 Overlay / underlay
DocumentOperation
    .LoadFile("input.pdf")
    .TakePages("1-10")
    .MergeFile("appendix.pdf", "1-z") // all pages
    .AddAttachment(new DocumentAttachment
    {
        FilePath = "metadata.xml"
    })
    .Encrypt(new Encryption256Bit
    {
        OwnerPassword = "mypassword",
        AllowPrinting = true,
        AllowContentExtraction = false
    })
    .Save("final-document.pdf");

Learn Document Operation API



Works everywhere you do

Deploy on any major operating system and integrate seamlessly with your favorite IDEs, cloud platforms, and development tools.

Platform Support
Operating Systems Windows, Linux, macOS
Frameworks .NET 6+ and .NET Framework 4.6.2+
Cloud Azure, AWS, Google Cloud, Others
Containers Docker, Kubernetes
IDEs Visual Studio, VS Code, JetBrains Rider, Others


Industry-standard PDF compliance

Generate PDF documents that meet the strictest archival and accessibility requirements. Every build is automatically validated using the open-source veraPDF and Mustang tools.

🗄️ PDF/A (Archival)

  • Purpose: ISO 19005 standard for long-term preservation. Ensures PDFs remain readable and visually identical for decades without external dependencies.
  • Supported Standards: PDF/A-2b, PDF/A-2u, PDF/A-2a, PDF/A-3b, PDF/A-3u, PDF/A-3a

♿ PDF/UA (Accessibility)

  • Purpose: ISO 14289 standard for universal accessibility. Includes full support for screen readers and assistive technologies for people with disabilities.
  • Supported Standards: PDF/UA-1

🧾 EN 16931 (E-Invoicing):

  • Purpose: European standard for electronic invoicing. Embeds structured invoice data (XML) within PDF documents for automated processing.
  • Supported Standards: ZUGFeRD, Factur-X


Fair and Sustainable License

A model that benefits everyone. Commercial licensing provides businesses with legal safety and long-term stability, while funding a feature-complete, unrestricted library for the open-source community.

  • Actively maintained with regular feature, quality, and security updates
  • Full source code available on GitHub
  • All features included in every tier without restrictions
  • Predictable pricing: no per-seat, per-server, or usage fees

[!TIP] Free for individuals, non-profits, open-source projects, and organizations under $1M in annual gross revenue.

QuestPDF Pricing QuestPDF License Terms



See a real-world example

Follow our detailed tutorial and see how easy it is to generate a fully functional invoice with fewer than 250 lines of C# code.

  • Step-by-step guidance
  • Production-ready code
  • Best practices included
Example Invoice

Read Real-world Invoice Tutorial



Community QuestPDF

We are incredibly grateful to our .NET Community for their positive reviews and recommendations of the QuestPDF library. Your support and feedback are invaluable and motivate us to keep improving and expanding this project. Thank you for helping us grow and reach more developers!

Nick Chapsas: The Easiest Way to Create PDFs in .NET

Nick Chapsas The Easiest Way to Create PDFs in .NET

JetBrains: OSS Power-Ups: QuestPDF

JetBrains OSS Power-Ups: QuestPDF

Ähnliche Repositories
microsoft/markitdown

Python tool for converting files and office documents to Markdown.

PythonPyPIMIT Licenselangchainopenai
168k12.1k
justjavac/free-programming-books-zh_CN

:books: 免费的计算机编程类中文书籍,欢迎投稿

GNU General Public License v3.0pythonjavascript
weibo.com/justjavac
117.7k28.2k
Stirling-Tools/Stirling-PDF

#1 PDF Application on GitHub that lets you edit PDFs on any device anywhere

JavaMavenOtherdockerjava
stirling.com
87.7k7.8k
opendatalab/MinerU

Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.

PythonPyPIOtherextract-datalayout-analysis
opendatalab.github.io/MinerU/
75.4k6.3k
docling-project/docling

Get your documents ready for gen AI

PythonPyPIMIT Licenseaiconvert
docling-project.github.io/docling
63.6k4.5k
siyuan-note/siyuan

A privacy-first, self-hosted, fully open source personal knowledge management software, written in typescript and golang.

TypeScriptnpmGNU Affero General Public License v3.0note-takinglocal-first
b3log.org/siyuan
45.3k2.9k
paperless-ngx/paperless-ngx

A community-supported supercharged document management system: scan, index and archive all your documents

PythonPyPIGNU General Public License v3.0angulararchiving
docs.paperless-ngx.com
43.3k2.9k
PDFMathTranslate/PDFMathTranslate

[EMNLP 2025 Demo] PDF scientific paper translation with preserved formats - 基于 AI 完整保留排版的 PDF 文档全文双语翻译,支持 Google/DeepL/Ollama/OpenAI 等服务,提供 CLI/GUI/MCP/Docker/Zotero

PythonPyPIGNU Affero General Public License v3.0chineselatex
pdf2zh.com
35.7k3.2k
ocrmypdf/OCRmyPDF

OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched

PythonPyPIMozilla Public License 2.0pythonocr
ocrmypdf.readthedocs.io
34.2k2.4k
hehonghui/awesome-english-ebooks

经济学人(含音频)、纽约客、卫报、连线、大西洋月刊等英语杂志免费下载,支持epub、mobi、pdf格式, 每周更新

CSSnpmdownloadebooks
33.9k2.8k
posquit0/Awesome-CV

:page_facing_up: Awesome CV is LaTeX template for your outstanding job application

TeXLaTeX Project Public License v1.3ctexoverleaf
28.1k5.3k
koreader/koreader

An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices

LuaGNU Affero General Public License v3.0luajitkobo
koreader.rocks
27.9k1.8k