# Set-OfficePdfMetadata

Updates metadata on a generated PDF, an open editing block, or file copies.

Cmdlet 

Aliases: PdfMetadata

**Module**

`PSWriteOffice`

**Aliases**

`PdfMetadata`

**Inputs**

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

**Outputs**

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

**Source**

[SetOfficePdfMetadataCommand.cs:17](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/Pdf/SetOfficePdfMetadataCommand.cs#L17) 

Updates metadata on a generated PDF, an open editing block, or file copies.

## Syntax

```
Set-OfficePdfMetadata
[-Author <String>]
[-Keywords <String>]
[-Subject <String>]
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#method-set-officepdfmetadata-string-string-string-string-switchparameter-switchparameter)

Parameter set: `Context`

```
Set-OfficePdfMetadata
[-Author <String>]
-Document <PdfDocument>
[-Keywords <String>]
[-PassThru]
[-Subject <String>]
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#method-set-officepdfmetadata-string-pdfdocument-string-switchparameter-string-string-switchparameter-switchparameter)

Parameter set: `Document`

```
Set-OfficePdfMetadata
[-Author <String>]
[-IgnorePermissionRestrictions]
[-Incremental]
[-Keywords <String>]
[-LoadOptions <PdfLoadOptions>]
-OutputPath <String>
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[-Subject <String>]
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#method-set-officepdfmetadata-string-switchparameter-switchparameter-string-pdfloadoptions-string-switchparameter-securestring-string-string-string-switchparameter-switchparameter)

Parameter set: `Path`

```
Set-OfficePdfMetadata
[-Author <String>]
[-IgnorePermissionRestrictions]
[-Incremental]
[-Keywords <String>]
[-LoadOptions <PdfLoadOptions>]
-OutputDirectory <String>
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[-Subject <String>]
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#method-set-officepdfmetadata-string-switchparameter-switchparameter-string-pdfloadoptions-string-switchparameter-securestring-string-string-string-switchparameter-switchparameter-2)

Parameter set: `PathDirectory`

```
Set-OfficePdfMetadata
[-Author <String>]
[-IgnorePermissionRestrictions]
[-Incremental]
[-Keywords <String>]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
-OutputPath <String>
[-PassThru]
[-Password <SecureString>]
[-Subject <String>]
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#method-set-officepdfmetadata-string-switchparameter-switchparameter-string-string-pdfloadoptions-string-switchparameter-securestring-string-string-switchparameter-switchparameter)

Parameter set: `LiteralPath`

```
Set-OfficePdfMetadata
[-Author <String>]
[-IgnorePermissionRestrictions]
[-Incremental]
[-Keywords <String>]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
-OutputDirectory <String>
[-PassThru]
[-Password <SecureString>]
[-Subject <String>]
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#method-set-officepdfmetadata-string-switchparameter-switchparameter-string-string-pdfloadoptions-string-switchparameter-securestring-string-string-switchparameter-switchparameter-2)

Parameter set: `LiteralPathDirectory`

## Description

Omitted values retain existing metadata; an empty string clears a value. Incremental appends a native metadata revision. File outputs are atomic; document edits return the updated native document with PassThru.

## Guides & Samples

Authored walkthroughs and practical samples linked to this command.

- [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

### Set metadata while generating a report.

```powershell
New-OfficePdf -Path ./Report.pdf { PdfMetadata -Title 'Service review'; PdfHeading 'Service review' }
```

### Update a loaded document and save a copy.

```powershell
Open-OfficePdf ./Report.pdf -OutputPath ./Reviewed.pdf { PdfMetadata -Title 'Reviewed report' }
```

## Parameters

**-Author String optional**

Document author; an empty string clears it.

**-Keywords String optional**

Document keywords; an empty string clears them.

**-Subject String optional**

Document subject; an empty string clears it.

**-Title String optional**

Document title; an empty string clears it.

**-WhatIf SwitchParameter optional**

Shows what would happen if the command runs.

**-Confirm SwitchParameter optional**

Prompts for confirmation before running the command.

**-Document PdfDocument requiredpipeline: True (ByValue)sets: Document**

Explicit caller-owned document for inspection or editing.

**-PassThru SwitchParameter optionalsets: Document, Path, PathDirectory, LiteralPath, LiteralPathDirectory**

Emit the updated native document or each saved FileInfo.

**-IgnorePermissionRestrictions SwitchParameter optionalsets: Path, PathDirectory, LiteralPath, LiteralPathDirectory**

After authentication, explicitly ignore owner-imposed usage restrictions.

**-Incremental SwitchParameter optionalsets: Path, PathDirectory, LiteralPath, LiteralPathDirectory**

Append a metadata revision instead of rewriting existing PDF content.

**-LoadOptions PdfLoadOptions optionalsets: Path, PathDirectory, LiteralPath, LiteralPathDirectory**

Native source parsing, authentication and resource settings.

**-OutputPath String requiredsets: Path, LiteralPath**

Single-file destination.

**-Password SecureString optionalsets: Path, PathDirectory, LiteralPath, LiteralPathDirectory**

Source password.

**-Path String[] requiredposition: 0sets: Path, PathDirectory**

Input files with FileSystem wildcard expansion.

**-OutputDirectory String requiredsets: PathDirectory, LiteralPathDirectory**

Destination folder retaining input file names.

**-LiteralPath String[] requiredpipeline: True (ByPropertyName)aliases: FullName, PSPathsets: LiteralPath, LiteralPathDirectory**

Literal input 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:769259E0987A40D790D5A5856F114275F68676BB68AE73D118A019289784F108 -->
