Please enable JavaScript to view this site.

Navigation: Developer Information > Command Line Interface

Command Line PDF Encryption

Scroll Prev Top Next More

Encrypt PDF Command Line Format

 

win2pdfd.exe encrypt sourcefile destfile permissions encryptiontype ownerpass userpass

 

Where:

 
permissions” is a hexadecimal value as defined here: https://www.win2pdf.com/doc/controllingencryptionoptions.html

It should be set without a preceding 0x. Set permissions to fffffffc to enable all permissions.

 

encryptiontype” is one of “40”, “128”, “128aes”, or “256aes”.  256aes is recommended.

 

ownerpass” is the owner password (required).

 

userpass” is the user password, and must be distinct from the “ownerpass”.  Set to “” for no user password.

 

This command is only available in licensed versions of Win2PDF Pro. Returns 0 on success, and a Windows system error code on failure.