Parchment 7.6.8
See the version list below for details.
dotnet add package Parchment --version 7.6.8
NuGet\Install-Package Parchment -Version 7.6.8
<PackageReference Include="Parchment" Version="7.6.8" />
<PackageVersion Include="Parchment" Version="7.6.8" />
<PackageReference Include="Parchment" />
paket add Parchment --version 7.6.8
#r "nuget: Parchment, 7.6.8"
#:package Parchment@7.6.8
#addin nuget:?package=Parchment&version=7.6.8
#tool nuget:?package=Parchment&version=7.6.8
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.parchment.docx or Report.parchment.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.parchment.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 %} - Loops over whole blocks: everything between the two tag paragraphs repeats, tables included. Both tags must sit in the same container — body paragraphs around a table, or one table cell; tags in different rows or cells are rejected
- 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.5.6)
- Fluid.Core (>= 2.40.0)
- Markdig (>= 1.4.0)
- Microsoft.Extensions.FileProviders.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Primitives (>= 10.0.12)
- OpenXmlHtml (>= 1.7.4)
- OpenXmlKit (>= 0.2.4)
- Parlot (>= 1.5.11)
- TimeZoneConverter (>= 8.0.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.6.9 | 0 | 10/14/2026 |
| 7.6.8 | 40 | 10/13/2026 |
| 7.6.7 | 73 | 10/12/2026 |
| 7.6.6 | 54 | 10/12/2026 |
| 7.6.4 | 86 | 10/8/2026 |
| 7.6.2 | 103 | 10/6/2026 |
| 7.6.1 | 101 | 10/5/2026 |
| 7.6.0 | 124 | 9/24/2026 |
| 7.5.0 | 143 | 9/2/2026 |
| 7.4.0 | 132 | 8/27/2026 |
| 7.3.0 | 137 | 8/24/2026 |
| 7.2.1 | 141 | 8/19/2026 |
| 7.2.0 | 141 | 8/18/2026 |
| 7.1.2 | 142 | 8/18/2026 |
| 7.1.1 | 146 | 8/17/2026 |
| 7.1.0 | 142 | 8/14/2026 |
| 7.0.4 | 142 | 8/10/2026 |
| 7.0.3 | 144 | 8/10/2026 |
| 7.0.2 | 130 | 8/10/2026 |
| 7.0.0 | 129 | 8/10/2026 |