GoLang HaruDoc::setEncryptionMode

request it (294)
GoLang replacement for PHP's HaruDoc::setEncryptionMode [edit | history]

Do you know a GoLang replacement for PHP's HaruDoc::setEncryptionMode? Write it!

PHP HaruDoc::setEncryptionMode

PHP original manual for HaruDoc::setEncryptionMode [ show | php.net ]


(PECL haru >= 0.0.1)

HaruDoc::setEncryptionModeSet 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.



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.


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).

Return Values

Returns TRUE on success.


Throws a HaruException on error.

See Also