Skip to content

Code-first PDF library for C#

Generate documents confidently with reviewable code, hot-reload preview and your favorite AI coding agents.

Invoice.cs
1static readonly Color Accent = Colors.Grey.Darken4;23void ComposePage(PageDescriptor page)4{5    page.Size(PageSizes.A4);6    page.Margin(50);7    page.DefaultTextStyle(x => x.FontSize(10));89    page.Header().Element(ComposeHeader);10    page.Content().Element(ComposeContent);11    page.Footer().Element(ComposeFooter);12}1314void ComposeHeader(IContainer container){ … }4849void ComposeContent(IContainer container){ … }6061void ComposeAddresses(IContainer container){ … }8788void ComposeItems(IContainer container){ … }130131void ComposeTotals(IContainer container){ … }160161void ComposeFooter(IContainer container){ … }
Ask the agent to change the invoice…
Invoice.pdf
Invoice.pdf rendered by QuestPDF

Create and review in C#

  • Write loops and conditions in C#, not templates
  • Build reusable components with classes and methods
  • Use IntelliSense, type checking and refactoring in IDE
  • Track changes and easily review in version-control

Develop with AI agents

  • Easily migrate legacy HTML reports to QuestPDF
  • Create and edit documents confidently with prompts
  • Ship new documents and changes much faster
  • Keep AI changes type-checked and reviewable

Companion App

Make a change, see the result. Hot-⁠reload keeps the preview in sync, so every tweak is quick and effortless.

  • Explore the document structure
  • Inspect any element
  • Magnify and measure details
  • Jump from preview to code
  • Debug exceptions and layouts
Get started
QuestPDF Companion AppQuestPDF Companion App

Validated, standards-compliant output

Every release is tested against veraPDF and Mustang, the independent, open-source, industry-standard validators.

  • PDF/A for long-term document archiving and reliable visual preservation

  • PDF/UA for universal accessibility, screen readers, and assistive tech

  • Factur-X / ZUGFeRD for e‑invoicing readable by humans and machines

Runs entirely inside your application

Document generation happens locally, in your own process. No network calls, no telemetry, no license server. Works air-gapped.

  • Runtime.NET 6+,.NET Framework 4.6.2+,Native AOT
  • Operating systemWindows,Linux,Alpine,macOS
  • HostingDocker,Kubernetes,Azure,AWS,Google Cloud

Pure speed, without a web browser

  • No HTML, CSS or JS engines involved in generation
  • Significantly smaller resource usage and better security
  • Layout engine built for documents, not web pages

135+ document features

Precise typography, flexible layouts, rich visual content and fine control over every page. Everything you need to build professional documents.

Explore features

Licensing and Pricing

Free license

  • For individuals and organisations under $1M annual revenue
  • For open-source projects, charities and academia
  • All features, commercial use included
  • No registration, license keys or watermarks