Coded PDFs, perfect on paper.
A .NET library family for millimetric PDF layout. Agent-friendly. Ruler-grade. Pure MIT.
Pixel-perfect PDFs in C#
Imperative control over every cell, every millimetre, with no PHP detour. SkiaSharp underneath for accurate font metrics; SourceLink and symbol packages for clean debugging.
- The 14 PDF core fonts ship out of the box — no TTF needed for "Hello World".
- Embed any TrueType with a single
LoadFontcall. - Output validates cleanly in Acrobat, Chrome and the major PDF viewers.
Layout that reads like the page it draws
Row, Stack and Panel
compose a page without the x + width + gap
arithmetic. The call site reads as the layout it produces.
var cols = pdf.Row(pdf.Bounds(), new[] { 2.0, 1.0 }, gap: 3);
pdf.Panel(cols[0], "DETAILS", brandStyle, content => {
// body lives inside `content`,
// state restored on return
});
Markdown and ruler-grade drawing on the same page
Render CommonMark + GFM through EgoPDF.Markdown,
drop into native code where the visual demands it. The
shortcode extension is the bridge.
- Headings, lists, code blocks, links, autolinks, quotes, images.
[[barcode]],[[image]],[[cta]],[[imagepair]]— each block shortcode dispatches to a handler you control.- Imperative header bands compose with Markdown bodies in the same FPdf instance.
Friendly for humans and agents
Single-method primitives, scope helpers that auto-restore state, declarative styling records and a copy-pasteable recipe catalog. An LLM agent can derive everything it needs from the same shipping samples a developer reads.
using (pdf.PushState())/PushPos()— mutate freely, revert on exit.PanelStylerecords capture frame + title looks as reusable data.- RECIPES.md indexes every pattern with pointers into the source samples.
- SHA-256 visual baselines catch unintended drift between refactors.
Three packages, all MIT
EgoPDF.Generator
Core PDF engine with the layout primitives. Depends on SkiaSharp.
EgoPDF.Barcodes
Every 1D / 2D symbology through ZXing.Net, plus a ZPL II emulator.
EgoPDF.Markdown
CommonMark + GFM via Markdig, rendered through EgoPDF.Generator.