API Reference
Cmdlet
Set-OfficePdfFooter
Sets a simple or fully composed running PDF footer.
Remarks
Sets a simple or fully composed running PDF footer.
Examples
Example 1: 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.
Example 2: 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.