# Add-OfficePdfText

Adds a rich inline-text paragraph to a generated PDF document.

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 **727**

Forks **84**

Open issues **7**

Total downloads **5,275,783**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-24

Cmdlet 

Aliases: PdfText

**Module**

`PSWriteOffice`

**Aliases**

`PdfText`

**Inputs**

`OfficeIMO.Pdf.PdfDocument`

**Outputs**

`OfficeIMO.Pdf.PdfDocument`

**Source**

[AddOfficePdfTextCommand.cs:37](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Pdf/AddOfficePdfTextCommand.cs#L37) 

Adds a rich inline-text paragraph to a generated PDF document.

## Syntax

```
Add-OfficePdfText
[-Align <Left|Center|Right|Justify>]
[-BackgroundColor <String>]
[-Baseline <Normal|Superscript|Subscript>]
[-Bold]
[-Color <String>]
[-Font <PdfStandardFont>]
[-FontSize <Double>]
[-Italic]
[-LinkContents <String>]
[-LinkDestinationName <String>]
[-LinkUri <String>]
[-PassThru]
[-Run <Object[]>]
[-Strike]
[[-Text] <String[]>]
[-Underline]
[<CommonParameters>]
```

[#](#member-62df627797381973c083df61)

Parameter set: `Context`

```
Add-OfficePdfText
[-Align <Left|Center|Right|Justify>]
[-BackgroundColor <String>]
[-Baseline <Normal|Superscript|Subscript>]
[-Bold]
[-Color <String>]
-Document <PdfDocument>
[-Font <PdfStandardFont>]
[-FontSize <Double>]
[-Italic]
[-LinkContents <String>]
[-LinkDestinationName <String>]
[-LinkUri <String>]
[-PassThru]
[-Run <Object[]>]
[-Strike]
[[-Text] <String[]>]
[-Underline]
[<CommonParameters>]
```

[#](#member-4ae87e0d68e32c12583cb3cb)

Parameter set: `Document`

## Description

Use Add-OfficePdfText when a paragraph needs mixed emphasis, highlight color, font settings, baseline changes, or links. Plain paragraphs can continue to use Add-OfficePdfParagraph. Rich text runs are translated directly to the OfficeIMO.Pdf paragraph builder. URI links and bookmark links are supported; a single run cannot target both.

## Examples

### Add styled text with the DSL alias.

```powershell
New-OfficePdf -Path .\Report.pdf { PdfText 'Approved for review' -Bold -Color '#0F766E' -BackgroundColor '#ECFDF5' }
```

Creates a PDF with one styled paragraph.

### Add mixed rich runs with URI and bookmark links.

```powershell
New-OfficePdf -Path .\Report.pdf {
  PdfBookmark 'summary'
  PdfText -Run @(
    @{ Text = 'Read the ' }
    @{ Text = 'website'; LinkUri = 'https://evotec.xyz'; Color = '#2563EB' }
    @{ Text = ' or jump to ' }
    @{ Text = 'summary'; LinkDestinationName = 'summary'; Color = '#7C3AED' }
    @{ Text = '.' }
  )
}
```

Creates one paragraph with an external link and an internal named-destination link.

## Parameters

**-Align PdfAlign optional**

Paragraph alignment.

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

**-BackgroundColor String optional**

Run background color for -Text input. Named colors and hexadecimal colors are accepted.

**-Baseline PdfTextBaseline optional**

Baseline for -Text input.

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

**-Bold SwitchParameter optional**

Make -Text input bold.

**-Color String optional**

Default paragraph color. Named colors and hexadecimal colors are accepted.

**-Font PdfStandardFont optional**

Standard PDF font for -Text input.

Possible values: `Helvetica`, `HelveticaOblique`, `HelveticaBold`, `HelveticaBoldOblique`, `TimesRoman`, `TimesItalic`, `TimesBold`, `TimesBoldItalic`, `Courier`, `CourierOblique`, `CourierBold`, `CourierBoldOblique`

**-FontSize Double optional**

Font size for -Text input in PDF points.

**-Italic SwitchParameter optional**

Make -Text input italic.

**-LinkContents String optional**

Optional link annotation contents for -Text input.

**-LinkDestinationName String optional**

Named destination link target for -Text input.

**-LinkUri String optional**

Absolute URI link target for -Text input.

**-PassThru SwitchParameter optional**

Emit the updated document.

**-Run Object[] optionalaliases: Runs**

Rich run specifications. Each run may define Text, Bold, Italic, Underline, Strike, Color, BackgroundColor, FontSize, Font, Baseline, LinkUri, LinkDestinationName, LinkContents, Type, or Kind.

**-Strike SwitchParameter optional**

Strike through -Text input.

**-Text String[] optionalposition: 0**

Plain text values to add as one styled paragraph.

**-Underline SwitchParameter optional**

Underline -Text input.

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

PDF document to update outside the DSL context.

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