# Remove-OfficePdfAnnotation

Removes native annotations selected by identity, page and subtype.

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`OfficeIMO.Pdf.PdfDocument` `System.String[]`

**Outputs**

`System.IO.FileInfo` `OfficeIMO.Pdf.PdfDocument` `OfficeIMO.Pdf.PdfAnnotationEditResult`

**Source**

[RemoveOfficePdfAnnotationCommand.cs:13](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/Pdf/RemoveOfficePdfAnnotationCommand.cs#L13) 

Removes native annotations selected by identity, page and subtype.

## Syntax

```
Remove-OfficePdfAnnotation
[-Document <PdfDocument>]
[-KeepPopups]
[-ObjectNumber <Int32>]
[-Page <Int32>]
[-PassThru]
[-Subtype <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#method-remove-officepdfannotation-pdfdocument-switchparameter-int32-int32-switchparameter-string-switchparameter-switchparameter)

Parameter set: `Document`

```
Remove-OfficePdfAnnotation
[-IgnorePermissionRestrictions]
[-KeepPopups]
[-LoadOptions <PdfLoadOptions>]
[-ObjectNumber <Int32>]
-OutputPath <String>
[-Page <Int32>]
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[-Subtype <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#method-remove-officepdfannotation-switchparameter-switchparameter-pdfloadoptions-int32-string-int32-switchparameter-securestring-string-string-switchparameter-switchparameter)

Parameter set: `Path`

```
Remove-OfficePdfAnnotation
[-IgnorePermissionRestrictions]
[-KeepPopups]
[-LoadOptions <PdfLoadOptions>]
[-ObjectNumber <Int32>]
-OutputDirectory <String>
[-Page <Int32>]
[-PassThru]
[-Password <SecureString>]
[-Path] <String[]>
[-Subtype <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#method-remove-officepdfannotation-switchparameter-switchparameter-pdfloadoptions-int32-string-int32-switchparameter-securestring-string-string-switchparameter-switchparameter-2)

Parameter set: `PathDirectory`

```
Remove-OfficePdfAnnotation
[-IgnorePermissionRestrictions]
[-KeepPopups]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
[-ObjectNumber <Int32>]
-OutputPath <String>
[-Page <Int32>]
[-PassThru]
[-Password <SecureString>]
[-Subtype <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#method-remove-officepdfannotation-switchparameter-switchparameter-string-pdfloadoptions-int32-string-int32-switchparameter-securestring-string-switchparameter-switchparameter)

Parameter set: `LiteralPath`

```
Remove-OfficePdfAnnotation
[-IgnorePermissionRestrictions]
[-KeepPopups]
-LiteralPath <String[]>
[-LoadOptions <PdfLoadOptions>]
[-ObjectNumber <Int32>]
-OutputDirectory <String>
[-Page <Int32>]
[-PassThru]
[-Password <SecureString>]
[-Subtype <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
```

[#](#method-remove-officepdfannotation-switchparameter-switchparameter-string-pdfloadoptions-int32-string-int32-switchparameter-securestring-string-switchparameter-switchparameter-2)

Parameter set: `LiteralPathDirectory`

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

## Guides & Samples

Authored walkthroughs and practical samples linked to this command.

- [Create and Process PDF Forms and Annotations](/docs/pswriteoffice/pdf-forms-annotations/) Guide
  
  Create interactive form fields, inspect and fill existing forms, manage annotations, and flatten only when the delivery policy requires it.

## Examples

### Example 1

```powershell
Remove-OfficePdfAnnotation -Document 'Value'
```

### Example 2

```powershell
Remove-OfficePdfAnnotation -OutputPath 'C:\Path' -LiteralPath @('C:\Path')
```

### Example 3

```powershell
Remove-OfficePdfAnnotation -OutputDirectory 'Value' -LiteralPath @('C:\Path')
```

## Parameters

**-Document PdfDocument optionalpipeline: True (ByValue)sets: Document**

Native caller-owned PDF; omission uses the enclosing content block.

**-KeepPopups SwitchParameter optional**

KeepPopups setting.

**-ObjectNumber Int32 optional**

ObjectNumber setting.

**-Page Int32 optional**

Page setting.

**-PassThru SwitchParameter optional**

Return native annotation edit reports.

**-Subtype String optional**

Subtype 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, LiteralPath, LiteralPathDirectory**

IgnorePermissionRestrictions setting.

**-LoadOptions PdfLoadOptions optionalsets: Path, PathDirectory, LiteralPath, LiteralPathDirectory**

Native parsing, authentication and resource policy.

**-OutputPath String requiredsets: Path, LiteralPath**

Single-file destination.

**-Password SecureString optionalsets: Path, PathDirectory, LiteralPath, LiteralPathDirectory**

Password setting.

**-Path String[] requiredposition: 0sets: Path, PathDirectory**

Input PDF paths with wildcard expansion.

**-OutputDirectory String requiredsets: PathDirectory, LiteralPathDirectory**

Batch destination retaining source names.

**-LiteralPath String[] requiredpipeline: True (ByPropertyName)aliases: FullName, PSPathsets: LiteralPath, LiteralPathDirectory**

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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

<!-- PowerForge markdown artifact sha256:CFBB38FF72D7E47FB18757735123EC57278341EDD6D52CD6ECA81419E3A8315E -->
