Pragmatic.Documents.Templating.I18N 1.0.0-alpha.6

This is a prerelease version of Pragmatic.Documents.Templating.I18N.
dotnet add package Pragmatic.Documents.Templating.I18N --version 1.0.0-alpha.6
                    
NuGet\Install-Package Pragmatic.Documents.Templating.I18N -Version 1.0.0-alpha.6
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Pragmatic.Documents.Templating.I18N" Version="1.0.0-alpha.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Pragmatic.Documents.Templating.I18N" Version="1.0.0-alpha.6" />
                    
Directory.Packages.props
<PackageReference Include="Pragmatic.Documents.Templating.I18N" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Pragmatic.Documents.Templating.I18N --version 1.0.0-alpha.6
                    
#r "nuget: Pragmatic.Documents.Templating.I18N, 1.0.0-alpha.6"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Pragmatic.Documents.Templating.I18N@1.0.0-alpha.6
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Pragmatic.Documents.Templating.I18N&version=1.0.0-alpha.6&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Pragmatic.Documents.Templating.I18N&version=1.0.0-alpha.6&prerelease
                    
Install as a Cake Tool

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

Package Purpose
Models
Pragmatic.Documents.Model Page-oriented document model (DocumentModel, DocumentBuilder)
Pragmatic.Email.Model HTML email model
Pragmatic.Documents.Spreadsheet Spreadsheet model for XLSX/CSV
Renderers and I/O
Pragmatic.Documents.Pdf DocumentModel → PDF, through a native Typst compiler shipped in the package
Pragmatic.Documents.Docx DocumentModel → DOCX
Pragmatic.Documents.Email EmailModel → table-based HTML email with inline CSS (EmailHtmlRenderer), and its plain-text part (EmailTextRenderer)
Pragmatic.Documents.Csv / .Xlsx Read/write CSV / XLSX
Pragmatic.Documents.Csv.Generator Source generator: typed, AOT-safe CSV reader/writer for [CsvSerializable] types
Pragmatic.Documents.Ooxml OOXML parts (namespaces, relationships, theme, core properties) used by the XLSX writer
Templates
Pragmatic.Documents.Markup PDX templates end to end: IPdxTemplates (a template by name, in the reader's language → document model, or mail subject/HTML/text), template sources, the PDX-Doc / PDX-Email parsers
Pragmatic.Documents.Templating Expression engine: parser, evaluator, pipes, data context
Pragmatic.Documents.Templating.I18N Date, currency, percent and t: pipes over IStringLocalizer
Pragmatic.Documents.Templating.Spreadsheet XLSX and CSV files as template data sources
Pragmatic.Documents.Templates / Pragmatic.Email.Templates Template types and resolvers → DocumentModel / EmailModel

Add only the packages you need; each renderer depends on its model, not on the others.

Pragmatic.Documents.Templates ships for net10.0 and net11.0, with the same API on both. An application on .NET 11 gets the net11.0 asset, which is compiled with runtime async and resolves a template 21–34% faster.

Quick Start

A document is a template and its data. The template is a file, changed, translated and reviewed without a build, shipped inside the module that owns it:


<document title="{{ t:invoice.title }} {{ invoice.number }}">
  <page>
    <heading level="1">{{ t:invoice.title }} {{ invoice.number }}</heading>
    <text>{{ t:invoice.due }}: {{ invoice.total | currency }}</text>
  </page>
</document>

<EmbeddedResource Include="templates\*.pdxdoc;templates\*.pdxemail" />
using Pragmatic.Documents.Markup;
using Pragmatic.Documents.Pdf;
using Pragmatic.Documents.Templating.Data;

// once, in the module: every host that includes it registers the source
[assembly: PdxTemplates<BillingModule>]
// (a hand-built host, or another source: services.AddPdxTemplates(t => t.FromAssemblyOf<BillingModule>()))

// where the document is wanted: IPdxTemplates is injected
var data = new TemplateDataContext()
    .AddSource("invoice", new Dictionary<string, object?> { ["number"] = "INV-001", ["total"] = invoice.Total });

var document = await templates.DocumentAsync("invoice.pdxdoc", customer.Language, data, ct);
byte[] pdf = PdfRenderer.Render(document.Model);   // → PDF
// document.Warnings lists every name the template used and the data did not provide

var mail = await templates.EmailAsync("reminder.pdxemail", customer.Language, data, ct);
// mail.Subject, mail.Html, mail.Text: both bodies from one model

The language is the reader's, and it governs the t: translations and the date / currency / percent pipes alike. Use DocumentBuilder / EmailBuilder when code decides the layout, or for what the markup cannot express (styling, page-number fields, hyperlinks); see Templating, Markup and Getting Started.

PDF platforms and fonts. Pragmatic.Documents.Pdf ships its native engine for win-x64, linux-x64 and osx-arm64 (PdfRenderer.IsSupported answers whether it loads). The engine uses the fonts installed on the machine that renders. On Linux it sees them only through fontconfig, so a container image needs both packages, or every render fails with "No fonts found on this machine":

RUN apt-get update && apt-get install -y --no-install-recommends fontconfig fonts-dejavu-core

See Platform support and Styles and fonts.

Status

Functional within 1.0.0-alpha: PDF, DOCX, HTML email, CSV, and XLSX rendering. Parsing is currently in-memory; see the roadmap for streaming and large files.

Documentation

Guide What you'll learn
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

  • .NET 10.0+

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

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Pragmatic.Documents.Templating.I18N:

Package Downloads
Pragmatic.Documents.Markup

PDX-Doc and PDX-Email templates end to end: the markup parsers, template sources (embedded, directory, chained) and IPdxTemplates, which resolves a template by name, in the reader's language, to a document model or a mail's subject, HTML and text.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-alpha.6 96 11/21/2026
1.0.0-alpha.5 58 11/21/2026
1.0.0-alpha.4 69 11/16/2026
1.0.0-alpha.3 116 10/17/2026
1.0.0-alpha.2 78 10/12/2026
1.0.0-alpha.1 89 10/3/2026