Skip to content

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.

PackagePurpose
Pragmatic.Documents.ModelPage-oriented document model
Pragmatic.Email.ModelHTML email model
Pragmatic.Documents.SpreadsheetSpreadsheet model for XLSX/CSV
Pragmatic.Documents.PdfRender DocumentModel → PDF
Pragmatic.Documents.DocxRender DocumentModel → DOCX
Pragmatic.Documents.EmailRender EmailModel → HTML email
Pragmatic.Documents.Csv / .XlsxRead/write CSV / XLSX

Add only the renderer(s) you need; they share the OOXML/model infrastructure.

var doc = new DocumentModel()
.Heading("Invoice INV-001")
.Paragraph($"Total due: {total:C}");
byte[] pdf = PdfRenderer.Render(doc); // → PDF
byte[] docx = DocxRenderer.Render(doc); // → DOCX, from the same model

Build the model directly, from a markup string, or from a template — see Templating and Getting Started.

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 |

  • .NET 10.0+

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).