MIT Free for personal and commercial use. No licensing fees for private or commercial .NET apps. License

Get TerraPDF

Free, open-source, and ready to use. Add a pure C# PDF generator to your .NET project in seconds.

đŸ“Ļ Install via NuGet

The easiest way to get the TerraPDF .NET PDF library is through NuGet.

dotnet add package TerraPDF
View on NuGet.org v2.4.0 Download

Package Information

Package IDTerraPDF
Latest Version2.4.0 (September 27, 2026)
DownloadsView on NuGet
Target Frameworks.NET 8, .NET 9, .NET 10
DependenciesNone — zero dependencies
LicenseMIT

🔗 Quick Links

GitHub Repository

Source code, issues, pull requests, and community discussions.

github.com/sahebansari/TerraPDF →

Documentation

Complete guides, API reference, and examples.

Browse docs →

Releases

Download release binaries and check release notes.

View releases →

Report Issues

Found a bug? Have a feature request? Let us know.

Open an issue →

🔨 Build from Source

Prefer to build from source? Clone and compile TerraPDF yourself:

Terminal
git clone https://github.com/sahebansari/TerraPDF.git
cd TerraPDF
dotnet build
dotnet test

Requirements

  • .NET 10 SDK (the repository's global.json requires it for building from source)
  • Git for cloning the repository
  • No other dependencies — TerraPDF is pure C#
CI/CD: TerraPDF uses GitHub Actions for continuous integration and automated NuGet publishing on release tags.

📋 Version History

See what's new in each release:

v2.3.0 - September 26, 2026

  • Gradient fills: PathDescriptor.FillLinearGradient (any angle) and FillRadialGradient paint a two-stop PDF shading clipped to the path, and still combine with an outline, even-odd fill, opacity, and dashes.
  • Dashes on every stroke: dash patterns and phases on ellipses, rounded rectangles, and pie sectors, plus PathDescriptor.Dash(...) for any path, and a new PathDescriptor.RoundedRect(...) subpath.
  • Canvas links, bookmarks, and QR codes: Link, InternalLink, Bookmark, and QrCode place clickable areas, outline entries, and vector QR codes at absolute canvas positions.
  • Fixes: VectorCanvas.Grid() now fills the canvas (it drew nothing before), and ShowIf(false) now hides the content chained after it.
  • New Canvas Extras sample, and new sections in the Vector Graphics and Bookmarks guides.

v2.2.0 - September 20, 2026

  • Positioned images on the vector canvas — canvas.Image(...) places a PNG or JPEG in an absolute rectangle from a file path, byte[], or Stream, with Stretch, Contain, Cover, CoverTopLeft, and CropTopLeft fit modes. Clipping is scoped, so later canvas commands are unaffected.
  • Elliptical arcs and pie sectors — PathDescriptor.Arc and Sector take a centre and radii; FillPie, StrokePie, and DrawPie take a bounding box. Angles start at 3 o'clock and increase clockwise.
  • Dashed strokes and rotated text — dash patterns and phases on canvas lines and stroked rectangles, and an angle parameter that rotates a text label clockwise around its baseline point.
  • Fixes — 8-bit grayscale-with-alpha PNGs decode correctly, non-finite arc angles are rejected instead of subdividing forever, and rotated text keeps full-precision matrix coefficients so small angles render exactly.
  • New Canvas Media sample, plus expanded Vector Graphics and Images guides.

v2.1.0 - September 3, 2026

  • Automatic font subsetting — FontFamily.Register(...) now embeds only the glyphs a document actually shows instead of the whole font file, with a composite-glyph closure pass so accented Latin letters and Devanagari conjuncts never lose a component glyph. Measured wins: a mixed Latin/Cyrillic/Greek sample dropped 55%, a two-variant Devanagari report dropped 49%.
  • Constant alpha (/ExtGState) — every VectorCanvas fill/stroke primitive takes a trailing opacity parameter, with a matching PathDescriptor.Opacity(...) setter. Distinct opacity values are deduplicated into shared resources, same as repeated images and fonts.
  • VectorCanvas.Text(text, x, y, ...) — baseline-anchored text on the vector canvas, rendered through a registered custom font or the standard-14 families, plus a MeasureTextWidth(...) helper for centering and right-aligning labels.
  • No public API removed or changed — existing calls keep behaving exactly as before.
  • New Font Subsetting sample, an updated Vector Graphics sample with a rebuilt donut-chart legend, and an expanded Custom Fonts guide.

v2.0.1 - August 28, 2026

  • Table column and row spans — Cell(columnSpan:) no longer overlaps the cell that follows it, Cell(rowSpan:) reserves its columns in the rows below, and a spanned cell is measured so the rows it covers grow to hold its content.
  • Table pagination — a table with no HeaderRow now splits across pages, a table placed straight into page.Content() now paginates, and a page break is never allowed to fall inside a row span.
  • No public API change — documents that don't use spans and don't overflow a page are byte-for-byte identical to 2.0.0.
  • New Table Spans & Pagination sample and an expanded Layout guide.

v2.0.0 - July 23, 2026

  • Custom font embedding — FontFamily.Register(...) embeds a TrueType font (regular/bold/italic/bold-italic) as a Type0/CIDFontType2 composite font with Identity-H encoding, unlocking full Unicode text beyond the standard fonts' WinAnsiEncoding range — brand typefaces, Cyrillic, Greek, and more.
  • Devanagari-aware rendering (pure C#, no native dependency) — automatic matra reordering, conjunct ligatures (⤏āĨā¤ĩ, ⤕āĨā¤ˇ, ⤜āĨā¤ž), reph (⤧⤰āĨā¤Ž, ā¤ĩ⤰āĨā¤¤ā¤Žā¤žā¤¨), and below/post-base 'ra' forms (⤕āĨā¤°, ⤤āĨā¤°, ā¤ĒāĨā¤°, ⤎āĨā¤ŸāĨā¤°) whenever text is drawn through a registered font.
  • Word-wrap fix — a single word/token wider than the line now breaks at character boundaries instead of overflowing.
  • New docs/custom-fonts.md guide and a new Hindi-language report sample.

v1.5.1 - July 10, 2026

  • .NET 10 target — the library now multi-targets net8.0, net9.0, and net10.0 (the current LTS). No API or behaviour changes; existing .NET 8/9 consumers are unaffected.
  • Test suite now runs once per supported runtime; CI consolidated into a single workflow with the .NET 8/9/10 SDKs.

v1.5.0 - July 9, 2026

  • Code128 (Subset B) barcodes via container.Barcode(data, ...), with optional caption, custom colour, and a configurable quiet zone.
  • ISO/IEC 18004 QR codes via container.QrCode(data, ...) — from-scratch generator with automatic version selection (1-40), all four error correction levels, and Reed-Solomon error correction.
  • Both render as vector-filled rectangles — crisp at any zoom, placeable inside any Column, Row, or Table cell.
  • New PdfPage.AddFilledRects batch primitive for efficient rendering of symbols with thousands of modules.

v1.4.0 - July 4, 2026

  • AES-256 PDF encryption by default (Revision 6, PDF 2.0), with AES-128 available as a legacy opt-in via EncryptionOptions.Algorithm.
  • Images from byte[] and Stream sources, with format auto-detection, PNG transparency, and deduplication.
  • Anchor-based bookmarks (container.Bookmark("Title")) with corrected, zoom-retaining /XYZ destinations.
  • Paragraphs now split across pages instead of overflowing; decorators repeat correctly on every page.
  • FontFamily() now actually selects Helvetica, Times, or Courier; multi-span Span() callback changed to Func<TextStyle, TextStyle>.
  • Flate-compressed, streamed serialization for smaller files and lower peak memory.

v1.3.0 - May 19, 2026

  • AES-128 PDF encryption using the PDF Standard Security Handler.
  • User and owner passwords for open access and full-access recovery.
  • PdfPermissions flags for print, copy, edit, forms, accessibility, assembly, and low-resolution printing.
  • Encrypted content streams and image XObjects with reliability fixes for trailer IDs, stream filters, and AES padding.

v1.2.3 - Recent graphics and encoding update

  • Vector Graphics Canvas API for lines, rectangles, rounded rectangles, circles, ellipses, paths, polygons, grids, and charts.
  • WinAnsiEncoding documentation and showcase sample covering Windows-1252 specials and Latin-1 characters.
  • Improved sample output for vector graphics and Unicode character coverage.

v1.2.2 — May 4, 2026

  • ✓ Table of Contents generation with clickable internal links
  • ✓ Internal links (GoTo) with zoom preservation
  • ✓ Section headings H1-H6 with default styles
  • ✓ Fixed TOC page numbering and heading recorder propagation

v1.2.1 — May 3, 2026

  • ✓ Documentation corrections and API updates
  • ✓ Fixed color values and added missing shades
  • ✓ Improved API method documentation

v1.2.0 — July 14, 2025

  • ✓ Underline styling
  • ✓ Configurable line-height multiplier
  • ✓ Rounded borders and filled rounded boxes
  • ✓ Per-edge borders
  • ✓ Explicit page breaks
  • ✓ Hyperlink URI annotations
  • ✓ Fixed per-span style isolation

View full changelog →

📄 License

TerraPDF is released under the MIT License — a permissive open-source license that allows:

  • Commercial use
  • Modification and distribution
  • Private use
  • No warranty (as-is)

Read the full license →

Ready to start building?

Add TerraPDF to your project and create amazing PDFs today.

Read the Guide NuGet Package