Introduction
Papyra is a .NET 10 library for composing and rendering documents. You describe a document once with a fluent builder API, and render the same model to PDF, DOCX, and XLSX.
var document = Document.Create(doc => doc .Paragraph(p => p.Text("Hello, Papyra")));
byte[] pdf = document.RenderAsPdf();The pipeline
Section titled “The pipeline”Papyra processes documents through three independent stages:
Document (fluent API) → LayoutBox tree → byte[] output Core Layout Renderers- Core - an immutable document model built via the fluent API (
Document,DocumentBuilder,TableBuilder, …). The model knows nothing about output formats. - Layout - an internal layout engine computes the position and dimensions of every element and produces a layout tree.
- Renderers - each renderer consumes the layout tree and produces format-specific bytes. Layout and the built-in renderers run behind the
Rendercall; only the document model andRenderare public API.
Because rendering is separated from the model, a document is composed exactly once - there are no format-specific branches in your composition code.
What makes the PDF output different
Section titled “What makes the PDF output different”The PDF renderer is written from scratch; it does not wrap iText, PDFsharp, or a browser engine:
- PDF/A output - PDF/A-2b (default), PDF/A-3b, and PDF/A-4, with XMP metadata and an embedded sRGB ICC profile. Conformance is verified against veraPDF in the test suite.
- Full Unicode text - any TrueType font, embedded as Type0/CIDFontType2 and subsetted to the glyphs your document uses.
- Table pagination - tables split across pages with repeating header and footer rows.
- Only three dependencies for the whole library:
DocumentFormat.OpenXml,SixLabors.Fonts, andSixLabors.ImageSharp. No native code.
When to use Papyra
Section titled “When to use Papyra”Papyra is built for business documents: invoices, order confirmations, reports, certificates - documents that must be correct, archivable, and reproducible. It is not a general-purpose graphics canvas: there is no free-form drawing API.
Papyra is honest about its current gaps - check Known limitations and the roadmap before committing to a use case.
Next steps
Section titled “Next steps”- Installation
- Quick start - a table rendered to four formats in ten lines
- Your first invoice - the complete real-world walkthrough
- Papyra.Samples - runnable sample projects on GitHub
© 2026 Stefan Nikolei. Payments are processed by Paddle.com as merchant of record.