# Set-OfficePdfFooter

Sets a simple or fully composed running PDF footer.

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

**Module**

`PSWriteOffice`

**Aliases**

`PdfFooter`

**Inputs**

`OfficeIMO.Pdf.PdfDocument`

**Outputs**

`OfficeIMO.Pdf.PdfDocument`

**Source**

[SetOfficePdfFooterCommand.cs:39](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Pdf/SetOfficePdfFooterCommand.cs#L39) 

Sets a simple or fully composed running PDF footer.

## Syntax

```
Set-OfficePdfFooter
[-Align <Left|Center|Right|Justify>]
[-Compose <ScriptBlock>]
[-FontSize <Double>]
[-PassThru]
[[-Text] <String>]
[<CommonParameters>]
```

[#](#method-set-officepdffooter-pdfalign-scriptblock-double-switchparameter-string)

Parameter set: `Context`

```
Set-OfficePdfFooter
[-Align <Left|Center|Right|Justify>]
[-Compose <ScriptBlock>]
-Document <PdfDocument>
[-FontSize <Double>]
[-PassThru]
[[-Text] <String>]
[<CommonParameters>]
```

[#](#method-set-officepdffooter-pdfalign-scriptblock-pdfdocument-double-switchparameter-string)

Parameter set: `Document`

## Examples

### Add page numbers to a generated PDF.

```powershell
New-OfficePdf -Path .\Examples\Documents\PdfFooter.pdf {
    Set-OfficePdfFooter -Text 'Page {page} of {pages}' -Align Center -FontSize 8
    Add-OfficePdfHeading -Text 'Report with footer'
    Add-OfficePdfPageBreak
    Add-OfficePdfParagraph -Text 'The footer includes generated page numbers.'
}
```

Uses page placeholders in a running footer.

### Compose a styled footer with page tokens.

```powershell
New-OfficePdf -Path .\Examples\Documents\RichFooter.pdf {
    Set-OfficePdfFooter -Compose {
        param($footer)
        $label = New-OfficeTextRun -Text 'Confidential - page ' -Bold | ConvertTo-OfficePdfTextRun
        $pageStyle = New-OfficeTextRun -Italic | ConvertTo-OfficePdfTextRun
        $null = $footer.AlignRight().Text({
            param($text)
            $null = $text.Run($label).CurrentPage($pageStyle).Text(' of ').TotalPages($pageStyle)
        })
    }
    Add-OfficePdfParagraph -Text 'Generated report body.'
}
```

Styled page tokens remain live until the document is rendered.

## Parameters

**-Align PdfAlign optional**

Footer alignment.

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

**-Compose ScriptBlock optional**

Advanced footer composer. The script receives a PdfFooterBuilder and can configure default, first-page, and even-page text, zones, images, shapes, rich text, and page tokens.

**-FontSize Double optional**

Footer font size in PDF points.

**-PassThru SwitchParameter optional**

Emit the updated document.

**-Text String optionalposition: 0**

Footer text. Supports {page} and {pages}.

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

Compatibility parameter. Page composition is supported only inside New-OfficePdf.

## 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:6A342508B959FE5E3C15EB7FA35ED0AF2B843143FB4B1AA49F8BA860151F8AD5 -->
