API Reference

Cmdlet

Set-OfficePdfBackgroundImage

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

Sets or clears a generated PDF page background image.

Remarks

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.

PS>


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.

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.

Syntax

Set-OfficePdfBackgroundImage [-Clear] [-Fit <Stretch|Contain|Cover>] [-Opacity <Nullable`1>] [-PassThru] [-Path <String>] [<CommonParameters>]
#
Parameter set: Context

Parameters

Clear SwitchParameter optionalposition: namedpipeline: False
Clear the generated PDF background image.
Fit OfficeImageFit optionalposition: namedpipeline: Falsevalues: 3
How the image should fit the page box.
Possible values: Stretch, Contain, Cover
Opacity Nullable`1 optionalposition: namedpipeline: False
Image opacity from 0 to 1.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the updated document.
Path String optionalposition: 0pipeline: Falsealiases: FilePath
Background image path.

Outputs

OfficeIMO.Pdf.PdfDocument

Set-OfficePdfBackgroundImage [-Clear] -Document <PdfDocument> [-Fit <Stretch|Contain|Cover>] [-Opacity <Nullable`1>] [-PassThru] [-Path <String>] [<CommonParameters>]
#
Parameter set: Document

Parameters

Clear SwitchParameter optionalposition: namedpipeline: False
Clear the generated PDF background image.
Document PdfDocument requiredposition: namedpipeline: True (ByValue)
PDF document to update outside the DSL context.
Fit OfficeImageFit optionalposition: namedpipeline: Falsevalues: 3
How the image should fit the page box.
Possible values: Stretch, Contain, Cover
Opacity Nullable`1 optionalposition: namedpipeline: False
Image opacity from 0 to 1.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the updated document.
Path String optionalposition: 0pipeline: Falsealiases: FilePath
Background image path.

Outputs

OfficeIMO.Pdf.PdfDocument