Project

PSWriteOffice

PowerShell document automation across Word, Excel, PowerPoint, PDF, Reader, Confluence, Visio, and open text formats.

Stars 159
Forks 14
PowerShell Gallery downloads 158,661
Release v3.0.5
Language: C# Updated: 2026-09-03

API Reference

Cmdlet

Set-OfficePdfFooter

Aliases: PdfFooter
Namespace PSWriteOffice
Aliases
PdfFooter
Inputs
OfficeIMO.Pdf.PdfDocument
Outputs
OfficeIMO.Pdf.PdfDocument

Sets a simple or fully composed running PDF footer.

Remarks

Sets a simple or fully composed running PDF footer.

Examples

Authored help example

Add page numbers to a generated PDF.

PS>


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.

PS>


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.

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.

Syntax

Set-OfficePdfFooter [-Align <Left|Center|Right|Justify>] [-Compose <ScriptBlock>] [-FontSize <Double>] [-PassThru] [-Text <String>] [<CommonParameters>]
#
Parameter set: Context

Parameters

Align PdfAlign optionalposition: namedpipeline: Falsevalues: 4
Footer alignment.
Possible values: Left, Center, Right, Justify
Compose ScriptBlock optionalposition: namedpipeline: False
Advanced footer composer. The script receives a PdfFooterCompose and can configure default, first-page, and even-page text, zones, images, shapes, rich text, and page tokens.
FontSize Double optionalposition: namedpipeline: False
Footer font size in PDF points.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the updated document.
Text String optionalposition: 0pipeline: False
Footer text. Supports {page} and {pages}.

Outputs

OfficeIMO.Pdf.PdfDocument

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

Parameters

Align PdfAlign optionalposition: namedpipeline: Falsevalues: 4
Footer alignment.
Possible values: Left, Center, Right, Justify
Compose ScriptBlock optionalposition: namedpipeline: False
Advanced footer composer. The script receives a PdfFooterCompose and can configure default, first-page, and even-page text, zones, images, shapes, rich text, and page tokens.
Document PdfDocument requiredposition: namedpipeline: True (ByValue)
Compatibility parameter. Page composition is supported only inside New-OfficePdf with OfficeIMO 3.2.
FontSize Double optionalposition: namedpipeline: False
Footer font size in PDF points.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the updated document.
Text String optionalposition: 0pipeline: False
Footer text. Supports {page} and {pages}.

Outputs

OfficeIMO.Pdf.PdfDocument