API Reference
Set-OfficePdfMetadata
Sets PDF document metadata on generated documents or existing PDF files.
Remarks
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.
PS>
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.
PS>
Set-OfficePdfMetadata -Path .\Input.pdf -OutputPath .\Output.pdf -Title 'Reviewed package' -Author 'Operations'
Writes a new PDF 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.
Syntax
Set-OfficePdfMetadata [-Author <String>] [-Keywords <String>] [-PassThru] [-Subject <String>] [-Title <String>] [<CommonParameters>]#ContextParameters
- Author String
- Document author.
- Keywords String
- Document keywords.
- PassThru SwitchParameter
- Emit the updated document.
- Subject String
- Document subject.
- Title String
- Document title.
Outputs
OfficeIMO.Pdf.PdfDocument System.IO.FileInfo
Set-OfficePdfMetadata [-Author <String>] -Document <PdfDocument> [-Keywords <String>] [-PassThru] [-Subject <String>] [-Title <String>] [<CommonParameters>]#DocumentParameters
- Author String
- Document author.
- Document PdfDocument
- PDF document to update outside the DSL context.
- Keywords String
- Document keywords.
- PassThru SwitchParameter
- Emit the updated document.
- Subject String
- Document subject.
- Title String
- Document title.
Outputs
OfficeIMO.Pdf.PdfDocument System.IO.FileInfo
Set-OfficePdfMetadata [-Author <String>] [-Incremental] [-Keywords <String>] -OutputPath <String> [-PassThru] -Path <String> [-Subject <String>] [-Title <String>] [<CommonParameters>]#FileParameters
- Author String
- Document author.
- Incremental SwitchParameter
- Append a metadata-only incremental PDF revision instead of rewriting the existing PDF bytes.
- Keywords String
- Document keywords.
- OutputPath String
- Output PDF path when rewriting an existing PDF.
- PassThru SwitchParameter
- Emit the updated document.
- Path String
- Existing PDF path to rewrite with updated metadata.
- Subject String
- Document subject.
- Title String
- Document title.
Outputs
OfficeIMO.Pdf.PdfDocument System.IO.FileInfo