OfficeIMO.Word.Markdown
1.0.47
Prefix Reserved
dotnet add package OfficeIMO.Word.Markdown --version 1.0.47
NuGet\Install-Package OfficeIMO.Word.Markdown -Version 1.0.47
<PackageReference Include="OfficeIMO.Word.Markdown" Version="1.0.47" />
<PackageVersion Include="OfficeIMO.Word.Markdown" Version="1.0.47" />
<PackageReference Include="OfficeIMO.Word.Markdown" />
paket add OfficeIMO.Word.Markdown --version 1.0.47
#r "nuget: OfficeIMO.Word.Markdown, 1.0.47"
#:package OfficeIMO.Word.Markdown@1.0.47
#addin nuget:?package=OfficeIMO.Word.Markdown&version=1.0.47
#tool nuget:?package=OfficeIMO.Word.Markdown&version=1.0.47
OfficeIMO.Word.Markdown - Word and Markdown conversion
OfficeIMO.Word.Markdown converts between OfficeIMO.Word documents and OfficeIMO.Markdown documents.
Install
dotnet add package OfficeIMO.Word.Markdown
Quick start
using OfficeIMO.Word;
using OfficeIMO.Word.Markdown;
using var document = WordDocument.Create();
document.AddParagraph("Hello");
string markdown = document.ToMarkdown();
using var fromMarkdown = "# Title\n\nBody".LoadFromMarkdown();
AST-first conversion
using OfficeIMO.Markdown;
using OfficeIMO.Markdown.Html;
using OfficeIMO.Word.Markdown;
MarkdownDoc markdownDocument = "<table><tr><td><p>Line 1</p><p>Line 2</p></td></tr></table>"
.LoadFromHtml();
using var wordDocument = markdownDocument.ToWordDocument();
Use MarkdownDoc.ToWordDocument() when you already have a typed AST and want to avoid flattening back to Markdown text before Word conversion.
What it maps
- Word to Markdown with headings, paragraphs, lists, task items, tables, images, links, code, footnotes, and GitHub-friendly output.
- Markdown to Word through the typed
OfficeIMO.Markdownmodel. - Markdown image layout options such as local-image allowance and page-content-width fitting.
- Selected AST-preserved inline HTML wrappers such as underline, superscript, and subscript into Word run formatting.
HTML via Markdown
using OfficeIMO.Markdown;
var html = doc.ToHtmlViaMarkdown(); // full HTML document (defaults to HtmlStyle.Word)
var fragment = doc.ToHtmlFragmentViaMarkdown();
doc.SaveAsHtmlViaMarkdown("report.html"); // defaults to HtmlStyle.Word
// Override style if desired:
doc.SaveAsHtmlViaMarkdown("report.html", new HtmlOptions { Style = HtmlStyle.GithubAuto });
Use LoadFromHtmlViaMarkdown() when your source is HTML but you want the AST-first Markdown bridge instead of flattening HTML into Markdown text first.
Notes
- Default styling: ToHtmlViaMarkdown/SaveAsHtmlViaMarkdown use HtmlStyle.Word for a document‑like look.
- TOC markers:
[TOC],[[TOC]],{:toc}, and `` are recognized. Markdown → Word creates a native Word table of contents, and Word → Markdown exports native TOCs back as[TOC ...]markers. Parameterized form:[TOC min=2 max=3 layout=sidebar-right sticky=true scrollspy=true title="On this page"]. - Table cells: inline markdown (code/links/emphasis/images) is supported and
<br>becomes a real line break in HTML. - AST-preserved inline HTML wrappers such as
<u>,<sub>, and<sup>map to real Word run formatting during Markdown → Word conversion. - Inline tags without a native Word run equivalent degrade intentionally on the Word leg:
<ins>is treated as underline semantics and<q>roundtrips as literal quoted text.
Markdown → Word image layout options
var options = new MarkdownToWordOptions {
AllowLocalImages = true,
FitImagesToPageContentWidth = true, // page width minus margins
MaxImageWidthPercentOfContent = 85 // optional percent-based cap
};
using var doc = markdown.LoadFromMarkdown(options);
- Typed contract is available via
MarkdownToWordOptions.ImageLayout. PreferNarrativeSingleLineDefinitions = truekeeps isolatedLabel: valuelines as narrative paragraphs while still allowing grouped definition-list blocks.OnImageLayoutDiagnosticcan be used to inspect final width/height and applied layout constraints.
Word → Markdown layout and visual fallback options
var options = new WordToMarkdownOptions {
PageBreakMode = MarkdownPageBreakMode.SemanticBlock,
UnsupportedContentMode = MarkdownUnsupportedContentMode.Placeholder,
VisualFallbackMode = MarkdownVisualFallbackMode.SvgFile
};
doc.SaveAsMarkdown("report.md", options);
PageBreakMode.SemanticBlockwrites page breaks as fenced semantic blocks so Markdown → Word can restore real Word page breaks.- Headers, footers, and native Word table-of-contents fields are exported as semantic Markdown blocks/markers and restored on import where possible.
VisualFallbackMode.SvgDataUriembeds supported Word chart snapshots directly in Markdown as SVG images.VisualFallbackMode.SvgFilewrites supported chart snapshots into a sidecar*.assetsdirectory next to the Markdown file and links to those files.- Chart SVG fallbacks preserve cached chart data, chart type, dimensions, series colors, pie/doughnut point colors, common theme/scheme colors, and basic transparency transforms. Unsupported chart constructs remain semantic placeholders instead of being silently dropped when
UnsupportedContentMode.Placeholderis enabled.
Explicit IntelligenceX transcript contract
var options = MarkdownToWordPresets.CreateIntelligenceXTranscript(
allowedImageDirectories: new[] { @"C:\Exports\Images" },
visualMaxWidthPx: 760);
using var doc = markdown.LoadFromMarkdown(options);
MarkdownToWordPresets.CreateIntelligenceXTranscript(...)is the explicit DOCX preset for IX transcript export.- That preset now reuses the shared
MarkdownTranscriptPreparation.CreateIntelligenceXTranscriptReaderOptions(...)contract, including legacy IX visual JSON upgrades through document transforms. MarkdownToWordCapabilities.PreservesNarrativeSingleLineDefinitionsAsSeparateParagraphs()exposes the groupedLabel: valuecapability probe as a reusable OfficeIMO contract instead of host-local reflection logic.
Supported features (core)
- Headings 1–6, paragraphs, hard breaks
- Lists (unordered, ordered) and task items
- Tables with per‑column alignment
- Images (alt/title; size hints when provided in Markdown)
- Links and autolinks
- Code spans/blocks
- AST-preserved inline HTML wrappers for underline, superscript, and subscript
- Footnotes
- Front matter passthrough when using OfficeIMO.Markdown model
Boundaries
- Word document modeling belongs in
OfficeIMO.Word. - Markdown parsing and AST behavior belongs in
OfficeIMO.Markdown. - HTML ingestion belongs in
OfficeIMO.Markdown.HtmlorOfficeIMO.Word.Html, depending on the desired source model. - PDF output belongs in
OfficeIMO.Word.PdfandOfficeIMO.Pdf.
Targets and license
- Targets:
netstandard2.0,net8.0,net10.0. - License: MIT.
- Repository: EvotecIT/OfficeIMO
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.7.2
- OfficeIMO.Drawing (>= 1.0.25)
- OfficeIMO.Markdown (>= 0.6.38)
- OfficeIMO.Markdown.Html (>= 0.1.38)
- OfficeIMO.Word (>= 1.0.72)
- OfficeIMO.Word.Html (>= 1.0.45)
-
.NETStandard 2.0
- OfficeIMO.Drawing (>= 1.0.25)
- OfficeIMO.Markdown (>= 0.6.38)
- OfficeIMO.Markdown.Html (>= 0.1.38)
- OfficeIMO.Word (>= 1.0.72)
- OfficeIMO.Word.Html (>= 1.0.45)
-
net10.0
- OfficeIMO.Drawing (>= 1.0.25)
- OfficeIMO.Markdown (>= 0.6.38)
- OfficeIMO.Markdown.Html (>= 0.1.38)
- OfficeIMO.Word (>= 1.0.72)
- OfficeIMO.Word.Html (>= 1.0.45)
-
net8.0
- OfficeIMO.Drawing (>= 1.0.25)
- OfficeIMO.Markdown (>= 0.6.38)
- OfficeIMO.Markdown.Html (>= 0.1.38)
- OfficeIMO.Word (>= 1.0.72)
- OfficeIMO.Word.Html (>= 1.0.45)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on OfficeIMO.Word.Markdown:
| Package | Downloads |
|---|---|
|
OfficeIMO.Reader
Unified, read-only document extraction facade for OfficeIMO (Word/Excel/PowerPoint/Markdown/PDF) intended for AI ingestion. |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on OfficeIMO.Word.Markdown:
| Repository | Stars |
|---|---|
|
EvotecIT/PSWriteOffice
PowerShell Module to create and edit Microsoft Word, Microsoft Excel, and Microsoft PowerPoint documents without having Microsoft Office installed.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.47 | 712 | 6/27/2026 |
| 1.0.46 | 622 | 6/27/2026 |
| 1.0.45 | 871 | 6/24/2026 |
| 1.0.44 | 660 | 6/23/2026 |
| 1.0.43 | 786 | 6/21/2026 |
| 1.0.42 | 645 | 6/16/2026 |
| 1.0.41 | 720 | 6/16/2026 |
| 1.0.40 | 591 | 6/15/2026 |
| 1.0.39 | 618 | 6/13/2026 |
| 1.0.38 | 631 | 6/12/2026 |
| 1.0.37 | 493 | 6/9/2026 |
| 1.0.36 | 157 | 6/9/2026 |
| 1.0.35 | 103 | 6/9/2026 |
| 1.0.34 | 446 | 6/5/2026 |
| 1.0.33 | 586 | 5/27/2026 |
| 1.0.32 | 521 | 5/26/2026 |
| 1.0.31 | 458 | 5/26/2026 |
| 1.0.30 | 513 | 5/23/2026 |
| 1.0.29 | 489 | 5/22/2026 |
| 1.0.28 | 435 | 5/21/2026 |