VpeSetEncryptionKeyLength

<< Click to Display Table of Contents >>

Navigation:  PDF Export >

VpeSetEncryptionKeyLength

Previous pageReturn to chapter overviewNext page

[VPE Professional Edition and above]

Sets the encryption key length for exported PDF documents. For documents which are compatible to Acrobat Reader 4, only a value of 40 is allowed. For documents which are compatible to Acrobat Reader 5, a value between 40 and 128 is allowed. If you want to create documents which are compatible to Acrobat Reader 5 only, we recommend to use 128-bit encryption.

void VpeSetEncryptionKeyLength(

VpeHandle hDoc,

int key_length

)

VpeHandle hDoc

Document Handle

int key_length

the key length in bits in the range from 40 to 128;
the value must be a multiple of 8 (e.g. 40, 48, 56, 64, ..., 128)

Default:

40

if PDFVersion is VPE_PDF_ACROBAT_4 (default)

128

if PDFVersion is VPE_PDF_ACROBAT_5

Remarks:

The User Password (see VpeSetUserPassword()) as well as the Owner Password (see VpeSetOwnerPassword()) are used to create the encryption key. To gain safe encryption, at least one of either passwords should be specified - better both.

 

As you set the property PDFVersion, the encryption key length is adjusted accordingly and any previously assigned value is overwritten.