API Reference
New-OfficePdfSignature
Prepares an existing PDF for external digital signing by appending a signature field, /ByteRange, and reserved /Contents placeholder.
Remarks
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.
PS>
$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.
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
New-OfficePdfSignature [-ContactInfo <String>] [-FieldName <String>] [-Filter <String>] [-Location <String>] [-Name <String>] -OutputPath <String> [-PassThruReport] -Path <String> [-Reason <String>] [-ReservedBytes <Int32>] [-SubFilter <DetachedCms|CadesDetached|DocumentTimestamp>] [<CommonParameters>]#All Parameter SetsParameters
- ContactInfo String
- Signer contact information stored in the signature dictionary.
- FieldName String
- Signature field name to append.
- Filter String
- Signature handler filter name. The default is Adobe.PPKLite.
- Location String
- Signing location stored in the signature dictionary.
- Name String
- Display signer name stored in the signature dictionary.
- OutputPath String
- Output prepared PDF path.
- PassThruReport SwitchParameter
- Return the OfficeIMO.Pdf preparation report instead of only the output file.
- Path String
- Input PDF path.
- Reason String
- Signing reason stored in the signature dictionary.
- ReservedBytes Int32
- Raw signature bytes to reserve in /Contents before hex encoding.
- SubFilter PdfExternalSignatureSubFilter
- Signature subfilter that describes the external signature bytes to inject later.
- Possible values:
DetachedCms,CadesDetached,DocumentTimestamp
Outputs
System.IO.FileInfo OfficeIMO.Pdf.PdfExternalSignaturePreparation