PHPTS:一键免费搭建 Nginx + PHP + MySQL 运行环境

HaruDoc::setCompressionMode

(PECL haru >= 0.0.1)

HaruDoc::setCompressionModeSet compression mode for the document

说明

HaruDoc::setCompressionMode ( int $mode ) : bool

Defines compression mode for the document. In case when libharu was compiled without Zlib support this function will always throw HaruException.

参数

mode

The compression mode to use. The value is a combination of the following flags:

  • HaruDoc::COMP_NONE - all contents is not compressed.
  • HaruDoc::COMP_TEXT - compress the text data.
  • HaruDoc::COMP_IMAGE - compress the image data.
  • HaruDoc::COMP_METADATA - compress other data (fonts, cmaps).
  • HaruDoc::COMP_ALL - compress all data.

返回值

Returns TRUE on success.

错误/异常

发生错误时抛出 HaruException 异常。