Parchment 7.1.1
See the version list below for details.
dotnet add package Parchment --version 7.1.1
NuGet\Install-Package Parchment -Version 7.1.1
<PackageReference Include="Parchment" Version="7.1.1" />
<PackageVersion Include="Parchment" Version="7.1.1" />
<PackageReference Include="Parchment" />
paket add Parchment --version 7.1.1
#r "nuget: Parchment, 7.1.1"
#:package Parchment@7.1.1
#addin nuget:?package=Parchment&version=7.1.1
#tool nuget:?package=Parchment&version=7.1.1
Parchment
Parchment is a Word (.docx) generation library that combines a .NET data model with either a docx template (token replacement) or a markdown template (full content rendering), driven by liquid via Fluid, Markdig, and OpenXmlHtml.
A template belongs to its model type and is rendered by it — one template per model, no names to repeat.
Source generator (recommended)
Decorate the model class itself with [ParchmentModel] and Parchment's source generator finds the template by convention — the AdditionalFiles entry named after the type (Invoice.docx or Report.md) — validates its tokens against the model at compile time, and embeds it into the generated source. A module initializer registers it when the assembly loads, so rendering is the whole API:
[ParchmentModel]
public partial class Invoice
{
public string Number { get; set; } = "";
// ...
}
var store = new TemplateStore();
using var stream = new MemoryStream();
await store.Render(invoice, stream);
A markdown template's style source is found by convention too: Report.dotx, or the nearest parchment.dotx up the directory tree — embedded alongside the template.
Registering by hand
For templates the generator cannot see — content produced at runtime, per-tenant templates — register against the model type directly. The model still goes through the generator: mark it [ParchmentBindable] (and partial) so its accessors are pre-compiled without binding a template.
A docx template:
[ParchmentBindable]
public partial class Invoice
{
// ...
}
var store = new TemplateStore();
store.RegisterDocxTemplate<Invoice>("invoice-template.docx");
using var stream = new MemoryStream();
await store.Render(invoice, stream);
A markdown template, with an optional style source — a Stream over a Word template (.dotx) whose styles the output inherits:
store.RegisterMarkdownTemplate<Report>(markdownSource, styleSource);
Render writes to a stream the caller supplies. To write straight to disk, use RenderToFile:
await store.RenderToFile(invoice, "out.docx");
Template content
The template may include:
- Substitution tokens:
{{ Customer.Name }} - Paragraph-scope loops:
{% for line in Lines %}…{% endfor %} - Table-row-scope loops: put
{% for line in Lines %}on its own in one row and{% endfor %}on its own in another - Conditionals:
{% if Customer.IsPreferred %}…{% endif %}
Members are resolved against the model by name. There is no snake-case translation layer, so use the property names as declared.
See the readme for full documentation.
| Product | Versions 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. |
-
net10.0
- DocumentFormat.OpenXml (>= 3.5.1)
- Excelsior (>= 6.2.5)
- Fluid.Core (>= 2.31.0)
- Markdig (>= 1.3.2)
- Microsoft.Extensions.FileProviders.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Primitives (>= 10.0.11)
- OpenXmlHtml (>= 1.6.0)
- Parlot (>= 1.5.8)
- TimeZoneConverter (>= 7.2.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Parchment:
| Package | Downloads |
|---|---|
|
Parchment.Morph
Resolves Parchment's table-of-contents and page-reference fields by laying the document out with Morph, so the numbers are in the file before Word opens it. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 7.5.0 | 110 | 9/2/2026 |
| 7.4.0 | 114 | 8/27/2026 |
| 7.3.0 | 115 | 8/24/2026 |
| 7.2.1 | 116 | 8/19/2026 |
| 7.2.0 | 124 | 8/18/2026 |
| 7.1.2 | 126 | 8/18/2026 |
| 7.1.1 | 122 | 8/17/2026 |
| 7.1.0 | 125 | 8/14/2026 |
| 7.0.4 | 122 | 8/10/2026 |
| 7.0.3 | 130 | 8/10/2026 |
| 7.0.2 | 119 | 8/10/2026 |
| 7.0.0 | 110 | 8/10/2026 |
| 6.2.3 | 118 | 8/8/2026 |
| 6.2.2 | 112 | 8/8/2026 |
| 6.2.1 | 105 | 8/8/2026 |
| 6.2.0 | 115 | 8/7/2026 |
| 6.1.0 | 110 | 8/6/2026 |
| 6.0.0 | 112 | 8/6/2026 |
| 5.0.0 | 111 | 8/6/2026 |
| 4.3.0 | 121 | 8/5/2026 |