HaruDoc::setCurrentEncoder
HaruDoc::setInfoAttr
HaruDoc
PHP Manual

# HaruDoc::setEncryptionMode

(PECL haru >= 0.0.1)

HaruDoc::setEncryptionMode — Set encryption mode for the document

### 설명

bool HaruDoc::setEncryptionMode ( int `$mode` [, int `$key_len`= 5 ] )

Defines encryption mode for the document. The encryption mode cannot be set before setting the password.

### 인수

`mode`

  The encryption mode to use. Can be one of the following:

  - `HaruDoc::ENCRYPT_R2` - use "revision2" algorithm.
  - `HaruDoc::ENCRYPT_R3` - use "revision3" algorithm. Using this value bumps the version of PDF to 1.4.

`key_len`

  The encryption key length in bytes. This parameter is optional and used only when mode is `HaruDoc::ENCRYPT_R3`. The default value is 5 (40bit).

### 반환값

Returns `TRUE` on success.

### 오류/예외

오류 시에 HaruException을 던짐.

### 참고

- HaruDoc::setPassword - Set owner and user passwords for the document
- HaruDoc::setPermission - Set permissions for the document

HaruDoc::setCurrentEncoder
HaruDoc::setInfoAttr
HaruDoc
PHP Manual