# Add-OfficePdfText

Adds one styled run inside a PDF paragraph or running header/footer, or a standalone paragraph.

Cmdlet 

Aliases: PdfText

**Module**

`PSWriteOffice`

**Aliases**

`PdfText`

**Inputs**

`OfficeIMO.Pdf.PdfDocument`

**Outputs**

`OfficeIMO.Pdf.PdfDocument`

**Source**

[AddOfficePdfTextCommand.cs:16](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/Pdf/AddOfficePdfTextCommand.cs#L16) 

Adds one styled run inside a PDF paragraph or running header/footer, or a standalone paragraph.

## Syntax

```
Add-OfficePdfText
[-Alignment <OfficeAlignment>]
[-BackgroundColor <OfficeColor>]
[-Baseline <Normal|Superscript|Subscript>]
[-Bold]
[-Color <OfficeColor>]
[-Font <String>]
[-Italic]
[-Link <String>]
[-LinkBookmark <String>]
[-LinkContents <String>]
[-Size <OfficeLength>]
[-Strikethrough]
[-TabAlignment <Left|Right|Center|DecimalSeparator|Bar>]
[-TabLeader <Dots|Hyphens|Underscores>]
[-Text] <String>
[-Underline <OfficeTextDecorationStyle>]
[<CommonParameters>]
```

[#](#member-f3ba8d2c640044821f02f6ad)

Parameter set: `Context`

```
Add-OfficePdfText
[-Alignment <OfficeAlignment>]
[-BackgroundColor <OfficeColor>]
[-Baseline <Normal|Superscript|Subscript>]
[-Bold]
[-Color <OfficeColor>]
-Document <PdfDocument>
[-Font <String>]
[-Italic]
[-Link <String>]
[-LinkBookmark <String>]
[-LinkContents <String>]
[-PassThru]
[-Size <OfficeLength>]
[-Strikethrough]
[-TabAlignment <Left|Right|Center|DecimalSeparator|Bar>]
[-TabLeader <Dots|Hyphens|Underscores>]
[-Text] <String>
[-Underline <OfficeTextDecorationStyle>]
[<CommonParameters>]
```

[#](#member-cb3cba94680ed372fc3e23c1)

Parameter set: `Document`

## Guides & Samples

Authored walkthroughs and practical samples linked to this command.

- [PSWriteOffice DSL Cookbook](/docs/pswriteoffice/dsl-cookbook/) Guide
  
  Copy complete PowerShell recipes for Word, Excel, PowerPoint, PDF, Markdown, and multi-format document jobs.
- [Position Text and Graphics on PDF Pages](/docs/pswriteoffice/pdf-positioned-content/) Guide
  
  Choose between flowing PDF text, positioned stamps, arbitrary page canvases, and imported page overlays with explicit coordinates.

## Examples

### Compose rich PDF text.

```powershell
PdfParagraph { PdfText 'Review ' -Italic; PdfText 'complete' -Bold -Color Success }
```

## Parameters

**-Alignment OfficeAlignment optional**

Standalone paragraph alignment.

Possible values: `Left`, `Center`, `Right`, `Justify`, `Start`, `End`

**-BackgroundColor OfficeColor optional**

Run background color.

**-Baseline PdfTextBaseline optional**

Run baseline.

Possible values: `Normal`, `Superscript`, `Subscript`

**-Bold SwitchParameter optional**

Set bold on or off.

**-Color OfficeColor optional**

Run foreground color.

**-Font String optional**

Standard PDF font name or registered embedded family.

**-Italic SwitchParameter optional**

Set italic on or off.

**-Link String optional**

URI hyperlink target.

**-LinkBookmark String optional**

Named bookmark target.

**-LinkContents String optional**

Link annotation contents.

**-Size OfficeLength optional**

Font size; bare numbers mean points.

**-Strikethrough SwitchParameter optional**

Set strikethrough on or off.

**-TabAlignment PdfTabAlignment optional**

Alignment for an explicit tab text.

Possible values: `Left`, `Right`, `Center`, `DecimalSeparator`, `Bar`

**-TabLeader PdfTabLeaderStyle optional**

Leader pattern for an explicit tab text (a single tab character).

Possible values: `Dots`, `Hyphens`, `Underscores`

**-Text String requiredposition: 0**

Text for this run.

**-Underline OfficeTextDecorationStyle optional**

Underline pattern; None clears it.

Possible values: `Single`, `Double`, `Dotted`, `Dashed`, `Wavy`, `Words`

**-Document PdfDocument requiredpipeline: True (ByValue)sets: Document**

Live PDF outside a composition block.

**-PassThru SwitchParameter optionalsets: Document**

Emit the updated live document.

## 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).

<!-- PowerForge markdown artifact sha256:7BCADD01F59FCAA0961E11C48DC049BD34446A4EFDDBA245E3AC12457CECA146 -->
