Zlib

Compression and decompression of the stored font artifacts.

Namespace: Com\Tecnick\Pdf\Font

Final: Yes

File: Zlib.php line 36

Compression and decompression of the stored font artifacts.

Tags

Methods

compress()

File: Zlib.php line 73

public static compress(string $data, string $message[, int $level = -1 ]) : string

Any warning gzcompress() may emit is silenced, as in uncompress().

Parameters

  • $data : string: Data to compress.
  • $message : string: Message of the exception raised when the data cannot be compressed.
  • $level : int = -1: Compression level (-1 for the zlib default, 0 to 9).

Tags

  • throws: Exception if the data cannot be compressed.

Return values

string —

The compressed data.

uncompress()

File: Zlib.php line 49

public static uncompress(string $data[, int $maxLength = 0 ]) : string|false

The E_WARNING gzuncompress() emits for a corrupt stream is silenced.

Parameters

  • $data : string: Compressed data.
  • $maxLength : int = 0: Maximum size of the uncompressed data, or 0 for no limit. A stream expanding past it is reported as invalid.

Return values

string|false —

The uncompressed data, or false when the stream is not valid.