# ConvertTo-OfficePdfTextRun

Converts reusable Office text run specifications to native PDF text runs.

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 

Aliases: PdfNativeTextRun

**Module**

`PSWriteOffice`

**Aliases**

`PdfNativeTextRun`

**Inputs**

`System.Object`

**Outputs**

`OfficeIMO.Pdf.PdfTextRun`

**Source**

[ConvertToOfficePdfTextRunCommand.cs:29](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Pdf/ConvertToOfficePdfTextRunCommand.cs#L29) 

Converts reusable Office text run specifications to native PDF text runs.

## Syntax

```
ConvertTo-OfficePdfTextRun
[-Run] <Object>
[<CommonParameters>]
```

[#](#method-convertto-officepdftextrun-object)

Parameter set: `All Parameter Sets`

## Description

Use this adapter when an OfficeIMO PDF callback requires a native PdfTextRun, such as a rich generated header or footer. Styling remains owned by New-OfficeTextRun.

## Examples

### Create native styled runs for a generated PDF header.

```powershell
$label = New-OfficeTextRun -Text 'Service report ' -Bold -Color '#B42318' | ConvertTo-OfficePdfTextRun
$pageStyle = New-OfficeTextRun -Italic | ConvertTo-OfficePdfTextRun
Set-OfficePdfHeader -Compose {
    param($header)
    $null = $header.Text({
        param($text)
        $null = $text.Run($label).CurrentPage($pageStyle)
    })
}
```

The cross-format run specification stays PowerShell-friendly while the callback receives the native PDF run it requires.

## Parameters

**-Run Object requiredposition: 0pipeline: True (ByValue)**

One or more values accepted by New-OfficeTextRun, including run specifications and hashtables.

## 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:B1F38098A74087E27F1070B1242EAF76936A91821A3D3C1FF209696BA8372DBF -->
