# Add-OfficePdfStamp

Stamps text, images, native canvas content or a PDF page onto existing PDFs.

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`OfficeIMO.Pdf.PdfDocument` `System.String[]`

**Outputs**

`OfficeIMO.Pdf.PdfDocument` `System.IO.FileInfo`

**Source**

[AddOfficePdfStampCommand.cs:14](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/Pdf/AddOfficePdfStampCommand.cs#L14) 

Stamps text, images, native canvas content or a PDF page onto existing PDFs.

## Syntax

```
Add-OfficePdfStamp
[-Behind]
[-Color <OfficeColor>]
[-Document <PdfDocument>]
[-Opacity <Double>]
[-Page <OfficePageSelector>]
[-PassThru]
[-Rotation <Double>]
[-Size <OfficeLength>]
-Text <String>
[-X <OfficeLength>]
[-Y <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#method-add-officepdfstamp-switchparameter-officecolor-pdfdocument-double-officepageselector-switchparameter-double-officelength-string-officelength-officelength-switchparameter-switchparameter)

Parameter set: `TextDocument`

```
Add-OfficePdfStamp
[-Behind]
[-Color <OfficeColor>]
[-IgnorePermissionRestrictions]
[-LoadOptions <PdfLoadOptions>]
[-Opacity <Double>]
-OutputPath <String>
[-Page <OfficePageSelector>]
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[-Rotation <Double>]
[-Size <OfficeLength>]
-Text <String>
[-X <OfficeLength>]
[-Y <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#member-0727bb11129c119d0890a33c)

Parameter set: `Text`

```
Add-OfficePdfStamp
[-Behind]
[-Color <OfficeColor>]
[-IgnorePermissionRestrictions]
[-LoadOptions <PdfLoadOptions>]
[-Opacity <Double>]
-OutputDirectory <String>
[-Page <OfficePageSelector>]
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[-Rotation <Double>]
[-Size <OfficeLength>]
-Text <String>
[-X <OfficeLength>]
[-Y <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#member-4742d143dcd4854fbf9cde18)

Parameter set: `TextDirectory`

```
Add-OfficePdfStamp
[-Behind]
[-Height <OfficeLength>]
[-IgnorePermissionRestrictions]
-ImagePath <String>
[-LoadOptions <PdfLoadOptions>]
[-Opacity <Double>]
-OutputPath <String>
[-Page <OfficePageSelector>]
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[-Rotation <Double>]
[-Width <OfficeLength>]
[-X <OfficeLength>]
[-Y <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#member-cdaeef0e14cd0c8a6a085a02)

Parameter set: `Image`

```
Add-OfficePdfStamp
[-Behind]
[-Height <OfficeLength>]
[-IgnorePermissionRestrictions]
-ImagePath <String>
[-LoadOptions <PdfLoadOptions>]
[-Opacity <Double>]
-OutputDirectory <String>
[-Page <OfficePageSelector>]
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[-Rotation <Double>]
[-Width <OfficeLength>]
[-X <OfficeLength>]
[-Y <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#member-3af333ce5d55816a076a57c7)

Parameter set: `ImageDirectory`

```
Add-OfficePdfStamp
[-Behind]
[-ConfigureRendering <ScriptBlock>]
-Content <ScriptBlock>
[-IgnorePermissionRestrictions]
[-LoadOptions <PdfLoadOptions>]
[-Opacity <Double>]
-OutputPath <String>
[-Page <OfficePageSelector>]
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[-Rotation <Double>]
[-X <OfficeLength>]
[-Y <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#member-44f96bf324aff45c3825f118)

Parameter set: `Content`

```
Add-OfficePdfStamp
[-Behind]
[-ConfigureRendering <ScriptBlock>]
-Content <ScriptBlock>
[-IgnorePermissionRestrictions]
[-LoadOptions <PdfLoadOptions>]
[-Opacity <Double>]
-OutputDirectory <String>
[-Page <OfficePageSelector>]
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[-Rotation <Double>]
[-X <OfficeLength>]
[-Y <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#member-c0785048151306d9ef1d425e)

Parameter set: `ContentDirectory`

```
Add-OfficePdfStamp
[-Behind]
[-Fit <Contain|Cover|Stretch>]
[-Height <OfficeLength>]
[-HorizontalAlignment <OfficeAlignment>]
[-IgnoreOverlayPermissionRestrictions]
[-IgnorePermissionRestrictions]
[-LoadOptions <PdfLoadOptions>]
[-Opacity <Double>]
-OutputPath <String>
[-OverlayLoadOptions <PdfLoadOptions>]
[-OverlayPage <Int32>]
[-OverlayPassword <SecureString>]
-OverlayPath <String>
[-Page <OfficePageSelector>]
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[-Rotation <Double>]
[-VerticalAlignment <Top|Center|Bottom>]
[-Width <OfficeLength>]
[-X <OfficeLength>]
[-Y <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#member-8b9d2cb0e743eb4ef3408e03)

Parameter set: `Page`

```
Add-OfficePdfStamp
[-Behind]
[-Fit <Contain|Cover|Stretch>]
[-Height <OfficeLength>]
[-HorizontalAlignment <OfficeAlignment>]
[-IgnoreOverlayPermissionRestrictions]
[-IgnorePermissionRestrictions]
[-LoadOptions <PdfLoadOptions>]
[-Opacity <Double>]
-OutputDirectory <String>
[-OverlayLoadOptions <PdfLoadOptions>]
[-OverlayPage <Int32>]
[-OverlayPassword <SecureString>]
-OverlayPath <String>
[-Page <OfficePageSelector>]
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[-Rotation <Double>]
[-VerticalAlignment <Top|Center|Bottom>]
[-Width <OfficeLength>]
[-X <OfficeLength>]
[-Y <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#member-80c654b4b39ca872edf7d6be)

Parameter set: `PageDirectory`

```
Add-OfficePdfStamp
[-Behind]
[-Color <OfficeColor>]
[-IgnorePermissionRestrictions]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
[-Opacity <Double>]
-OutputPath <String>
[-Page <OfficePageSelector>]
[-PassThru]
[-Password <SecureString>]
[-Rotation <Double>]
[-Size <OfficeLength>]
-Text <String>
[-X <OfficeLength>]
[-Y <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#member-34c69f3c1f9c1c80f06216df)

Parameter set: `TextLiteralPath`

```
Add-OfficePdfStamp
[-Behind]
[-Height <OfficeLength>]
[-IgnorePermissionRestrictions]
-ImagePath <String>
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
[-Opacity <Double>]
-OutputPath <String>
[-Page <OfficePageSelector>]
[-PassThru]
[-Password <SecureString>]
[-Rotation <Double>]
[-Width <OfficeLength>]
[-X <OfficeLength>]
[-Y <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#member-37000d1240a7dac33b125617)

Parameter set: `ImageLiteralPath`

```
Add-OfficePdfStamp
[-Behind]
[-ConfigureRendering <ScriptBlock>]
-Content <ScriptBlock>
[-IgnorePermissionRestrictions]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
[-Opacity <Double>]
-OutputPath <String>
[-Page <OfficePageSelector>]
[-PassThru]
[-Password <SecureString>]
[-Rotation <Double>]
[-X <OfficeLength>]
[-Y <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#member-ec613eccf6645bbba32d19f0)

Parameter set: `ContentLiteralPath`

```
Add-OfficePdfStamp
[-Behind]
[-Fit <Contain|Cover|Stretch>]
[-Height <OfficeLength>]
[-HorizontalAlignment <OfficeAlignment>]
[-IgnoreOverlayPermissionRestrictions]
[-IgnorePermissionRestrictions]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
[-Opacity <Double>]
-OutputPath <String>
[-OverlayLoadOptions <PdfLoadOptions>]
[-OverlayPage <Int32>]
[-OverlayPassword <SecureString>]
-OverlayPath <String>
[-Page <OfficePageSelector>]
[-PassThru]
[-Password <SecureString>]
[-Rotation <Double>]
[-VerticalAlignment <Top|Center|Bottom>]
[-Width <OfficeLength>]
[-X <OfficeLength>]
[-Y <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#member-16d95513686c1751344603a9)

Parameter set: `PageLiteralPath`

```
Add-OfficePdfStamp
[-Behind]
[-Color <OfficeColor>]
[-IgnorePermissionRestrictions]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
[-Opacity <Double>]
-OutputDirectory <String>
[-Page <OfficePageSelector>]
[-PassThru]
[-Password <SecureString>]
[-Rotation <Double>]
[-Size <OfficeLength>]
-Text <String>
[-X <OfficeLength>]
[-Y <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#member-496fd9cad8404e359955b93d)

Parameter set: `TextLiteralPathDirectory`

```
Add-OfficePdfStamp
[-Behind]
[-Height <OfficeLength>]
[-IgnorePermissionRestrictions]
-ImagePath <String>
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
[-Opacity <Double>]
-OutputDirectory <String>
[-Page <OfficePageSelector>]
[-PassThru]
[-Password <SecureString>]
[-Rotation <Double>]
[-Width <OfficeLength>]
[-X <OfficeLength>]
[-Y <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#member-0175d2d426ee20b61db358d2)

Parameter set: `ImageLiteralPathDirectory`

```
Add-OfficePdfStamp
[-Behind]
[-Document <PdfDocument>]
[-Height <OfficeLength>]
-ImagePath <String>
[-Opacity <Double>]
[-Page <OfficePageSelector>]
[-PassThru]
[-Rotation <Double>]
[-Width <OfficeLength>]
[-X <OfficeLength>]
[-Y <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#method-add-officepdfstamp-switchparameter-pdfdocument-officelength-string-double-officepageselector-switchparameter-double-officelength-officelength-officelength-switchparameter-switchparameter)

Parameter set: `ImageDocument`

```
Add-OfficePdfStamp
[-Behind]
[-ConfigureRendering <ScriptBlock>]
-Content <ScriptBlock>
[-IgnorePermissionRestrictions]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
[-Opacity <Double>]
-OutputDirectory <String>
[-Page <OfficePageSelector>]
[-PassThru]
[-Password <SecureString>]
[-Rotation <Double>]
[-X <OfficeLength>]
[-Y <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#member-ff9606727fa021d4b44c2112)

Parameter set: `ContentLiteralPathDirectory`

```
Add-OfficePdfStamp
[-Behind]
[-ConfigureRendering <ScriptBlock>]
[-Content] <ScriptBlock>
[-Document <PdfDocument>]
[-Opacity <Double>]
[-Page <OfficePageSelector>]
[-PassThru]
[-Rotation <Double>]
[-X <OfficeLength>]
[-Y <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#method-add-officepdfstamp-switchparameter-scriptblock-scriptblock-pdfdocument-double-officepageselector-switchparameter-double-officelength-officelength-switchparameter-switchparameter)

Parameter set: `ContentDocument`

```
Add-OfficePdfStamp
[-Behind]
[-Fit <Contain|Cover|Stretch>]
[-Height <OfficeLength>]
[-HorizontalAlignment <OfficeAlignment>]
[-IgnoreOverlayPermissionRestrictions]
[-IgnorePermissionRestrictions]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
[-Opacity <Double>]
-OutputDirectory <String>
[-OverlayLoadOptions <PdfLoadOptions>]
[-OverlayPage <Int32>]
[-OverlayPassword <SecureString>]
-OverlayPath <String>
[-Page <OfficePageSelector>]
[-PassThru]
[-Password <SecureString>]
[-Rotation <Double>]
[-VerticalAlignment <Top|Center|Bottom>]
[-Width <OfficeLength>]
[-X <OfficeLength>]
[-Y <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#member-4629a29f5faceb870c434f05)

Parameter set: `PageLiteralPathDirectory`

```
Add-OfficePdfStamp
[-Behind]
[-Document <PdfDocument>]
[-Fit <Contain|Cover|Stretch>]
[-Height <OfficeLength>]
[-HorizontalAlignment <OfficeAlignment>]
[-IgnoreOverlayPermissionRestrictions]
[-Opacity <Double>]
[-OverlayLoadOptions <PdfLoadOptions>]
[-OverlayPage <Int32>]
[-OverlayPassword <SecureString>]
-OverlayPath <String>
[-Page <OfficePageSelector>]
[-PassThru]
[-Rotation <Double>]
[-VerticalAlignment <Top|Center|Bottom>]
[-Width <OfficeLength>]
[-X <OfficeLength>]
[-Y <OfficeLength>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#member-280b3e418d63d6282927b7f4)

Parameter set: `PageDocument`

## Guides & Samples

Authored walkthroughs and practical samples linked to this command.

- [PSWriteOffice DSL Cookbook](/docs/pswriteoffice/dsl-cookbook/) Guide
  
  Copy complete PowerShell recipes for Word, Excel, PowerPoint, PDF, Markdown, and multi-format document jobs.
- [Position Text and Graphics on PDF Pages](/docs/pswriteoffice/pdf-positioned-content/) Guide
  
  Choose between flowing PDF text, positioned stamps, arbitrary page canvases, and imported page overlays with explicit coordinates.
- [Watermarks, Stamps, and Metadata](/docs/pdf/watermarks-stamps/) Guide
  
  Add text or image watermarks and stamps to new or existing PDFs and set title, author, and keywords with OfficeIMO.Pdf and PSWriteOffice.

## Examples

### Example 1

```powershell
Add-OfficePdfStamp -Text 'Value'
```

### Example 2

```powershell
Add-OfficePdfStamp -Path @('C:\Path') -OutputPath 'C:\Path' -Content { }
```

### Example 3

```powershell
Add-OfficePdfStamp -Path @('C:\Path') -OutputDirectory 'Value' -Content { }
```

## Parameters

**-Behind SwitchParameter optional**

Place the stamp behind existing page content.

**-Color OfficeColor optionalsets: TextDocument, Text, TextDirectory, TextLiteralPath, TextLiteralPathDirectory**

Native Color setting for the stamp.

**-Document PdfDocument optionalpipeline: True (ByValue)sets: TextDocument, ImageDocument, ContentDocument, PageDocument**

Caller-owned PDF; omission uses the enclosing editing block.

**-Opacity Double optional**

Native Opacity setting for the stamp.

**-Page OfficePageSelector optional**

Native one-based page selector, including last, odd and even.

**-PassThru SwitchParameter optional**

Return the saved FileInfo or the updated live document.

**-Rotation Double optional**

Native Rotation setting for the stamp.

**-Size OfficeLength optionalsets: TextDocument, Text, TextDirectory, TextLiteralPath, TextLiteralPathDirectory**

Text size; omission keeps the native 24-point default.

**-Text String requiredsets: TextDocument, Text, TextDirectory, TextLiteralPath, TextLiteralPathDirectory**

Literal text to stamp.

**-X OfficeLength optional**

Native X setting for the stamp.

**-Y OfficeLength optional**

Native Y setting for the stamp.

**-WhatIf SwitchParameter optional**

Shows what would happen if the command runs.

**-Confirm SwitchParameter optional**

Prompts for confirmation before running the command.

**-IgnorePermissionRestrictions SwitchParameter optionalsets: Text, TextDirectory, Image, ImageDirectory, Content, ContentDirectory, Page, PageDirectory, TextLiteralPath, ImageLiteralPath, ContentLiteralPath, PageLiteralPath, TextLiteralPathDirectory, ImageLiteralPathDirectory, ContentLiteralPathDirectory, PageLiteralPathDirectory**

After authentication, explicitly ignore owner-imposed restrictions.

**-LoadOptions PdfLoadOptions optionalsets: Text, TextDirectory, Image, ImageDirectory, Content, ContentDirectory, Page, PageDirectory, TextLiteralPath, ImageLiteralPath, ContentLiteralPath, PageLiteralPath, TextLiteralPathDirectory, ImageLiteralPathDirectory, ContentLiteralPathDirectory, PageLiteralPathDirectory**

Native input parsing, authentication and resource policy.

**-OutputPath String requiredsets: Text, Image, Content, Page, TextLiteralPath, ImageLiteralPath, ContentLiteralPath, PageLiteralPath**

Single output PDF file.

**-Password SecureString optionalsets: Text, TextDirectory, Image, ImageDirectory, Content, ContentDirectory, Page, PageDirectory, TextLiteralPath, ImageLiteralPath, ContentLiteralPath, PageLiteralPath, TextLiteralPathDirectory, ImageLiteralPathDirectory, ContentLiteralPathDirectory, PageLiteralPathDirectory**

Source PDF password.

**-Path String[] requiredposition: 0sets: Text, TextDirectory, Image, ImageDirectory, Content, ContentDirectory, Page, PageDirectory**

Input PDF files with FileSystem wildcard expansion.

**-OutputDirectory String requiredsets: TextDirectory, ImageDirectory, ContentDirectory, PageDirectory, TextLiteralPathDirectory, ImageLiteralPathDirectory, ContentLiteralPathDirectory, PageLiteralPathDirectory**

Output folder retaining source file names.

**-Height OfficeLength optionalsets: Image, ImageDirectory, Page, PageDirectory, ImageLiteralPath, PageLiteralPath, ImageLiteralPathDirectory, ImageDocument, PageLiteralPathDirectory, PageDocument**

Native Height setting for the stamp.

**-ImagePath String requiredsets: Image, ImageDirectory, ImageLiteralPath, ImageLiteralPathDirectory, ImageDocument**

Literal image file to stamp.

**-Width OfficeLength optionalsets: Image, ImageDirectory, Page, PageDirectory, ImageLiteralPath, PageLiteralPath, ImageLiteralPathDirectory, ImageDocument, PageLiteralPathDirectory, PageDocument**

Native Width setting for the stamp.

**-ConfigureRendering ScriptBlock optionalsets: Content, ContentDirectory, ContentLiteralPath, ContentLiteralPathDirectory, ContentDocument**

Configure native rendering options for the canvas callback.

**-Content ScriptBlock requiredsets: Content, ContentDirectory, ContentLiteralPath, ContentLiteralPathDirectory, ContentDocument**

Native canvas callback receiving the canvas and target page context.

**-Fit PdfPageOverlayFit optionalsets: Page, PageDirectory, PageLiteralPath, PageLiteralPathDirectory, PageDocument**

Native Fit setting for the stamp.

Possible values: `Contain`, `Cover`, `Stretch`

**-HorizontalAlignment OfficeAlignment optionalsets: Page, PageDirectory, PageLiteralPath, PageLiteralPathDirectory, PageDocument**

Native HorizontalAlignment setting for the stamp.

Possible values: `Left`, `Center`, `Right`, `Justify`, `Start`, `End`

**-IgnoreOverlayPermissionRestrictions SwitchParameter optionalsets: Page, PageDirectory, PageLiteralPath, PageLiteralPathDirectory, PageDocument**

After overlay authentication, explicitly ignore owner-imposed restrictions.

**-OverlayLoadOptions PdfLoadOptions optionalsets: Page, PageDirectory, PageLiteralPath, PageLiteralPathDirectory, PageDocument**

Native loading policy for the imported overlay PDF.

**-OverlayPage Int32 optionalsets: Page, PageDirectory, PageLiteralPath, PageLiteralPathDirectory, PageDocument**

One-based page imported from the overlay PDF.

**-OverlayPassword SecureString optionalsets: Page, PageDirectory, PageLiteralPath, PageLiteralPathDirectory, PageDocument**

Password for the imported overlay PDF.

**-OverlayPath String requiredsets: Page, PageDirectory, PageLiteralPath, PageLiteralPathDirectory, PageDocument**

Literal PDF file whose selected page is imported.

**-VerticalAlignment OfficeTextVerticalAlignment optionalsets: Page, PageDirectory, PageLiteralPath, PageLiteralPathDirectory, PageDocument**

Native VerticalAlignment setting for the stamp.

Possible values: `Top`, `Center`, `Bottom`

**-LiteralPath String[] requiredpipeline: True (ByPropertyName)aliases: FullName, PSPathsets: TextLiteralPath, ImageLiteralPath, ContentLiteralPath, PageLiteralPath, TextLiteralPathDirectory, ImageLiteralPathDirectory, ContentLiteralPathDirectory, PageLiteralPathDirectory**

Literal PDF files, including FileInfo.FullName.

## 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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

<!-- PowerForge markdown artifact sha256:53F9FACDC1D5E0A6C603C91447D47A85249737F0EB3E2BDAF9204542641CA800 -->
