Cmdlet
Set-OfficePdfMetadata
Sets PDF document metadata on generated documents or existing PDF files.
Syntax
Set-OfficePdfMetadata [-Author <String>] [-Keywords <String>] [-PassThru] [-Subject <String>] [-Title <String>] [<CommonParameters>]#Parameter set:
ContextSet-OfficePdfMetadata [-Author <String>] -Document <PdfDocument> [-Keywords <String>] [-PassThru] [-Subject <String>] [-Title <String>] [<CommonParameters>]#Parameter set:
DocumentSet-OfficePdfMetadata [-Author <String>] [-IgnorePermissionRestrictions] [-Incremental] [-Keywords <String>] -OutputPath <String> [-PassThru] [-Password <String>] -Path <String> [-Subject <String>] [-Title <String>] [<CommonParameters>]#Parameter set:
FileDescription
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.
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.
Set-OfficePdfMetadata -Path .\Input.pdf -OutputPath .\Output.pdf -Title 'Reviewed package' -Author 'Operations'Writes a new PDF with updated metadata.
Parameters
- Document author.
- -Keywords String
- Document keywords.
- -PassThru SwitchParameter
- Emit the updated document.
- -Subject String
- Document subject.
- -Title String
- Document title.
- -Document PdfDocument
- PDF document to update outside the DSL context.
- -IgnorePermissionRestrictions SwitchParameter
- After successful password authentication, explicitly ignore owner-imposed metadata-modification restrictions.
- -Incremental SwitchParameter
- Append a metadata-only incremental PDF revision instead of rewriting the existing PDF bytes.
- -OutputPath String
- Output PDF path when rewriting an existing PDF.
- -Password String
- Password used to authenticate an encrypted PDF.
- -Path String
- 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.