QuestPDF: Modern C# Library for Fluent PDF Document Generation

This repository profile is provided by osrepos.com, an open source repository discovery platform.

QuestPDF: Modern C# Library for Fluent PDF Document Generation

Summary

QuestPDF is a modern C# library for generating PDF documents with a fluent and readable API. It enables developers to design complex layouts using a flexible, component-based approach, avoiding common HTML-to-PDF conversion issues. Ideal for reports, invoices, and exports, QuestPDF offers extensive features and enterprise-grade foundations.

Repository Information

Analyzed by OSRepos on June 19, 2026

Topics

Click on any tag to explore related repositories

Use at your own risk

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.

Introduction

QuestPDF is a powerful and modern C# library that simplifies the process of generating PDF documents. Designed with a fluent API, it allows developers to create complex layouts and pixel-perfect reports, invoices, and exports using clean, maintainable C# code. This approach eliminates the common challenges associated with HTML-to-PDF conversions, providing a robust and predictable way to build documents. With over 14,000 stars on GitHub, QuestPDF is a highly regarded solution in the .NET ecosystem.

Explore the project on GitHub.

Installation

Getting started with QuestPDF is straightforward, as it's available as a NuGet package. You can install it using your preferred IDE or via the .NET CLI.

To install using the .NET CLI, run the following command in your terminal:

dotnet add package QuestPDF

For detailed installation guides for Visual Studio, VS Code, or JetBrains Rider, please refer to the official documentation.

Examples

QuestPDF's fluent API makes document design intuitive. Here's a quick example demonstrating how to create a basic PDF document:

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

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

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");

This code snippet generates a simple PDF document with a header, content, and footer. For a more in-depth guide, check out the Quick Start tutorial.

Why Use QuestPDF?

QuestPDF offers a compelling solution for PDF generation due to its comprehensive feature set and developer-friendly approach:

  • Fluent C# API: Design documents using familiar C# patterns, leveraging IntelliSense and robust refactoring capabilities.
  • Rich Layout and Styling: Access a wide array of visual elements, layout controls (tables, lists, columns), and positional adjustments to create any document complexity.
  • Enterprise-Grade Foundations: Benefit from predictable development, source-available code, complete data privacy, high performance, and optimized file sizes.
  • Advanced PDF Operations: Easily merge documents, attach files, extract pages, encrypt/decrypt, and extend metadata using a powerful Fluent API.
  • Cross-Platform Compatibility: Deploy your applications on Windows, Linux, macOS, and integrate seamlessly with .NET 6+, .NET Framework 4.6.2+, and various cloud platforms and containers.
  • Industry-Standard Compliance: Generate PDFs that meet strict archival (PDF/A) and accessibility (PDF/UA) requirements, validated using open-source tools.
  • Sustainable Licensing: A fair model that offers a free tier for individuals, non-profits, and FOSS projects, alongside commercial options for businesses.
  • Companion App: Accelerate development with a live document preview and hot-reload capability, aiding in debugging and layout adjustments.

QuestPDF is built to provide full control over document structure and precise content positioning, making it a reliable choice for any PDF generation need.

Links

Related repositories

Similar repositories that may be relevant next.

Source repository

Open the original repository on GitHub.

View on GitHub
OS
OSRepos

Analysis and discovery of open source repositories. Find interesting projects and follow their updates.

Monitor your website with YourWebsiteScore

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of third-party repository code is at your own risk. Always review source code, dependencies, licenses, and security implications before running anything.

© 2025 OSRepos. Built with Nuxt 3 and lots of ❤️