# New-OfficePdfSignature

Prepares an existing PDF for external digital signing by appending a signature field, /ByteRange, and reserved /Contents placeholder.

Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **725**

Forks **84**

Open issues **3**

Total downloads **5,231,343**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-23

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`System.String`

**Outputs**

`System.IO.FileInfo` `OfficeIMO.Pdf.PdfExternalSignaturePreparation`

**Source**

[NewOfficePdfSignatureCommand.cs:22](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Pdf/NewOfficePdfSignatureCommand.cs#L22) 

Prepares an existing PDF for external digital signing by appending a signature field, /ByteRange, and reserved /Contents placeholder.

## Syntax

```
New-OfficePdfSignature
[-ContactInfo <String>]
[-FieldName <String>]
[-Filter <String>]
[-IgnorePermissionRestrictions]
[-Location <String>]
[-Name <String>]
[-OutputPath] <String>
[-PassThruReport]
[-Password <String>]
[-Path] <String>
[-Reason <String>]
[-ReservedBytes <Int32>]
[-SubFilter <DetachedCms|CadesDetached|DocumentTimestamp>]
[<CommonParameters>]
```

[#](#method-new-officepdfsignature-string-string-string-switchparameter-string-string-string-switchparameter-string-string-string-int32-pdfexternalsignaturesubfilter)

Parameter set: `All Parameter Sets`

## Description

The command does not create CMS, CAdES, timestamp, certificate-chain, or revocation data. Use the returned byte range or digest with an external signing service, then inject the produced signature bytes with Set-OfficePdfSignature.

## Examples

### Prepare a PDF for detached CMS signing.

```powershell
$plan = New-OfficePdfSignature -Path .\Input.pdf -OutputPath .\Prepared.pdf -FieldName Approval -Name 'Alice' -Reason Approval -PassThruReport
$plan.ByteRangeValues
$plan.ComputeSha256Digest()
```

Writes a prepared PDF and returns the OfficeIMO.Pdf external signing preparation report.

## Parameters

**-ContactInfo String optional**

Signer contact information stored in the signature dictionary.

**-FieldName String optional**

Signature field name to append.

**-Filter String optional**

Signature handler filter name. The default is Adobe.PPKLite.

**-IgnorePermissionRestrictions SwitchParameter optional**

After successful password authentication, explicitly ignore owner-imposed signature-field restrictions.

**-Location String optional**

Signing location stored in the signature dictionary.

**-Name String optional**

Display signer name stored in the signature dictionary.

**-OutputPath String requiredposition: 1**

Output prepared PDF path.

**-PassThruReport SwitchParameter optional**

Return the OfficeIMO.Pdf preparation report instead of only the output file.

**-Password String optional**

Password used to authenticate an encrypted PDF.

**-Path String requiredposition: 0pipeline: True (ByValue)aliases: FilePath**

Input PDF path.

**-Reason String optional**

Signing reason stored in the signature dictionary.

**-ReservedBytes Int32 optional**

Raw signature bytes to reserve in /Contents before hex encoding.

**-SubFilter PdfExternalSignatureSubFilter optional**

Signature subfilter that describes the external signature bytes to inject later.

Possible values: `DetachedCms`, `CadesDetached`, `DocumentTimestamp`

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

Evotec API Reference Copyright 2026 Evotec Services

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