TerraFluent.Pdf.Reporting 2.0.3

Prefix Reserved
dotnet add package TerraFluent.Pdf.Reporting --version 2.0.3
                    
NuGet\Install-Package TerraFluent.Pdf.Reporting -Version 2.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TerraFluent.Pdf.Reporting" Version="2.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TerraFluent.Pdf.Reporting" Version="2.0.3" />
                    
Directory.Packages.props
<PackageReference Include="TerraFluent.Pdf.Reporting" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TerraFluent.Pdf.Reporting --version 2.0.3
                    
#r "nuget: TerraFluent.Pdf.Reporting, 2.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TerraFluent.Pdf.Reporting@2.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TerraFluent.Pdf.Reporting&version=2.0.3
                    
Install as a Cake Addin
#tool nuget:?package=TerraFluent.Pdf.Reporting&version=2.0.3
                    
Install as a Cake Tool

TerraFluent.Pdf.Reporting — Free C# PDF Library for .NET

A free, open-source (MIT) C# PDF library for creating PDF documents in .NET — generate invoices, reports, receipts, statements, labels, and certificates from C# code with a fluent API. 100% managed C#, zero dependencies, and free for personal and commercial use: no watermarks, no page limits, no paid tiers.

TerraFluent.Pdf.Reporting

NuGet License: MIT CI NuGet downloads

📚 To know more about it and documentation and sample codes. Please visit its website

🌐 https://terrafluent.dev/

TerraFluent.Pdf.Reporting is a lightweight, zero-dependency, pure C# library for generating professional PDF 1.7 documents programmatically. It provides a fluent, composable API that covers the full document-authoring lifecycle — from page layout and rich text to tables, images, hyperlinks, and multi-page pagination — with no native binaries, no third-party runtime packages, and no licensing restrictions.


Why TerraFluent.Pdf.Reporting?

  • Truly free — MIT licensed, free for commercial use. No royalties, no watermarks, no page limits, no "community edition" restrictions, no revenue caps.
  • Pure C#, zero dependencies — no native binaries (no libgdiplus, no Chromium, no wkhtmltopdf), no third-party NuGet packages. The entire PDF writer is managed code.
  • Cross-platform — runs anywhere .NET runs: Windows, Linux, macOS, Docker containers, Azure Functions, AWS Lambda, ASP.NET Core web apps, console apps, and background services.
  • Modern .NET — targets .NET 8 (LTS), .NET 9, and .NET 10 (LTS).
  • Code-first, not HTML-to-PDF — documents are composed from typed C# layout primitives (Column, Row, Table), so output is deterministic and fast — no browser engine to install or babysit.
  • Batteries included — text styling, tables, images, hyperlinks, bookmarks, table of contents, headers/footers, page numbers, vector graphics, Code128 barcodes, QR codes, and AES-256 encryption.

Common use cases

  • Generate invoice PDFs in C# / ASP.NET Core
  • Export reports and statements to PDF from .NET applications
  • Create receipts, delivery notes, and order confirmations
  • Print shipping labels with Code128 barcodes and QR codes
  • Produce certificates, letters, and contracts from templates
  • Server-side PDF generation in Docker, Azure, and AWS — no native dependencies to install

Features

  • No native dependencies, no third-party packages
  • Targets .NET 8, .NET 9 and .NET 10
  • Text styling — bold, italic, bold-italic, strikethrough, underline, font size, colour
  • Three built-in font families — Helvetica, Times, Courier — via FontFamily(), no embedding needed
  • Configurable line-height multiplier per text block
  • Per-span formatting inside mixed-style text blocks
  • Margin and padding decorators with full unit support
  • Background fills and borders (full, rounded, and per-edge)
  • Rounded-corner borders and filled rounded boxes
  • Per-edge borders — BorderTop, BorderBottom, BorderLeft, BorderRight
  • Horizontal and vertical alignment
  • Column, Row, and Table layouts
  • PNG and JPEG image embedding
  • Horizontal and vertical rule lines
  • Explicit page breaks via PageBreak()
  • Clickable hyperlink (URI) annotations via Hyperlink()
  • Internal document links (GoTo) via InternalLink()
  • Automatic Table of Contents generation from H1–H6 headings
  • PDF bookmarks / outlines with hierarchical nesting
  • Document metadata (Title, Author, Subject, Keywords, Creator)
  • Conditional rendering via ShowIf
  • Reusable components via IComponent
  • Headers, footers, and page numbers
  • AES-256 PDF encryption by default — user password, owner password, and fine-grained permission flags (PdfPermissions) via container.Encrypt(); AES-128 remains available for compatibility
  • Images from bytes and streamsImage(byte[]) / Image(Stream) with transparency and deduplication
  • Anchor-based bookmarks — bookmark content directly to rendered elements and keep destinations accurate
  • Full WinAnsiEncoding character coverage
  • Vector graphics canvas — lines, rectangles, rounded rectangles, circles, ellipses, arbitrary Bézier paths, polygons, and grid helpers via container.Canvas()
  • Code128 barcodescontainer.Barcode(...), with optional human-readable caption, custom colours, and quiet zone
  • QR codescontainer.QrCode(...), full ISO/IEC 18004 generator (versions 1-40, error correction levels L/M/Q/H), rendered as vector rectangles
  • Fluent, composable API

Installation

dotnet add package TerraFluent.Pdf.Reporting

Migrating from TerraPDF

TerraFluent.Pdf.Reporting 2.x is the direct continuation of TerraPDF 1.x. To upgrade:

  1. Replace the TerraPDF package reference with TerraFluent.Pdf.Reporting.
  2. Update using TerraPDF.* directives to using TerraFluent.Pdf.Reporting.*.
  3. Replace Document.Create(...) with PdfDocument.Create(...).

No other API or behaviour changes are required — see the CHANGELOG for details.


Quick Start

using TerraFluent.Pdf.Reporting.Core;
using TerraFluent.Pdf.Reporting.Helpers;

PdfDocument.Create(container =>
{
    container.Page(page =>
    {
        page.Size(PageSize.A4);
        page.Margin(2, Unit.Centimetre);
        page.PageColor(Color.White);
        page.DefaultTextStyle(s => s.FontSize(11));

        page.Header()
            .Text("My Report")
            .Bold()
            .FontSize(24)
            .FontColor(Color.Blue.Darken2);

        page.Content()
            .Column(col =>
            {
                col.Spacing(8);
                col.Item().Text("Hello, TerraFluent.Pdf.Reporting!");
                col.Item().Text("This paragraph is italic.").Italic();
                col.Item()
                   .Margin(6).Background(Color.Grey.Lighten4).Padding(10)
                   .Text("Indented callout box").Bold();
            });

        page.Footer()
            .AlignCenter()
            .Text(t =>
            {
                t.Span("Page ");
                t.CurrentPageNumber().FontSize(9);
                t.Span(" / ");
                t.TotalPages().FontSize(9);
            });
    });
})
.PublishPdf("output.pdf");

Full Documentation

For complete API reference and detailed guides, visit the docs directory:


FAQ

Is TerraFluent.Pdf.Reporting really free for commercial use? Yes. TerraFluent.Pdf.Reporting is released under the MIT license — you can use it in closed-source and commercial products at no cost, with no revenue caps, royalties, watermarks, or feature-limited tiers.

How does TerraFluent.Pdf.Reporting compare to iTextSharp, QuestPDF, or PDFsharp? iText (iTextSharp) is AGPL-licensed, which requires a commercial license for most closed-source use. QuestPDF's Community license is free only below a company-revenue threshold. PDFsharp is MIT like TerraFluent.Pdf.Reporting, but uses an imperative drawing model. TerraFluent.Pdf.Reporting offers a fluent, composable, code-first API under a plain MIT license with zero runtime dependencies.

Does TerraFluent.Pdf.Reporting convert HTML to PDF? No. TerraFluent.Pdf.Reporting is a code-first PDF generator: you compose documents from C# layout primitives (Column, Row, Table, Text, Image). That means no headless browser, deterministic output, and much faster rendering — but if your source content is HTML, an HTML-to-PDF converter is a better fit.

Does it run on Linux, macOS, and in Docker? Yes. TerraFluent.Pdf.Reporting is 100% managed C# with no native binaries, so it runs on any platform supported by .NET 8/9/10 — including Alpine-based Docker images, Azure Functions, and AWS Lambda — with nothing extra to install.

Can it create password-protected PDFs? Yes. Documents can be encrypted with AES-256 (default) or AES-128, with user/owner passwords and fine-grained permission flags (printing, copying, editing, etc.).


Building from Source

git clone https://github.com/sahebansari/TerraFluent.Pdf.Reporting.git
cd TerraFluent.Pdf.Reporting
dotnet build
dotnet test

Requires the .NET 10 SDK (builds all targets), plus the .NET 8 and .NET 9 runtimes to execute the full multi-framework test suite.


Contributing

Contributions are welcome! Please read CONTRIBUTING.md for coding standards, project structure, how to run tests, and the pull-request process.


Changelog

All notable changes are documented in CHANGELOG.md, following the Keep a Changelog format.


Security

To report a vulnerability, please follow the responsible-disclosure process described in SECURITY.md. Do not open a public issue for security problems.


License

MIT — see LICENSE for details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.3 23 7/26/2026
2.0.2 115 7/13/2026