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-OfficePdfPageBorder

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

Sets or clears the generated PDF page border decoration.

Remarks

Sets or clears the generated PDF page border decoration.

Examples

Authored help example

Add a subtle page border.

PS>


New-OfficePdf -Path .\Examples\Documents\PdfPageBorder.pdf {
                Set-OfficePdfPageBorder -Color '#CBD5E1' -Width 0.75 -Inset 24 -Opacity 0.8
                Add-OfficePdfHeading -Text 'Bordered report'
            }
        

Decorates generated pages with an OfficeIMO.Pdf page border.

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-OfficePdfPageBorder [-Clear] [-Color <String>] [-DashStyle <Solid|Dash|Dot|DashDot|DashDotDot>] [-Inset <Double>] [-Opacity <Double>] [-PassThru] [-Width <Double>] [<CommonParameters>]
#
Parameter set: Context

Parameters

Clear SwitchParameter optionalposition: namedpipeline: False
Clear the generated PDF page border decoration.
Color String optionalposition: namedpipeline: False
Border color. Named colors and hexadecimal values are accepted.
DashStyle OfficeStrokeDashStyle optionalposition: namedpipeline: Falsevalues: 5
Border dash style.
Possible values: Solid, Dash, Dot, DashDot, DashDotDot
Inset Double optionalposition: namedpipeline: False
Distance from the page edge to the border path in PDF points.
Opacity Double optionalposition: namedpipeline: False
Border opacity from 0 through 1.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the updated document.
Width Double optionalposition: namedpipeline: False
Border stroke width in PDF points.

Outputs

OfficeIMO.Pdf.PdfDocument

Set-OfficePdfPageBorder [-Clear] [-Color <String>] [-DashStyle <Solid|Dash|Dot|DashDot|DashDotDot>] -Document <PdfDocument> [-Inset <Double>] [-Opacity <Double>] [-PassThru] [-Width <Double>] [<CommonParameters>]
#
Parameter set: Document

Parameters

Clear SwitchParameter optionalposition: namedpipeline: False
Clear the generated PDF page border decoration.
Color String optionalposition: namedpipeline: False
Border color. Named colors and hexadecimal values are accepted.
DashStyle OfficeStrokeDashStyle optionalposition: namedpipeline: Falsevalues: 5
Border dash style.
Possible values: Solid, Dash, Dot, DashDot, DashDotDot
Document PdfDocument requiredposition: namedpipeline: True (ByValue)
Compatibility parameter. Page composition is supported only inside New-OfficePdf with OfficeIMO 3.2.
Inset Double optionalposition: namedpipeline: False
Distance from the page edge to the border path in PDF points.
Opacity Double optionalposition: namedpipeline: False
Border opacity from 0 through 1.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the updated document.
Width Double optionalposition: namedpipeline: False
Border stroke width in PDF points.

Outputs

OfficeIMO.Pdf.PdfDocument