# Set-OfficePdfBackgroundImage

Sets or clears a generated PDF page background image.

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 **727**

Forks **84**

Open issues **7**

Total downloads **5,275,783**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-24

Cmdlet 

Aliases: PdfBackgroundImage

**Module**

`PSWriteOffice`

**Aliases**

`PdfBackgroundImage`

**Inputs**

`OfficeIMO.Pdf.PdfDocument`

**Outputs**

`OfficeIMO.Pdf.PdfDocument`

**Source**

[SetOfficePdfBackgroundImageCommand.cs:25](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Pdf/SetOfficePdfBackgroundImageCommand.cs#L25) 

Sets or clears a generated PDF page background image.

## Syntax

```
Set-OfficePdfBackgroundImage
[-Clear]
[-Fit <Stretch|Contain|Cover>]
[-Opacity <Double>]
[-PassThru]
[[-Path] <String>]
[<CommonParameters>]
```

[#](#method-set-officepdfbackgroundimage-switchparameter-officeimagefit-double-switchparameter-string)

Parameter set: `Context`

```
Set-OfficePdfBackgroundImage
[-Clear]
-Document <PdfDocument>
[-Fit <Stretch|Contain|Cover>]
[-Opacity <Double>]
[-PassThru]
[[-Path] <String>]
[<CommonParameters>]
```

[#](#method-set-officepdfbackgroundimage-switchparameter-pdfdocument-officeimagefit-double-switchparameter-string)

Parameter set: `Document`

## Description

Background images are applied through OfficeIMO.Pdf and rendered behind normal generated content. Use low opacity for watermark-like page texture and -Clear to remove a previously configured background image.

## Examples

### Add a subtle background image.

```powershell
New-OfficePdf -Path .\Report.pdf {
  PdfBackgroundImage -Path .\letterhead.png -Fit Cover -Opacity 0.08
  PdfHeading 'Branded report'
}
```

Uses an image as a low-opacity page background.

## Parameters

**-Clear SwitchParameter optional**

Clear the generated PDF background image.

**-Fit OfficeImageFit optional**

How the image should fit the page box.

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

**-Opacity Double optional**

Image opacity from 0 to 1.

**-PassThru SwitchParameter optional**

Emit the updated document.

**-Path String optionalposition: 0aliases: FilePath**

Background image path.

**-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:5EE55A343AAEEDA82282351D1F04FBF1F8FDC3796B2522C17AD7D5F595AACDEC -->
