API Reference

Cmdlet

New-OfficePdfSignature

Namespace PSWriteOffice
Inputs
System.String
Outputs
System.IO.FileInfo OfficeIMO.Pdf.PdfExternalSignaturePreparation

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

Authored help example

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

Parameters

ContactInfo String optionalposition: namedpipeline: False
Signer contact information stored in the signature dictionary.
FieldName String optionalposition: namedpipeline: False
Signature field name to append.
Filter String optionalposition: namedpipeline: False
Signature handler filter name. The default is Adobe.PPKLite.
Location String optionalposition: namedpipeline: False
Signing location stored in the signature dictionary.
Name String optionalposition: namedpipeline: False
Display signer name stored in the signature dictionary.
OutputPath String requiredposition: 1pipeline: False
Output prepared PDF path.
PassThruReport SwitchParameter optionalposition: namedpipeline: False
Return the OfficeIMO.Pdf preparation report instead of only the output file.
Path String requiredposition: 0pipeline: True (ByValue)aliases: FilePath
Input PDF path.
Reason String optionalposition: namedpipeline: False
Signing reason stored in the signature dictionary.
ReservedBytes Int32 optionalposition: namedpipeline: False
Raw signature bytes to reserve in /Contents before hex encoding.
SubFilter PdfExternalSignatureSubFilter optionalposition: namedpipeline: Falsevalues: 3
Signature subfilter that describes the external signature bytes to inject later.
Possible values: DetachedCms, CadesDetached, DocumentTimestamp

Outputs

System.IO.FileInfo OfficeIMO.Pdf.PdfExternalSignaturePreparation