Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
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

Authored help example

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.