TrinePDF 1.0.0-beta.1

This is a prerelease version of TrinePDF.
dotnet add package TrinePDF --version 1.0.0-beta.1
                    
NuGet\Install-Package TrinePDF -Version 1.0.0-beta.1
                    
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="TrinePDF" Version="1.0.0-beta.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TrinePDF" Version="1.0.0-beta.1" />
                    
Directory.Packages.props
<PackageReference Include="TrinePDF" />
                    
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 TrinePDF --version 1.0.0-beta.1
                    
#r "nuget: TrinePDF, 1.0.0-beta.1"
                    
#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 TrinePDF@1.0.0-beta.1
                    
#: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=TrinePDF&version=1.0.0-beta.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=TrinePDF&version=1.0.0-beta.1&prerelease
                    
Install as a Cake Tool

TrinePDF

A comprehensive PDF generation library for .NET, evolved from the TCPDF PHP library. Targeting .NET 10+.

NuGet Build Status License: LGPL-3.0


Overview

TrinePDF is a comprehensive PDF generation library for .NET. It produces PDF files entirely in managed C# code, with no dependency on external PDF renderers or native libraries for core functionality.

Features

Feature Area Details
Document Lifecycle Create, configure, and save PDF documents with full control over metadata, page layout, and output
Page Management Add pages with configurable size (A3, A4, Letter, Legal, custom), orientation, and margins
Text Rendering Cell, MultiCell, and Write methods for single-line, multi-line, and inline text output
Fonts 14 PDF standard fonts built-in; load and embed custom TrueType/OpenType fonts with subsetting
Drawing Vector drawing primitives: Line, Rect, Circle, Ellipse, Polygon with stroke and fill control
Colors RGB, CMYK, Grayscale, and Spot (Separation) color models
Color Gradients Linear and radial gradients with configurable direction
Transparency Alpha blending for fill and stroke operations via ExtGState
Images Embed PNG, JPEG, GIF, BMP, and SVG images with automatic format detection
Barcodes (1D) Code 128, Code 39, EAN-13, UPC-A, ISBN
Barcodes (2D) QR Code, Data Matrix
Headers & Footers Automatic repeating headers and footers via callbacks
Multi-Column Layout Equal-width column layouts (2, 3, or more columns)
Bookmarks Hierarchical PDF outline / bookmark tree
Table of Contents Automatic TOC generation from bookmarks
Annotations and Links Text annotations, URI links, and internal document links
Interactive Forms Text fields, checkboxes, radio buttons, dropdowns, and push buttons (AcroForm)
PDF Layers (OCG) Optional Content Groups for toggling visibility of content layers
Graphic Transforms Translate, rotate, scale, and skew operations
Clipping Paths Clip content to arbitrary shapes
Text Render Modes Fill, stroke, fill+stroke, and invisible text rendering
CJK Fonts CID-keyed font support for Chinese, Japanese, and Korean text
RTL Text Right-to-left text rendering with bidirectional support
Inline HTML Render basic HTML elements (p, h1-h6, ul, ol, tables) directly in PDF via AngleSharp
Encryption RC4-128, AES-128, and AES-256 document encryption with owner/user passwords and permission control
Digital Signatures Sign PDF documents with PKCS#12 certificates
PDF/A Compliance PDF/A-1b, PDF/A-2b, and PDF/A-3b conformance with XMP metadata and ICC profiles
HTML-to-PDF Convert HTML content to PDF via the TrinePDF.Html package (powered by PuppeteerSharp)
Page Manipulation Copy, move, delete, and rotate pages programmatically
Tables Fluent table builder with colspan/rowspan, cell styling, automatic page breaks, and header repetition
Lists Ordered and unordered lists with 8 marker types (numeric, alpha, roman, bullet, dash, custom) and nested sub-lists
Charting Bar, column, line, area, pie, and scatter charts with axes, legends, and color palettes
XGraphics GDI+/PDFsharp-compatible drawing surface with pens, brushes, paths, and transforms
FlowDocument Automatic layout model with sections, paragraphs, styled text runs, tables, images, and pagination
PDF/UA Accessibility PDF/UA-1 and UA-2 structure tagging, alt text, document language, and validation
PDF Reader Open existing PDFs, inspect pages, and extract text with font encoding resolution
Text Extraction Extract text with position, font, and reading order from PDF content streams
Split and Merge Split PDFs by page range or merge multiple documents into one
Form XObjects Reusable page templates, imported pages from existing PDFs, and file size optimization
HTML Worker Lightweight inline HTML-to-PDF rendering with CSS color support and table rendering
HTML Forms Convert HTML <form> elements to PDF AcroForm fields automatically
Radio Buttons Radio button groups, multi-line text areas, and push buttons with URL actions
Stamp Annotations Predefined stamp annotations (Approved, Draft, Confidential, etc.)
File Attachments Embed files in the PDF attachment panel with MIME type metadata
Font Metrics Retrieve font metric values (ascent, descent, cap height) for registered fonts
System Font Discovery Cross-platform system font scanning with TTC multi-face support

Quick Start

using TrinePDF.Core;

// Create a new PDF document (A4, portrait, millimeters)
using var doc = new PdfDocument(PageOrientation.Portrait, PdfUnit.Millimeters, PageSize.A4);

// Set document metadata
doc.Title = "My First PDF";
doc.Author = "Your Name";

// Configure margins
doc.SetMargins(15, 15, 15);

// Add a page
doc.AddPage();

// Set the font and write text
doc.SetFont("Helvetica", FontStyle.Bold, 16);
doc.Cell(0, 10, "Hello from TrinePDF!", newLine: true, align: TextAlign.Center);

doc.SetFont("Helvetica", FontStyle.None, 12);
doc.Cell(0, 8, "This PDF was generated entirely in managed C#.");

// Save to file
doc.Save("output.pdf");

Installation

Install the core library from NuGet:

dotnet add package TrinePDF

For lightweight inline HTML rendering:

dotnet add package TrinePDF.Html.Inline

For full HTML-to-PDF support (browser-based):

dotnet add package TrinePDF.Html

Requirements

  • .NET 10 or later
  • SkiaSharp, HarfBuzzSharp, and ZXing.Net (pulled automatically via NuGet)
  • On Linux, also reference SkiaSharp.NativeAssets.Linux (or .NoDependencies for containers) and HarfBuzzSharp.NativeAssets.Linux; neither base package ships a Linux native binary
  • For inline HTML rendering: AngleSharp (included in the TrinePDF.Html.Inline package)
  • For full HTML-to-PDF: PuppeteerSharp (included in the TrinePDF.Html package; downloads Chromium on first use)

Documentation

Full documentation is available in the project wiki.

Attribution

TrinePDF is derived from TCPDF by Nicola Asuni (Tecnick.com LTD), originally licensed under LGPL-3.0. See ATTRIBUTION.md for full details.

Contributing

Contributions are welcome. Please see CONTRIBUTING.md for guidelines on submitting issues, feature requests, and pull requests.

License

This project is dual-licensed:

Product Compatible and additional computed target framework versions.
.NET 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.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on TrinePDF:

Package Downloads
TrinePDF.Html

Full HTML-to-PDF rendering for TrinePDF using browser-based rendering via PuppeteerSharp.

TrinePDF.Html.Inline

Lightweight inline HTML renderer for TrinePDF. Render HTML elements directly in PDF documents using AngleSharp.

TrinePDF.Markdown

Convert Markdown (CommonMark + GFM) documents to PDF via TrinePDF. Supports headings, lists, tables, code blocks, images, and more.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-beta.1 49 10/30/2026