TrinePDF.Markdown
1.0.0-beta.1
dotnet add package TrinePDF.Markdown --version 1.0.0-beta.1
NuGet\Install-Package TrinePDF.Markdown -Version 1.0.0-beta.1
<PackageReference Include="TrinePDF.Markdown" Version="1.0.0-beta.1" />
<PackageVersion Include="TrinePDF.Markdown" Version="1.0.0-beta.1" />
<PackageReference Include="TrinePDF.Markdown" />
paket add TrinePDF.Markdown --version 1.0.0-beta.1
#r "nuget: TrinePDF.Markdown, 1.0.0-beta.1"
#:package TrinePDF.Markdown@1.0.0-beta.1
#addin nuget:?package=TrinePDF.Markdown&version=1.0.0-beta.1&prerelease
#tool nuget:?package=TrinePDF.Markdown&version=1.0.0-beta.1&prerelease
TrinePDF
A comprehensive PDF generation library for .NET, evolved from the TCPDF PHP library. Targeting .NET 10+.
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.NoDependenciesfor containers) andHarfBuzzSharp.NativeAssets.Linux; neither base package ships a Linux native binary - For inline HTML rendering: AngleSharp (included in the
TrinePDF.Html.Inlinepackage) - For full HTML-to-PDF: PuppeteerSharp (included in the
TrinePDF.Htmlpackage; 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:
- Open source: GNU Lesser General Public License v3.0 — see LICENSE
- Commercial: Proprietary license available — see COMMERCIAL-LICENSE.md
| Product | Versions 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. |
-
net10.0
- Markdig (>= 0.45.0)
- TrinePDF (>= 1.0.0-beta.1)
- TrinePDF.Html (>= 1.0.0-beta.1)
- TrinePDF.Html.Inline (>= 1.0.0-beta.1)
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 |
|---|---|---|
| 1.0.0-beta.1 | 41 | 10/30/2026 |