Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Set-OfficePdfMetadata

Aliases: PdfMetadata
Module
PSWriteOffice
Aliases
PdfMetadata
Inputs
OfficeIMO.Pdf.PdfDocument System.String[]
Outputs
OfficeIMO.Pdf.PdfDocument System.IO.FileInfo

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: Context
Set-OfficePdfMetadata
[-Author <String>]
-Document <PdfDocument>
[-Keywords <String>]
[-PassThru]
[-Subject <String>]
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
#
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>]
#
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>]
#
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>]
#
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>]
#
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.

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

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