Parchment.Morph
6.2.3
dotnet add package Parchment.Morph --version 6.2.3
NuGet\Install-Package Parchment.Morph -Version 6.2.3
<PackageReference Include="Parchment.Morph" Version="6.2.3" />
<PackageVersion Include="Parchment.Morph" Version="6.2.3" />
<PackageReference Include="Parchment.Morph" />
paket add Parchment.Morph --version 6.2.3
#r "nuget: Parchment.Morph, 6.2.3"
#:package Parchment.Morph@6.2.3
#addin nuget:?package=Parchment.Morph&version=6.2.3
#tool nuget:?package=Parchment.Morph&version=6.2.3
Parchment.Morph
Resolves Parchment's table-of-contents and page-reference fields by laying the document out with Morph.
A page number is a product of layout, so ordinarily a generated document leaves those fields for Word to compute — which costs the reader a prompt on open and shows placeholder text until they accept it. This measures the document as it is built and writes the numbers in, so the file opens with the values already in place.
var store = new TemplateStore
{
PageNumbers = new MorphPageNumberResolver()
};
store.RegisterMarkdownTemplate<ReportModel>("report", markdown, styleSource);
The template asks for the fields the same way it always does:
Contents {.TOCHeading}
[TOC]{levels=1}
# Summary {#summary}
The summary is on page [](#summary).
Two things to weigh. It costs a layout pass per render — pages are measured rather than drawn, but the document is still laid out in full. And Morph is a very close approximation of Word's layout rather than Word itself, so a document the two paginate differently ends up with page numbers that are wrong and, because nothing is left marked for update, look authoritative. The fields survive, so a reader can still refresh them; nobody refreshes numbers that look right.
| 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.4)
- Fluid.Core (>= 2.31.0)
- Markdig (>= 1.3.2)
- Microsoft.Extensions.FileProviders.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Primitives (>= 10.0.10)
- Morph (>= 1.2.3)
- OpenXmlHtml (>= 1.5.2)
- Parchment (>= 6.2.3)
- Parlot (>= 1.5.8)
- TimeZoneConverter (>= 7.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.