Cmdlet
Set-OfficePdfBackgroundImage
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:
ContextSet-OfficePdfBackgroundImage
[-Clear]
-Document <PdfDocument>
[-Fit <Stretch| Contain| Cover>]
[-Opacity <Double>]
[-PassThru]
[[-Path] <String>]
[<CommonParameters>]#Parameter set:
DocumentDescription
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
- Clear the generated PDF background image.
- -Fit OfficeImageFit
- How the image should fit the page box.
- Possible values:
Stretch,Contain,Cover - -Opacity Double
- Image opacity from 0 to 1.
- -PassThru SwitchParameter
- Emit the updated document.
- -Path String
- Background image path.
- -Document PdfDocument
- 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.