Pragmatic.Documents
Document, email, spreadsheet, templating, and export tooling for Pragmatic.Design — render a single document model to PDF, DOCX, HTML email, CSV, and XLSX.
Pragmatic.Documents is an umbrella module: a JSON-serializable document model plus renderers,
template resolvers, markup parsers, and data-source integrations. You build a DocumentModel (directly
or from markup/templates) and render it to whichever format you need — the model is the single source.
Package map
Section titled “Package map”| Package | Purpose |
|---|---|
Pragmatic.Documents.Model | Page-oriented document model |
Pragmatic.Email.Model | HTML email model |
Pragmatic.Documents.Spreadsheet | Spreadsheet model for XLSX/CSV |
Pragmatic.Documents.Pdf | Render DocumentModel → PDF |
Pragmatic.Documents.Docx | Render DocumentModel → DOCX |
Pragmatic.Documents.Email | Render EmailModel → HTML email |
Pragmatic.Documents.Csv / .Xlsx | Read/write CSV / XLSX |
Add only the renderer(s) you need; they share the OOXML/model infrastructure.
Quick Start
Section titled “Quick Start”var doc = new DocumentModel() .Heading("Invoice INV-001") .Paragraph($"Total due: {total:C}");
byte[] pdf = PdfRenderer.Render(doc); // → PDFbyte[] docx = DocxRenderer.Render(doc); // → DOCX, from the same modelBuild the model directly, from a markup string, or from a template — see Templating and Getting Started.
Status
Section titled “Status”PDF, DOCX, HTML email, CSV, and XLSX rendering are functional within the 0.8 preview. Note: parsing is currently in-memory — see the roadmap for streaming and large-file guidance.
| Concepts | The model-first architecture, choosing a package | | Getting Started | Build a model and render it | | Templating | Template resolvers and data binding | | Markup Parser | Building a model from markup | | PDF · DOCX · Email · CSV · XLSX | Per-format rendering and options | | Common Mistakes · Troubleshooting | Pitfalls and fixes |
Requirements
Section titled “Requirements”- .NET 10.0+
License
Section titled “License”Part of the Pragmatic.Design ecosystem — see Licensing. Pragmatic.Documents is licensed under the PolyForm Small Business 1.0.0 license (free for small businesses; commercial license above the threshold).