OfficeIMO.Markdown.Pdf
3.4.2
Prefix Reserved
See the version list below for details.
dotnet add package OfficeIMO.Markdown.Pdf --version 3.4.2
NuGet\Install-Package OfficeIMO.Markdown.Pdf -Version 3.4.2
<PackageReference Include="OfficeIMO.Markdown.Pdf" Version="3.4.2" />
<PackageVersion Include="OfficeIMO.Markdown.Pdf" Version="3.4.2" />
<PackageReference Include="OfficeIMO.Markdown.Pdf" />
paket add OfficeIMO.Markdown.Pdf --version 3.4.2
#r "nuget: OfficeIMO.Markdown.Pdf, 3.4.2"
#:package OfficeIMO.Markdown.Pdf@3.4.2
#addin nuget:?package=OfficeIMO.Markdown.Pdf&version=3.4.2
#tool nuget:?package=OfficeIMO.Markdown.Pdf&version=3.4.2
OfficeIMO.Markdown.Pdf - Markdown to PDF export
OfficeIMO.Markdown.Pdf exports OfficeIMO.Markdown documents to PDF through the first-party OfficeIMO.Pdf engine. It is a thin adapter: Markdown parsing stays in OfficeIMO.Markdown, and PDF layout/writing stays in OfficeIMO.Pdf.
Install
dotnet add package OfficeIMO.Markdown.Pdf
Quick start
using OfficeIMO.Markdown;
using OfficeIMO.Markdown.Pdf;
MarkdownDoc document = MarkdownDoc.Parse("""
# Status
This is **important** and includes [OfficeIMO](https://github.com/EvotecIT/OfficeIMO).
| Area | State |
| --- | --- |
| PDF | Native |
""");
document.SaveAsPdf("status.pdf");
Raw Markdown text uses source-explicit names so it cannot be confused with HTML or RTF strings:
using OfficeIMO.Markdown.Pdf;
"# Hello\n\nGenerated by OfficeIMO."
.SaveAsPdfFromMarkdown("hello.pdf");
File-based conversion uses the native Markdown lifecycle so a string path is not confused with Markdown text:
MarkdownDoc.Load("README.md").SaveAsPdf("README.pdf");
Examples
Use front matter for metadata and theme selection
using OfficeIMO.Markdown.Pdf;
string markdown = """
---
title: Incident review
author: Operations
pdfTheme: TechnicalDocument
tags:
- incident
- review
---
# Incident review
## Summary
- Detection was automatic.
- Customer impact was limited.
- Follow-up tasks are tracked below.
| Task | Owner |
| --- | --- |
| Update monitor | Platform |
| Review runbook | Operations |
""";
markdown.SaveAsPdfFromMarkdown("incident-review.pdf", new MarkdownToPdfOptions {
UseFrontMatterMetadata = true,
UseFrontMatterTheme = true,
FrontMatterRenderMode = MarkdownPdfFrontMatterRenderMode.DocumentHeader
});
Convert a Markdown file with local images
using OfficeIMO.Markdown.Pdf;
using OfficeIMO.Pdf;
var options = new MarkdownToPdfOptions {
BaseDirectory = Path.GetDirectoryName(Path.GetFullPath("Docs/status.md")),
IncludeImages = true,
ResourcePolicy = PdfResourcePolicy.CreateTrustedHost(),
DefaultImageWidth = 420,
DefaultImageHeight = 240,
PdfTheme = MarkdownPdfStyle.Report()
};
MarkdownDoc.Load("Docs/status.md").SaveAsPdf("Artifacts/status.pdf", options);
Reuse one visual theme across HTML, PDF, and Word
using OfficeIMO.Markdown;
using OfficeIMO.Markdown.Pdf;
using OfficeIMO.Word.Markdown;
MarkdownVisualTheme theme = MarkdownVisualTheme.Report()
.WithColorScheme(MarkdownColorSchemeKind.Emerald)
.WithColors(accent: "SeaGreen", heading: "#064e3b")
.WithTable(table => {
table.BorderWidth = 0.9;
table.CellPaddingX = 8;
table.UseRowStripes = true;
});
MarkdownDoc document = MarkdownDoc.Parse(markdown);
document.SaveAsHtml("report.html", new HtmlOptions { Theme = theme });
document.SaveAsPdf("report.pdf", new MarkdownToPdfOptions { Theme = theme });
using var word = document.ToWordDocument(new MarkdownToWordOptions { Theme = theme });
word.Save("report.docx");
Write to bytes or streams
using OfficeIMO.Markdown;
using OfficeIMO.Markdown.Pdf;
MarkdownDoc document = MarkdownReader.Parse("# Invoice notes\n\nGenerated by OfficeIMO.");
byte[] pdfBytes = document.ToPdfBytes();
using var stream = File.Create("invoice-notes.pdf");
document.SaveAsPdf(stream);
Keep warnings visible
using OfficeIMO.Markdown.Pdf;
using OfficeIMO.Pdf;
var options = new MarkdownToPdfOptions {
RemoteImageResolver = null,
IncludeImages = true
}.UseProfile(PdfExportProfile.Faithful);
options.TextFallbacks = PdfTextFallbackFeatures.Default;
MarkdownDoc document = MarkdownDoc.Load("README.md");
var result = document.SaveAsPdfResult("README.pdf", options);
if (!result.Succeeded) {
foreach (string diagnostic in result.Diagnostics) {
Console.WriteLine(diagnostic);
}
}
foreach (var warning in result.Warnings) {
Console.WriteLine($"{warning.Source}: {warning.Message}");
}
result.Report.RequireNoErrorWarnings();
What it maps
- Headings with bookmark anchors and PDF outlines.
- PDF metadata from options, YAML front matter, or the first heading.
- Paragraphs, rich inline formatting, links, lists, task lists, tables, code blocks, semantic fenced blocks, callouts, details, definition lists, block quotes, footnotes, and generated table-of-contents blocks.
- Visual themes for readable document rhythm, page treatment, links, code blocks, panels, tables, and checklist rows.
- Profile presets through
MarkdownToPdfOptions.UseProfile(...), plus sharedTextFallbacksandResourcePolicycontrols. Profiles may disable images for lightweight/text-only output but never grant local, remote, or host-font access. IncludeImagescontrols whether images participate at all.PdfResourcePolicyis the only trust gate for local files, data URIs, remote resolvers, and installed host fonts. Local-image containment resolves symlinks and junctions before reading.PdfTextFallbackFeatures.MultilingualFontsselects additional fallback families. The balanced default permits installed-font discovery without granting local-file or remote-resource access; usePdfResourcePolicy.CreatePortableDeterministic()when host fonts must not be inspected.- Per-operation conversion warnings through
PdfDocumentConversionResult.ReportorPdfSaveResult.Report.
Visual themes
var options = new MarkdownToPdfOptions {
PdfTheme = MarkdownPdfStyle.TechnicalDocument()
};
MarkdownDoc.Load("README.md").SaveAsPdf("README.pdf", options);
Built-in themes include Plain, WordLike, TechnicalDocument, GitHubLike, Compact, and Report. Front matter can select a theme with pdfTheme or pdf-theme.
MarkdownVisualTheme is the shared cross-format theme object. It accepts color schemes plus individual color overrides using either hex values such as #064e3b or OfficeIMO-style named colors such as SeaGreen and CornflowerBlue. MarkdownPdfStyle remains available when PDF-only details such as page decoration or low-level panel styles need to diverge.
Boundaries
- Markdown parsing and writing stay in
OfficeIMO.Markdown. - PDF layout and primitives stay in
OfficeIMO.Pdf. - This package maps Markdown structure to PDF structure and visual themes.
- Large visual-state inventories belong in deeper docs and tests, not this README.
Related packages
- OfficeIMO.Markdown - Markdown document model.
- OfficeIMO.Pdf - PDF engine.
- OfficeIMO.Html.Pdf - HTML/PDF bridge.
Targets and license
- Targets:
netstandard2.0,net8.0,net10.0. - License: MIT.
- Repository: EvotecIT/OfficeIMO
Dependency footprint
- External: None beyond the dependencies of its OfficeIMO format packages.
- OfficeIMO:
OfficeIMO.Markdown,OfficeIMO.Pdf, andOfficeIMO.Coreown parsing, themes, layout, rendering, and reports.
See the complete OfficeIMO package map for related formats and conversion paths.
| 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.Core (>= 3.4.2)
- OfficeIMO.Markdown (>= 3.4.2)
- OfficeIMO.Pdf (>= 3.4.2)
-
.NETStandard 2.0
- OfficeIMO.Core (>= 3.4.2)
- OfficeIMO.Markdown (>= 3.4.2)
- OfficeIMO.Pdf (>= 3.4.2)
-
net10.0
- OfficeIMO.Core (>= 3.4.2)
- OfficeIMO.Markdown (>= 3.4.2)
- OfficeIMO.Pdf (>= 3.4.2)
-
net8.0
- OfficeIMO.Core (>= 3.4.2)
- OfficeIMO.Markdown (>= 3.4.2)
- OfficeIMO.Pdf (>= 3.4.2)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on OfficeIMO.Markdown.Pdf:
| Package | Downloads |
|---|---|
|
OfficeIMO.OneNote.Pdf
First-party offline OneNote to PDF conversion for OfficeIMO. |
|
|
OfficeIMO.Latex.Pdf
Loss-aware LaTeX to PDF adapter over the first-party OfficeIMO Markdown and PDF engines. |
|
|
OfficeIMO.AsciiDoc.Pdf
Loss-aware AsciiDoc to PDF adapter over the first-party OfficeIMO Markdown and PDF engines. |
|
|
OfficeIMO
Document conversion and resumable batches over the OfficeIMO format libraries. |
|
|
OfficeIMO.Workflows
Typed local document workflows that compose first-party OfficeIMO conversion, PDF, and provenance capabilities. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.6.2 | 80 | 11/18/2026 |
| 3.6.1 | 300 | 11/10/2026 |
| 3.6.0 | 309 | 11/6/2026 |
| 3.5.3 | 296 | 10/31/2026 |
| 3.5.2 | 241 | 10/24/2026 |
| 3.5.1 | 586 | 10/16/2026 |
| 3.4.5 | 758 | 10/10/2026 |
| 3.4.4 | 371 | 9/27/2026 |
| 3.4.3 | 370 | 9/12/2026 |
| 3.4.2 | 292 | 9/9/2026 |
| 3.4.1 | 315 | 9/7/2026 |
| 3.4.0 | 256 | 9/6/2026 |
| 3.3.0 | 60,398 | 9/2/2026 |
| 3.2.7 | 227 | 8/29/2026 |
| 3.2.6 | 339 | 8/22/2026 |
| 3.2.5 | 327 | 8/21/2026 |
| 3.2.4 | 327 | 8/19/2026 |
| 3.2.3 | 241 | 8/17/2026 |
| 3.2.2 | 434 | 8/13/2026 |
| 3.2.1 | 361 | 8/11/2026 |