Cmdlet
Set-OfficePdfMetadata
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>]#Parameter set:
ContextSet-OfficePdfMetadata
[-Author <String>]
-Document <PdfDocument>
[-Keywords <String>]
[-PassThru]
[-Subject <String>]
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]#Parameter set:
DocumentSet-OfficePdfMetadata
[-Author <String>]
[-IgnorePermissionRestrictions]
[-Incremental]
[-Keywords <String>]
[-LoadOptions <PdfLoadOptions>]
-OutputPath <String>
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[-Subject <String>]
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]#Parameter set:
PathSet-OfficePdfMetadata
[-Author <String>]
[-IgnorePermissionRestrictions]
[-Incremental]
[-Keywords <String>]
[-LoadOptions <PdfLoadOptions>]
-OutputDirectory <String>
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[-Subject <String>]
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]#Parameter set:
PathDirectorySet-OfficePdfMetadata
[-Author <String>]
[-IgnorePermissionRestrictions]
[-Incremental]
[-Keywords <String>]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
-OutputPath <String>
[-PassThru]
[-Password <SecureString>]
[-Subject <String>]
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]#Parameter set:
LiteralPathSet-OfficePdfMetadata
[-Author <String>]
[-IgnorePermissionRestrictions]
[-Incremental]
[-Keywords <String>]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
-OutputDirectory <String>
[-PassThru]
[-Password <SecureString>]
[-Subject <String>]
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]#Parameter set:
LiteralPathDirectoryDescription
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.
Examples
Set metadata while generating a report.
New-OfficePdf -Path ./Report.pdf { PdfMetadata -Title 'Service review'; PdfHeading 'Service review' }Update a loaded document and save a copy.
Open-OfficePdf ./Report.pdf -OutputPath ./Reviewed.pdf { PdfMetadata -Title 'Reviewed report' }Parameters
- Document author; an empty string clears it.
- -Keywords String
- Document keywords; an empty string clears them.
- -Subject String
- Document subject; an empty string clears it.
- -Title String
- Document title; an empty string clears it.
- -WhatIf SwitchParameter
- Shows what would happen if the command runs.
- -Confirm SwitchParameter
- Prompts for confirmation before running the command.
- -Document PdfDocument
- Explicit caller-owned document for inspection or editing.
- -PassThru SwitchParameter
- Emit the updated native document or each saved FileInfo.
- -IgnorePermissionRestrictions SwitchParameter
- After authentication, explicitly ignore owner-imposed usage restrictions.
- -Incremental SwitchParameter
- Append a metadata revision instead of rewriting existing PDF content.
- -LoadOptions PdfLoadOptions
- Native source parsing, authentication and resource settings.
- -OutputPath String
- Single-file destination.
- -Password SecureString
- Source password.
- -Path String[]
- Input files with FileSystem wildcard expansion.
- -OutputDirectory String
- Destination folder retaining input file names.
- -LiteralPath String[]
- 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.