Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

New-OfficePdfEncryptionOptions

Module
PSWriteOffice
Inputs
None
Outputs
System.Collections.Hashtable

Creates PDF encryption settings; Protect-OfficeDocument supplies the actual passwords.

Syntax

New-OfficePdfEncryptionOptions
[-Algorithm <Aes256|Aes128|LegacyRc4>]
[-NoMetadataEncryption]
[<CommonParameters>]
#
Parameter set: Default

Examples

Select AES-256 while leaving metadata readable.

$options = New-OfficePdfEncryptionOptions -Algorithm Aes256 -NoMetadataEncryption
Protect-OfficeDocument -Path ./Report.pdf -Encrypt -Password $password -Options $options

Parameters

-Algorithm PdfStandardEncryptionAlgorithm optional
Native PDF Standard encryption algorithm.
Possible values: Aes256, Aes128, LegacyRc4
-NoMetadataEncryption SwitchParameter optional
Leave document metadata unencrypted.

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.