# Export-OfficeDocumentPdf

Exports Word, Excel, PowerPoint, HTML, Markdown, RTF, and literal text documents to PDF.

Project

PSWriteOffice

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

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **725**

Forks **84**

Open issues **3**

Total downloads **5,231,343**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-23

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`System.Object` `System.Object[]` `System.String`

**Outputs**

`System.IO.FileInfo` `OfficeIMO.Workflows.OfficeConversionBatchResult` `OfficeIMO.Workflows.OfficeConversionBatchItemResult`

**Source**

[ExportOfficeDocumentPdfCommand.cs:62](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Pdf/ExportOfficeDocumentPdfCommand.cs#L62) 

Exports Word, Excel, PowerPoint, HTML, Markdown, RTF, and literal text documents to PDF.

## Syntax

```
Export-OfficeDocumentPdf
[-AllowLegacyImportLoss]
[-Document] <Object>
[-ExcelOptions <ExcelToPdfOptions>]
[-HtmlOptions <HtmlToPdfOptions>]
[-MarkdownOptions <MarkdownToPdfOptions>]
[-MaximumInputBytes <Int64>]
[-Open]
[-PassThru]
[-Password <String>]
[-Path] <String>
[-PdfConversionReportVariable <String>]
[-PdfWarningVariable <String>]
[-PowerPointOptions <PowerPointToPdfOptions>]
[-RtfOptions <RtfToPdfOptions>]
[-SourceConversionReportVariable <String>]
[-TextOptions <PdfPlainTextOptions>]
[-WordOptions <WordToPdfOptions>]
[<CommonParameters>]
```

[#](#member-e9c2e7596948f4df7da5d027)

Parameter set: `Document`

```
Export-OfficeDocumentPdf
[-AllowLegacyImportLoss]
[-CheckpointDirectory <String>]
[-ConflictPolicy <Fail|Rename|Replace>]
[-ConversionRouteId <String>]
[-ExcelOptions <ExcelToPdfOptions>]
[-HtmlOptions <HtmlToPdfOptions>]
-InputDirectory <String>
[-ItemResults]
[-MarkdownOptions <MarkdownToPdfOptions>]
[-MaximumConcurrency <Int32>]
[-MaximumFiles <Int32>]
[-MaximumInputBytes <Int64>]
[-MaximumOutputBytes <Int64>]
[-NoRecurse]
-OutputDirectory <String>
[-Password <String>]
[-PowerPointOptions <PowerPointToPdfOptions>]
[-RetryFailed]
[-RtfOptions <RtfToPdfOptions>]
[-SourceExtensions <String[]>]
[-SummaryVariable <String>]
[-TextOptions <PdfPlainTextOptions>]
[-WordOptions <WordToPdfOptions>]
[<CommonParameters>]
```

[#](#member-69d1f5b500b53462dfa7e764)

Parameter set: `Directory`

```
Export-OfficeDocumentPdf
[-AllowLegacyImportLoss]
[-CheckpointDirectory <String>]
[-ConflictPolicy <Fail|Rename|Replace>]
[-ConversionRouteId <String>]
[-ExcelOptions <ExcelToPdfOptions>]
[-HtmlOptions <HtmlToPdfOptions>]
-InputPaths <Object[]>
[-ItemResults]
[-MarkdownOptions <MarkdownToPdfOptions>]
[-MaximumConcurrency <Int32>]
[-MaximumFiles <Int32>]
[-MaximumInputBytes <Int64>]
[-MaximumOutputBytes <Int64>]
-OutputDirectory <String>
[-Password <String>]
[-PowerPointOptions <PowerPointToPdfOptions>]
[-RetryFailed]
[-RtfOptions <RtfToPdfOptions>]
[-SummaryVariable <String>]
[-TextOptions <PdfPlainTextOptions>]
[-WordOptions <WordToPdfOptions>]
[<CommonParameters>]
```

[#](#member-0492b1969df817ca98579344)

Parameter set: `Files`

```
Export-OfficeDocumentPdf
[-AllowLegacyImportLoss]
[-ExcelOptions <ExcelToPdfOptions>]
[-HtmlOptions <HtmlToPdfOptions>]
[-InputPath] <String>
[-MarkdownOptions <MarkdownToPdfOptions>]
[-MaximumInputBytes <Int64>]
[-Open]
[-PassThru]
[-Password <String>]
[-Path] <String>
[-PdfConversionReportVariable <String>]
[-PdfWarningVariable <String>]
[-PowerPointOptions <PowerPointToPdfOptions>]
[-RtfOptions <RtfToPdfOptions>]
[-SourceConversionReportVariable <String>]
[-TextOptions <PdfPlainTextOptions>]
[-WordOptions <WordToPdfOptions>]
[<CommonParameters>]
```

[#](#member-f0bd07ab455835c4eb7d60da)

Parameter set: `Path`

## Description

Accepts live OfficeIMO documents, individual files, directories, and selected file pipelines. Directory and file batches require PowerShell 7.4 or newer.

## Examples

### Export a live Word document.

```powershell
$document | Export-OfficeDocumentPdf -Path .\Report.pdf
```

### Export a supported file without opening it explicitly.

```powershell
Export-OfficeDocumentPdf -InputPath .\Report.docx -Path .\Report.pdf -PassThru
```

### Configure Markdown PDF export with ordinary PowerShell parameters.

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

Typed conversion options also apply to the matching formats in a mixed batch.

### Export a directory with optional checkpoints.

```powershell
Export-OfficeDocumentPdf -InputDirectory .\Documents -OutputDirectory .\PDF -CheckpointDirectory .\PDF-State
```

### Stream selected file outcomes and retain the final summary.

```powershell
Get-ChildItem .\Documents -File | Export-OfficeDocumentPdf -OutputDirectory .\PDF -ItemResults -SummaryVariable summary
```

## Parameters

**-AllowLegacyImportLoss SwitchParameter optional**

Accept reported legacy DOC import loss. Known loss otherwise blocks conversion.

**-Document Object requiredposition: 0pipeline: True (ByValue)sets: Document**

Live Word, Excel, PowerPoint, HTML, Markdown, or RTF document to export. Saved FileInfo and path strings from the pipeline are opened automatically.

**-ExcelOptions ExcelToPdfOptions optional**

Excel-specific PDF options.

**-HtmlOptions HtmlToPdfOptions optional**

HTML-specific PDF rendering options.

**-MarkdownOptions MarkdownToPdfOptions optional**

Markdown-specific PDF options.

**-MaximumInputBytes Int64 optional**

Maximum source bytes for DOC and TXT import.

**-Open SwitchParameter optionalaliases: Showsets: Document, Path**

Open the PDF after exporting it.

**-PassThru SwitchParameter optionalsets: Document, Path**

Emit the saved PDF file.

**-Password String optional**

Password used to open an encrypted Word, Excel, or PowerPoint source file.

**-Path String requiredposition: 1aliases: FilePath, OutputPathsets: Document, Path**

Destination PDF path.

**-PdfConversionReportVariable String optionalsets: Document, Path**

Variable name that receives the structured PDF conversion report.

**-PdfWarningVariable String optionalsets: Document, Path**

Variable name that receives structured PDF conversion warnings.

**-PowerPointOptions PowerPointToPdfOptions optional**

PowerPoint-specific PDF options.

**-RtfOptions RtfToPdfOptions optional**

RTF-specific PDF options.

**-SourceConversionReportVariable String optionalsets: Document, Path**

Variable receiving source-stage reports separately from PDF rendering diagnostics.

**-TextOptions PdfPlainTextOptions optional**

Literal text layout and strict decoding options. Applies only to TXT sources.

**-WordOptions WordToPdfOptions optional**

Word-specific PDF options.

**-CheckpointDirectory String optionalsets: Directory, Files**

Optional durable state directory. Completed sources and outputs are hash-verified on restart.

**-ConflictPolicy String optionalsets: Directory, Files**

Destination conflict policy. Durable checkpoint jobs require Fail.

Possible values: `Fail`, `Rename`, `Replace`

**-ConversionRouteId String optionalsets: Directory, Files**

Explicit executable conversion route, for example html-pdf for HTML stored in TXT files. By default the catalog selects each file's PDF route.

**-InputDirectory String requiredsets: Directory**

Source directory for mixed-format PDF export. Batch execution requires PowerShell 7.4 or newer.

**-ItemResults SwitchParameter optionalsets: Directory, Files**

Stream every structured per-file outcome instead of the final summary. Summary mode reports at most 100 detailed failure warnings and one suppressed-count warning.

**-MaximumConcurrency Int32 optionalsets: Directory, Files**

Concurrent conversions. Default two; bounds keep the batch resource budget explicit.

**-MaximumFiles Int32 optionalsets: Directory, Files**

Maximum discovered or explicitly selected source files.

**-MaximumOutputBytes Int64 optionalsets: Directory, Files**

Maximum output bytes per document.

**-NoRecurse SwitchParameter optionalsets: Directory**

Exclude descendants when selecting a directory.

**-OutputDirectory String requiredsets: Directory, Files**

PDF destination directory. Source names retain their extension plus .pdf.

**-RetryFailed SwitchParameter optionalsets: Directory, Files**

Retry recorded failures; completed items remain protected.

**-SourceExtensions String[] optionalsets: Directory**

Restrict directory discovery to these source extensions. Other files are reported as skipped.

**-SummaryVariable String optionalsets: Directory, Files**

Variable receiving the bounded batch summary, including when ItemResults is selected.

**-InputPaths Object[] requiredpipeline: True (ByValue, ByPropertyName)aliases: SourcePathssets: Files**

Explicit source paths or FileInfo objects from Get-ChildItem.

**-InputPath String requiredposition: 0pipeline: True (ByPropertyName)aliases: FullName, SourcePathsets: Path**

Source .doc, .docx, .txt, .xlsx, .pptx, .html, .htm, .xhtml, .md, .markdown, or .rtf file.

## 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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:81D41B045FA26E43258BADA862655F1DACB77997236CA52CDA47744DE89E99F6 -->
