Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Add-OfficePdfWatermark

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

Adds a generated-document text watermark.

Syntax

Add-OfficePdfWatermark [-Color <String>] [-FontSize <Double>] [-Opacity <Double>] [-PassThru] [-RotationAngle <Double>] [-Text] <String> [<CommonParameters>]
#
Parameter set: Context
Add-OfficePdfWatermark [-Color <String>] -Document <PdfDocument> [-FontSize <Double>] [-Opacity <Double>] [-PassThru] [-RotationAngle <Double>] [-Text] <String> [<CommonParameters>]
#
Parameter set: Document

Examples

Authored help example

Add a draft watermark to every generated page.

New-OfficePdf -Path .\Examples\Documents\PdfWatermark.pdf {
    Add-OfficePdfWatermark -Text 'DRAFT' -FontSize 72 -Opacity 0.12 -RotationAngle -35 -Color '#64748B'
    Add-OfficePdfHeading -Text 'Draft service review'
    Add-OfficePdfParagraph -Text 'This copy is not final.'
}

Adds a text watermark while generating the PDF.

Parameters

-Color String optional
Optional watermark color. Named colors and hexadecimal values are accepted.
-FontSize Double optional
Watermark font size.
-Opacity Double optional
Watermark opacity, 0 through 1.
-PassThru SwitchParameter optional
Emit the updated document.
-RotationAngle Double optional
Watermark rotation angle.
-Text String requiredposition: 0
Watermark text.
-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.