# QuestPDF: Modern C# Library for Fluent PDF Document Generation

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

Source: osrepos.com
Repository profile: https://osrepos.com/repo/questpdf-questpdf
Generated for open source discovery and AI-assisted research.

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.

GitHub: https://github.com/QuestPDF/QuestPDF
OSRepos URL: https://osrepos.com/repo/questpdf-questpdf

## 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.

## Topics

- c-sharp
- pdf-generation
- dotnet
- library
- reporting
- invoice
- document-automation
- nuget

## Repository Information

Last analyzed by OSRepos: Fri Jun 19 2026 09:18:04 GMT+0100 (Western European Summer Time)
Detail views: 2
GitHub clicks: 0

## Safety Notice

OSRepos shares public repositories for knowledge and discovery only. Review source code, dependencies, licenses, and security implications before running or installing anything.

## Content

## 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](https://github.com/QuestPDF/QuestPDF "QuestPDF GitHub Repository" target="_blank").

## 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:

bash
dotnet add package QuestPDF


For detailed installation guides for Visual Studio, VS Code, or JetBrains Rider, please refer to the [official documentation](https://www.questpdf.com/quick-start.html "QuestPDF Quick Start Guide" target="_blank").

## Examples

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

csharp
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](https://www.questpdf.com/quick-start.html "QuestPDF Quick Start Tutorial" target="_blank").

## 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

*   [Official Website](https://www.questpdf.com "QuestPDF Official Website" target="_blank")
*   [GitHub Repository](https://github.com/QuestPDF/QuestPDF "QuestPDF GitHub Repository" target="_blank")
*   [Quick Start Guide](https://www.questpdf.com/quick-start.html "QuestPDF Quick Start Guide" target="_blank")
*   [Features Overview](https://www.questpdf.com/features-overview.html "QuestPDF Features Overview" target="_blank")
*   [Invoice Tutorial](https://www.questpdf.com/invoice-tutorial.html "QuestPDF Invoice Tutorial" target="_blank")
*   [NuGet Package](https://www.nuget.org/packages/QuestPDF "QuestPDF NuGet Package" target="_blank")
*   [Licensing Information](https://www.questpdf.com/license/ "QuestPDF Licensing Information" target="_blank")