# Add-OfficePdfCanvasText

Adds PowerShell-friendly text or rich text runs to the active fixed-position PDF canvas.

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: PdfCanvasText

**Module**

`PSWriteOffice`

**Aliases**

`PdfCanvasText`

**Inputs**

`None`

**Source**

[AddOfficePdfCanvasTextCommand.cs:30](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Pdf/AddOfficePdfCanvasTextCommand.cs#L30) 

Adds PowerShell-friendly text or rich text runs to the active fixed-position PDF canvas.

## Syntax

```
Add-OfficePdfCanvasText
[-Align <Left|Center|Right|Justify>]
[-BackgroundColor <String>]
[-Baseline <Normal|Superscript|Subscript>]
[-Bold]
[-Color <String>]
[-Font <PdfStandardFont>]
[-FontSize <Double>]
[-Height <Double>]
[-Italic]
[-LineHeight <Double>]
[-PassThru]
[-Strike]
[-Text] <String[]>
[-Underline]
[-Width <Double>]
-X <Double>
-Y <Double>
[<CommonParameters>]
```

[#](#member-7a2149500482aadda26e6569)

Parameter set: `Text`

```
Add-OfficePdfCanvasText
[-Align <Left|Center|Right|Justify>]
[-Color <String>]
[-FontSize <Double>]
[-Height <Double>]
[-LineHeight <Double>]
[-PassThru]
-Run <Object[]>
[-Width <Double>]
-X <Double>
-Y <Double>
[<CommonParameters>]
```

[#](#method-add-officepdfcanvastext-pdfalign-string-double-double-double-switchparameter-object-double-double-double)

Parameter set: `Run`

## Description

Use this command inside Add-OfficePdfCanvas -Content. Coordinates are PDF points measured from the visual top-left of the page. Rich runs accept TextRun output, hashtables, and objects; callers do not need to construct native PdfTextRun arrays. Fixed-position canvas runs are visual text and do not support link targets. Width and height default to the remaining page area from the supplied coordinates.

## Examples

### Place mixed-format text on each selected page.

```powershell
Add-OfficePdfCanvas -Path .\Report.pdf -OutputPath .\Stamped.pdf -Content {
    PdfCanvasText -Run @(
      TextRun 'Owner: ' -Bold
      TextRun 'Platform' -Color '#0F766E'
    ) -X 36 -Y 24 -FontSize 10
}
```

The enclosing callback supplies the active page, while the run collection remains an ordinary PowerShell array.

## Parameters

**-Align PdfAlign optional**

Text alignment within the positioned rectangle.

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

**-BackgroundColor String optionalsets: Text**

Background color for plain -Text input.

**-Baseline PdfTextBaseline optionalsets: Text**

Baseline for plain -Text input.

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

**-Bold SwitchParameter optionalsets: Text**

Make plain -Text input bold.

**-Color String optional**

Default text color. Named and hexadecimal colors are accepted.

**-Font PdfStandardFont optionalsets: Text**

Standard PDF font for plain -Text input.

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

**-FontSize Double optional**

Default font size in PDF points.

**-Height Double optional**

Available text height in PDF points. Defaults to the remaining page height.

**-Italic SwitchParameter optionalsets: Text**

Make plain -Text input italic.

**-LineHeight Double optional**

Optional line height in PDF points.

**-PassThru SwitchParameter optional**

Emit the object created or changed by the command.

**-Strike SwitchParameter optionalsets: Text**

Strike through plain -Text input.

**-Text String[] requiredposition: 0sets: Text**

Plain text values to concatenate into one positioned text block.

**-Underline SwitchParameter optionalsets: Text**

Underline plain -Text input.

**-Width Double optional**

Available text width in PDF points. Defaults to the remaining page width.

**-X Double requiredaliases: Left**

Horizontal position in PDF points from the visual left edge.

**-Y Double requiredaliases: Top**

Vertical position in PDF points from the visual top edge.

**-Run Object[] requiredaliases: Runssets: Run**

Rich run specifications created with TextRun or supplied as hashtables or objects. Link targets are not supported.

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