略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: HaruDoc::setEncryptionMode

2024-05-02

HaruDoc::setEncryptionMode

(PECL haru >= 0.0.1)

HaruDoc::setEncryptionModeSet encryption mode for the document

说明

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

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 异常。

参见

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/harudoc.setencryptionmode.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3