API Reference

Cmdlet

Set-OfficePdfMetadata

Aliases: PdfMetadata
Namespace PSWriteOffice
Aliases
PdfMetadata
Inputs
OfficeIMO.Pdf.PdfDocument
Outputs
OfficeIMO.Pdf.PdfDocument System.IO.FileInfo

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

Authored help example

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>]
#
Parameter set: Context

Parameters

Author String optionalposition: namedpipeline: False
Document author.
Keywords String optionalposition: namedpipeline: False
Document keywords.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the updated document.
Subject String optionalposition: namedpipeline: False
Document subject.
Title String optionalposition: namedpipeline: False
Document title.

Outputs

OfficeIMO.Pdf.PdfDocument System.IO.FileInfo

Set-OfficePdfMetadata [-Author <String>] -Document <PdfDocument> [-Keywords <String>] [-PassThru] [-Subject <String>] [-Title <String>] [<CommonParameters>]
#
Parameter set: Document

Parameters

Author String optionalposition: namedpipeline: False
Document author.
Document PdfDocument requiredposition: namedpipeline: True (ByValue)
PDF document to update outside the DSL context.
Keywords String optionalposition: namedpipeline: False
Document keywords.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the updated document.
Subject String optionalposition: namedpipeline: False
Document subject.
Title String optionalposition: namedpipeline: False
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>]
#
Parameter set: File

Parameters

Author String optionalposition: namedpipeline: False
Document author.
Incremental SwitchParameter optionalposition: namedpipeline: False
Append a metadata-only incremental PDF revision instead of rewriting the existing PDF bytes.
Keywords String optionalposition: namedpipeline: False
Document keywords.
OutputPath String requiredposition: namedpipeline: False
Output PDF path when rewriting an existing PDF.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the updated document.
Path String requiredposition: namedpipeline: Falsealiases: FilePath
Existing PDF path to rewrite with updated metadata.
Subject String optionalposition: namedpipeline: False
Document subject.
Title String optionalposition: namedpipeline: False
Document title.

Outputs

OfficeIMO.Pdf.PdfDocument System.IO.FileInfo