PDF Plugin for Xojo |

# PDFDocument.SetEncryptionMode Method (console safe)

Sets the encryption mode.

SetEncryptionMode(
mode as PDFDocument.EncryptModeEnum,
keyLength as Integer)

#### Parameters

mode
  The encryption mode to set.
keyLength
  Specify the byte length of encryption key. Only valid for PDFDocument.EncryptionModeEnum.ENCRYPT_R3. Between 5 (40 bits) and 16 (128 bits) can be specified.

#### Remarks

As the side effect, ups the version of PDF to 1.4 when the mode is set to PDFDocument.EncryptionModeEnum.ENCRYPT_R3.
PDFDocument.EncryptionModeEnum.ENCRYPT_R2 - Use Revision 2 algorithm. keyLength automatically set to 5 (40 bits).
PDFDocument.EncryptionModeEnum.ENCRYPT_R3 - Use Revision 3 algorithm. keyLength can be 5 (40 bits) to 16 (128bits).

#### See Also

PDFDocument Class