Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Set-OfficePdfAnnotation

Module
PSWriteOffice
Inputs
OfficeIMO.Pdf.PdfDocument System.Int32 System.String[]
Outputs
System.IO.FileInfo OfficeIMO.Pdf.PdfDocument OfficeIMO.Pdf.PdfAnnotationEditResult

Updates native annotation contents, styling and actions by identity or target URI.

Syntax

Set-OfficePdfAnnotation
[-Color <OfficeColor>]
[-Contents <String>]
[-Document <PdfDocument>]
[-Flags <Int32>]
[-Name <String>]
-ObjectNumber <Int32>
[-Options <PdfAnnotationUpdateOptions>]
[-PassThru]
[-RemoveAction]
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
#
Parameter set: Document
Set-OfficePdfAnnotation
[-Color <OfficeColor>]
[-Contents <String>]
[-Flags <Int32>]
[-IgnorePermissionRestrictions]
[-LoadOptions <PdfLoadOptions>]
[-Name <String>]
-ObjectNumber <Int32>
[-Options <PdfAnnotationUpdateOptions>]
-OutputPath <String>
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[-RemoveAction]
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
#
Parameter set: Path
Set-OfficePdfAnnotation
[-Color <OfficeColor>]
[-Contents <String>]
[-Flags <Int32>]
[-IgnorePermissionRestrictions]
[-LoadOptions <PdfLoadOptions>]
[-Name <String>]
-ObjectNumber <Int32>
[-Options <PdfAnnotationUpdateOptions>]
-OutputDirectory <String>
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[-RemoveAction]
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
#
Parameter set: PathDirectory
Set-OfficePdfAnnotation
[-Color <OfficeColor>]
[-Contents <String>]
[-Flags <Int32>]
[-IgnorePermissionRestrictions]
[-LoadOptions <PdfLoadOptions>]
[-Name <String>]
[-Options <PdfAnnotationUpdateOptions>]
-OutputPath <String>
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[-RemoveAction]
[-Title <String>]
-Uri <String>
[-WhatIf]
[-Confirm]
[<CommonParameters>]
#
Parameter set: PathUri
Set-OfficePdfAnnotation
[-Color <OfficeColor>]
[-Contents <String>]
[-Flags <Int32>]
[-IgnorePermissionRestrictions]
[-LoadOptions <PdfLoadOptions>]
[-Name <String>]
[-Options <PdfAnnotationUpdateOptions>]
-OutputDirectory <String>
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[-RemoveAction]
[-Title <String>]
-Uri <String>
[-WhatIf]
[-Confirm]
[<CommonParameters>]
#
Parameter set: PathUriDirectory
Set-OfficePdfAnnotation
[-Color <OfficeColor>]
[-Contents <String>]
[-Flags <Int32>]
[-IgnorePermissionRestrictions]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
[-Name <String>]
-ObjectNumber <Int32>
[-Options <PdfAnnotationUpdateOptions>]
-OutputPath <String>
[-PassThru]
[-Password <SecureString>]
[-RemoveAction]
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
#
Parameter set: LiteralPath
Set-OfficePdfAnnotation
[-Color <OfficeColor>]
[-Contents <String>]
[-Flags <Int32>]
[-IgnorePermissionRestrictions]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
[-Name <String>]
[-Options <PdfAnnotationUpdateOptions>]
-OutputPath <String>
[-PassThru]
[-Password <SecureString>]
[-RemoveAction]
[-Title <String>]
-Uri <String>
[-WhatIf]
[-Confirm]
[<CommonParameters>]
#
Parameter set: LiteralPathUri
Set-OfficePdfAnnotation
[-Color <OfficeColor>]
[-Contents <String>]
[-Flags <Int32>]
[-IgnorePermissionRestrictions]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
[-Name <String>]
-ObjectNumber <Int32>
[-Options <PdfAnnotationUpdateOptions>]
-OutputDirectory <String>
[-PassThru]
[-Password <SecureString>]
[-RemoveAction]
[-Title <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
#
Parameter set: LiteralPathDirectory
Set-OfficePdfAnnotation
[-Color <OfficeColor>]
[-Contents <String>]
[-Flags <Int32>]
[-IgnorePermissionRestrictions]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
[-Name <String>]
[-Options <PdfAnnotationUpdateOptions>]
-OutputDirectory <String>
[-PassThru]
[-Password <SecureString>]
[-RemoveAction]
[-Title <String>]
-Uri <String>
[-WhatIf]
[-Confirm]
[<CommonParameters>]
#
Parameter set: LiteralPathUriDirectory
Set-OfficePdfAnnotation
[-Color <OfficeColor>]
[-Contents <String>]
[-Document <PdfDocument>]
[-Flags <Int32>]
[-Name <String>]
[-Options <PdfAnnotationUpdateOptions>]
[-PassThru]
[-RemoveAction]
[-Title <String>]
-Uri <String>
[-WhatIf]
[-Confirm]
[<CommonParameters>]
#
Parameter set: DocumentUri

Description

Native confirmation runs before loading or editing a file. Live inputs stay caller-owned; a replacement document is adopted by the enclosing content block or returned for explicit assignment. PassThru returns native edit reports.

Examples

Example 1

Set-OfficePdfAnnotation -ObjectNumber 1

Example 2

Set-OfficePdfAnnotation -Uri 'https://example.com'

Example 3

Set-OfficePdfAnnotation -OutputPath 'C:\Path' -ObjectNumber 1 -LiteralPath @('C:\Path')

Parameters

-Color OfficeColor optional
Replacement annotation RGB color.
-Contents String optional
Contents setting.
-Document PdfDocument optionalpipeline: True (ByValue)sets: Document, DocumentUri
Native caller-owned PDF; omission uses the enclosing content block.
-Flags Int32 optional
Raw PDF annotation flags.
-Name String optional
Name setting.
-ObjectNumber Int32 requiredpipeline: True (ByPropertyName)sets: Document, Path, PathDirectory, LiteralPath, LiteralPathDirectory
ObjectNumber setting.
-Options PdfAnnotationUpdateOptions optional
Native annotation edit policy and fields. Explicit parameters override this captured policy; append-only residual data remains opt-in.
-PassThru SwitchParameter optional
Return native annotation edit reports.
-RemoveAction SwitchParameter optional
RemoveAction setting.
-Title String optional
Title setting.
-WhatIf SwitchParameter optional
Shows what would happen if the command runs.
-Confirm SwitchParameter optional
Prompts for confirmation before running the command.
-IgnorePermissionRestrictions SwitchParameter optionalsets: Path, PathDirectory, PathUri, PathUriDirectory, LiteralPath, LiteralPathUri, LiteralPathDirectory, LiteralPathUriDirectory
IgnorePermissionRestrictions setting.
-LoadOptions PdfLoadOptions optionalsets: Path, PathDirectory, PathUri, PathUriDirectory, LiteralPath, LiteralPathUri, LiteralPathDirectory, LiteralPathUriDirectory
Native parsing, authentication and resource policy.
-OutputPath String requiredsets: Path, PathUri, LiteralPath, LiteralPathUri
Single-file destination.
-Password SecureString optionalsets: Path, PathDirectory, PathUri, PathUriDirectory, LiteralPath, LiteralPathUri, LiteralPathDirectory, LiteralPathUriDirectory
Password setting.
-Path String[] requiredposition: 0sets: Path, PathDirectory, PathUri, PathUriDirectory
Input PDF paths with wildcard expansion.
-OutputDirectory String requiredsets: PathDirectory, PathUriDirectory, LiteralPathDirectory, LiteralPathUriDirectory
Batch destination retaining source names.
-Uri String requiredsets: PathUri, PathUriDirectory, LiteralPathUri, LiteralPathUriDirectory, DocumentUri
Exact or wildcard target URI used to select link annotations.
-LiteralPath String[] requiredpipeline: True (ByPropertyName)aliases: FullName, PSPathsets: LiteralPath, LiteralPathUri, LiteralPathDirectory, LiteralPathUriDirectory
Literal input PDF paths; accepts 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.