Important
Repository Consolidated & Archived (2026-11): This package has been consolidated into $(System.Collections.Hashtable.Target) (namespace Glacier.Graphics.Pdf). Please reference the Glacier.Graphics NuGet package (v1.2.0+) for all future updates.
📖 Read the Deep-Dive: I built a minimal zero-dependency PDF library for C# because I hate bloat.
A minimal, Native AOT-compatible PDF creation library for .NET 10, ported from the original tinypdf by Lulzx.
- Zero external dependencies & Native AOT ready (
IsAotCompatible) - Text rendering (
Helvetica,Times,Courier+ bold/oblique variants) with fullWinAnsiEncodingtypographic support (€,£,—,–,•, smart quotes, ellipsis) - Clickable links with optional underlining
- Shapes (Rectangles, Lines, Circles, Wedges)
- JPEG images (
/DCTDecodepassthrough preserved under Flate compression) - Optional Flate (deflate) compression for PDF page streams
- Markdown to PDF conversion
- Multiple pages with custom sizes
This project targets .NET 10.
Install the package via the .NET CLI:
dotnet add package TinyPdfAll sample documents below are generated programmatically using TinyPdf (pure C#, zero dependencies) in sub-millisecond execution times:
using TinyPdf;
var builder = TinyPdfCreate.Create();
builder.Page(ctx => {
ctx.Text("Hello World", 50, 700, 24);
ctx.Rect(50, 650, 100, 20, "#FF0000");
});
byte[] pdf = builder.Build();
File.WriteAllBytes("output.pdf", pdf);using TinyPdf;
var options = new TinyPdfCreate.MarkdownOptions(Compress: true);
string md = "# Header\n\nThis is a paragraph — €100.\n\n- List item";
byte[] pdf = TinyPdfCreate.Markdown(md, options);
File.WriteAllBytes("markdown.pdf", pdf);From the repository root run:
dotnet test- CRITICAL BUG FIX: Preserved
/Filter /DCTDecodeon JPEG XObjects whenCompress = true—Builder.Build()previously overwrote/Filter /DCTDecodewith/FlateDecodeand ZLib-compressed raw JPEG bytes, corrupting embedded images whenever stream compression was enabled. - Full
WinAnsiEncodingTypographic Serialization — mapped all Windows-1252 extended code points (€,—,–,“,”,‘,’,•,…,™, etc.) to their exact single-byte WinAnsi values and transliterated common arrows/math operators (→,≥,≤), eliminating UTF-8 mojibake in Type 1 fonts. - Hardened JPEG SOF0/SOF1/SOF2 Header Bounds Check and enabled
IsAotCompatible+TreatWarningsAsErrorswith NuGet Trusted Publishing OIDC.
Developed by Ian Cowley and Antigravity (Google DeepMind).
Part of the Glacier Ecosystem — high-performance, zero-allocation developer tooling and data engines natively built for modern C# and .NET 10.
- 🌐 Website & Documentation: glaciersoftware.dev
- ☕ Buy Me a Coffee: buymeacoffee.com/glaciersoftware
- ❤️ GitHub Sponsors: github.com/sponsors/ian-cowley
- 🐙 All Repositories: github.com/ian-cowley




