Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

Stars 654
Forks 82
Open issues 1
Total downloads 4,320,051
Release OfficeIMO-v3.5.3
Language: C# Updated: 2026-11-03
Cmdlet

New-OfficeMarkdownPdfOptions

Module
PSWriteOffice
Inputs
OfficeIMO.Markdown.Pdf.MarkdownToPdfOptions
Outputs
OfficeIMO.Markdown.Pdf.MarkdownToPdfOptions

Creates discoverable Markdown-to-PDF conversion options for Export-OfficeDocumentPdf.

Syntax

New-OfficeMarkdownPdfOptions
[-ApplyWordLikeTheme]
[-Author <String>]
[-BaseDirectory <String>]
[-CreateOutlineFromHeadings]
[-DefaultImageHeight <Double>]
[-DefaultImageWidth <Double>]
[-FontFamily <String>]
[-FrontMatterRenderMode <Hidden|DocumentHeader|Table>]
[-IncludeDataUriImages]
[-IncludeLocalImages]
[-Keywords <String>]
[-MaximumDataUriImageBytes <Int32>]
[-Options <MarkdownToPdfOptions>]
[-PdfOptions <PdfOptions>]
[-RestrictLocalImagesToBaseDirectory]
[-Subject <String>]
[-Theme <OfficeVisualThemeKind>]
[-Title <String>]
[-UseFirstHeadingAsTitle]
[-UseFrontMatterMetadata]
[-UseFrontMatterVisualTheme]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Examples

Allow local report images and apply PDF metadata.

$options = New-OfficeMarkdownPdfOptions -Title 'Service report' -Author 'Evotec' -IncludeLocalImages -BaseDirectory .\Assets
Export-OfficeDocumentPdf -InputPath .\Report.md -Path .\Report.pdf -MarkdownOptions $options

Builds a typed options object through ordinary PowerShell parameters; no hashtable or .NET construction is required.

Parameters

-ApplyWordLikeTheme SwitchParameter optional
Apply the built-in Word-like Markdown PDF baseline theme.
-Author String optional
PDF author metadata.
-BaseDirectory String optional
Base directory used to resolve local Markdown images.
-CreateOutlineFromHeadings SwitchParameter optional
Create PDF outlines from Markdown headings.
-DefaultImageHeight Double optional
Fallback image height in PDF points.
-DefaultImageWidth Double optional
Fallback image width in PDF points.
-FontFamily String optional
Default font family.
-FrontMatterRenderMode MarkdownPdfFrontMatterRenderMode optional
Controls how YAML front matter appears in the PDF body.
Possible values: Hidden, DocumentHeader, Table
-IncludeDataUriImages SwitchParameter optional
Embed supported data URI images.
-IncludeLocalImages SwitchParameter optional
Embed supported local image files.
-Keywords String optional
PDF keywords metadata.
-MaximumDataUriImageBytes Int32 optional
Maximum decoded bytes for one data URI image.
-Options MarkdownToPdfOptions optionalpipeline: True (ByValue)
Existing Markdown PDF options to clone and override.
-PdfOptions PdfOptions optional
Underlying low-level OfficeIMO PDF options.
-RestrictLocalImagesToBaseDirectory SwitchParameter optional
Require local images to resolve under BaseDirectory.
-Subject String optional
PDF subject metadata.
-Theme OfficeVisualThemeKind optional
Built-in visual theme.
Possible values: Plain, WordLike, TechnicalDocument, GitHubLike, Compact, Report
-Title String optional
PDF title metadata.
-UseFirstHeadingAsTitle SwitchParameter optional
Use the first Markdown heading as the PDF title when no title is supplied.
-UseFrontMatterMetadata SwitchParameter optional
Use front matter values as PDF metadata.
-UseFrontMatterVisualTheme SwitchParameter optional
Use front matter values to select a visual theme.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.