Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

Stars 654
Forks 82
Open issues 1
Total downloads 4,320,051
Release OfficeIMO-v3.5.3
Language: C# Updated: 2026-11-03
Cmdlet

Set-OfficePdfBackgroundImage

Aliases: PdfBackgroundImage
Module
PSWriteOffice
Aliases
PdfBackgroundImage
Inputs
OfficeIMO.Pdf.PdfDocument
Outputs
OfficeIMO.Pdf.PdfDocument

Sets or clears a generated PDF page background image.

Syntax

Set-OfficePdfBackgroundImage
[-Clear]
[-Fit <Stretch|Contain|Cover>]
[-Opacity <Double>]
[-PassThru]
[[-Path] <String>]
[<CommonParameters>]
#
Parameter set: Context
Set-OfficePdfBackgroundImage
[-Clear]
-Document <PdfDocument>
[-Fit <Stretch|Contain|Cover>]
[-Opacity <Double>]
[-PassThru]
[[-Path] <String>]
[<CommonParameters>]
#
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.

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.