# Set-OfficePdfPageBorder

Sets or clears the generated PDF page border decoration.

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

**Module**

`PSWriteOffice`

**Aliases**

`PdfPageBorder`

**Inputs**

`OfficeIMO.Pdf.PdfDocument`

**Outputs**

`OfficeIMO.Pdf.PdfDocument`

**Source**

[SetOfficePdfPageBorderCommand.cs:21](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Pdf/SetOfficePdfPageBorderCommand.cs#L21) 

Sets or clears the generated PDF page border decoration.

## Syntax

```
Set-OfficePdfPageBorder
[-Clear]
[-Color <String>]
[-DashStyle <Solid|Dash|Dot|DashDot|DashDotDot>]
[-Inset <Double>]
[-Opacity <Double>]
[-PassThru]
[-Width <Double>]
[<CommonParameters>]
```

[#](#method-set-officepdfpageborder-switchparameter-string-officestrokedashstyle-double-double-switchparameter-double)

Parameter set: `Context`

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

[#](#method-set-officepdfpageborder-switchparameter-string-officestrokedashstyle-pdfdocument-double-double-switchparameter-double)

Parameter set: `Document`

## Examples

### Add a subtle page border.

```powershell
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.

## Parameters

**-Clear SwitchParameter optional**

Clear the generated PDF page border decoration.

**-Color String optional**

Border color. Named colors and hexadecimal values are accepted.

**-DashStyle OfficeStrokeDashStyle optional**

Border dash style.

Possible values: `Solid`, `Dash`, `Dot`, `DashDot`, `DashDotDot`

**-Inset Double optional**

Distance from the page edge to the border path in PDF points.

**-Opacity Double optional**

Border opacity from 0 through 1.

**-PassThru SwitchParameter optional**

Emit the updated document.

**-Width Double optional**

Border stroke width in PDF points.

**-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:F1963C2692C8433DDAD0E661CFA26D7E25098E49214EE5F310A71AB1D3C6FAF8 -->
