# Set-OfficePdfMetadata

Sets PDF document metadata on generated documents or existing PDF files.

Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **727**

Forks **84**

Open issues **7**

Total downloads **5,275,783**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-24

Cmdlet 

Aliases: PdfMetadata

**Module**

`PSWriteOffice`

**Aliases**

`PdfMetadata`

**Inputs**

`OfficeIMO.Pdf.PdfDocument`

**Outputs**

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

**Source**

[SetOfficePdfMetadataCommand.cs:31](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Pdf/SetOfficePdfMetadataCommand.cs#L31) 

Sets PDF document metadata on generated documents or existing PDF files.

## Syntax

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

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

Parameter set: `Context`

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

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

Parameter set: `Document`

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

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

Parameter set: `File`

## Description

In a New-OfficePdf script block this command updates the generated document metadata. With -Path and -OutputPath, it rewrites an existing PDF with updated metadata unless -Incremental is used.

## Examples

### Set metadata while generating a PDF.

```powershell
New-OfficePdf -Path .\Report.pdf {
  PdfMetadata -Title 'Service Review' -Author 'PSWriteOffice' -Subject 'Operations'
  PdfHeading 'Service Review'
}
```

Stores metadata on a newly generated PDF.

### Rewrite metadata on an existing PDF.

```powershell
Set-OfficePdfMetadata -Path .\Input.pdf -OutputPath .\Output.pdf -Title 'Reviewed package' -Author 'Operations'
```

Writes a new PDF with updated metadata.

## Parameters

**-Author String optional**

Document author.

**-Keywords String optional**

Document keywords.

**-PassThru SwitchParameter optional**

Emit the updated document.

**-Subject String optional**

Document subject.

**-Title String optional**

Document title.

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

PDF document to update outside the DSL context.

**-IgnorePermissionRestrictions SwitchParameter optionalsets: File**

After successful password authentication, explicitly ignore owner-imposed metadata-modification restrictions.

**-Incremental SwitchParameter optionalsets: File**

Append a metadata-only incremental PDF revision instead of rewriting the existing PDF bytes.

**-OutputPath String requiredsets: File**

Output PDF path when rewriting an existing PDF.

**-Password String optionalsets: File**

Password used to authenticate an encrypted PDF.

**-Path String requiredaliases: FilePathsets: File**

Existing PDF path to rewrite with updated metadata.

## 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).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:612F77CC8CC1413A899BF4BDB1220B7EAB0759D9B8FB5555D812399357C94672 -->
