# Set-OfficePdfBackground

Sets or clears color, image and shape backgrounds in the enclosing PDF composition.

Cmdlet 

Aliases: PdfBackground

**Module**

`PSWriteOffice`

**Aliases**

`PdfBackground`

**Inputs**

`None`

**Source**

[SetOfficePdfBackgroundCommand.cs:14](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/Pdf/SetOfficePdfBackgroundCommand.cs#L14) 

Sets or clears color, image and shape backgrounds in the enclosing PDF composition.

## Syntax

```
Set-OfficePdfBackground
[-Color] <OfficeColor>
[<CommonParameters>]
```

[#](#method-set-officepdfbackground-officecolor)

Parameter set: `Color`

```
Set-OfficePdfBackground
[-Fit <Stretch|Contain|Cover>]
-ImagePath <String>
[-Opacity <Double>]
[<CommonParameters>]
```

[#](#method-set-officepdfbackground-officeimagefit-string-double)

Parameter set: `Image`

```
Set-OfficePdfBackground
-Clear
[-Target <All|Color|Image|Shapes>]
[<CommonParameters>]
```

[#](#method-set-officepdfbackground-switchparameter-officepdfbackgroundtarget)

Parameter set: `Clear`

## Examples

### Example 1

```powershell
Set-OfficePdfBackground -Color 'Value'
```

### Example 2

```powershell
Set-OfficePdfBackground -Clear
```

### Example 3

```powershell
Set-OfficePdfBackground -ImagePath 'C:\Path'
```

## Parameters

**-Color OfficeColor requiredposition: 0sets: Color**

Background color.

**-Fit OfficeImageFit optionalsets: Image**

How the background image fits the page.

Possible values: `Stretch`, `Contain`, `Cover`

**-ImagePath String requiredsets: Image**

Literal background image path.

**-Opacity Double optionalsets: Image**

Background image opacity.

**-Clear SwitchParameter requiredsets: Clear**

Clear the selected background decoration.

**-Target OfficePdfBackgroundTarget optionalsets: Clear**

Background decorations to clear.

Possible values: `All`, `Color`, `Image`, `Shapes`

## 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).

<!-- PowerForge markdown artifact sha256:9CCFED444DD97DCF3E27D784865E8602D90F7FD8A6D77756C648B42773C29D6D -->
