Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Add-OfficePdfPageNumber

Aliases: PdfPageNumber
Module
PSWriteOffice
Aliases
PdfPageNumber
Inputs
None
Outputs
System.Void

Inserts a live page number (optionally 'of total') inside PdfHeader or PdfFooter.

Syntax

Add-OfficePdfPageNumber
[-BackgroundColor <OfficeColor>]
[-Baseline <Normal|Superscript|Subscript>]
[-Bold]
[-Color <OfficeColor>]
[-Font <String>]
[-IncludeTotal]
[-Italic]
[-Separator <String>]
[-Size <OfficeLength>]
[-Strikethrough]
[-Underline <OfficeTextDecorationStyle>]
[<CommonParameters>]
#
Parameter set: Context

Examples

Use the native OfficePdfPageNumber command.

New-OfficePdf -Path .\Numbered.pdf {
    PdfFooter {
        PdfText 'Page '
        PdfPageNumber -IncludeTotal
    }
    PdfParagraph 'Body text.'
}

Parameters

-BackgroundColor OfficeColor optional
BackgroundColor for this operation.
-Baseline PdfTextBaseline optional
Baseline for this operation.
Possible values: Normal, Superscript, Subscript
-Bold SwitchParameter optional
Bold for this operation.
-Color OfficeColor optional
Color for this operation.
-Font String optional
Font family name or standard PDF font; completes from the theme and registered fonts.
-IncludeTotal SwitchParameter optional
IncludeTotal for this operation.
-Italic SwitchParameter optional
Italic for this operation.
-Separator String optional
Separator for this operation.
-Size OfficeLength optional
Size for this operation.
-Strikethrough SwitchParameter optional
Strikethrough for this operation.
-Underline OfficeTextDecorationStyle optional
Shared underline style; bare -Underline means Single.
Possible values: Single, Double, Dotted, Dashed, Wavy, Words

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.