Project

PSWriteOffice

PowerShell document automation across Word, Excel, PowerPoint, PDF, Reader, Confluence, Visio, and open text formats.

Stars 159
Forks 14
PowerShell Gallery downloads 158,661
Release v3.0.5
Language: C# Updated: 2026-09-03

API Reference

Cmdlet

Set-OfficePdfSignature

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

Injects externally produced CMS, CAdES, or timestamp signature bytes into a prepared PDF signature placeholder.

Remarks

Injects externally produced CMS, CAdES, or timestamp signature bytes into a prepared PDF signature placeholder.

Examples

Authored help example

Inject a detached CMS signature into a prepared PDF.

PS>


Set-OfficePdfSignature -Path .\Prepared.pdf -SignaturePath .\signature.der -OutputPath .\Signed.pdf
            Get-OfficePdfSignature -Path .\Signed.pdf
        

Writes a PDF with the reserved /Contents hex slot patched in place.

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

Set-OfficePdfSignature [-IgnorePermissionRestrictions] -OutputPath <String> [-PassThru] [-PassThruReport] [-Password <String>] -Path <String> -SignaturePath <String> [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

IgnorePermissionRestrictions SwitchParameter optionalposition: namedpipeline: False
After successful password authentication, explicitly ignore owner-imposed signature restrictions.
OutputPath String requiredposition: 2pipeline: False
Output signed PDF path.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the object created or changed by the command.
PassThruReport SwitchParameter optionalposition: namedpipeline: False
Return a signature validation report for the written PDF instead of only the output file.
Password String optionalposition: namedpipeline: False
Password used to authenticate an encrypted prepared PDF.
Path String requiredposition: 0pipeline: True (ByValue)aliases: FilePath
Prepared PDF path.
SignaturePath String requiredposition: 1pipeline: False
DER/CMS/CAdES/TSA response bytes to inject into the reserved /Contents slot.

Outputs

System.IO.FileInfo, OfficeIMO.Pdf.PdfSignatureValidationReport