Table of contents
Namespace: Com\Tecnick\Pdf\Font
Final: Yes
File: Zlib.php line 36
Compression and decompression of the stored font artifacts.
Tags
- since: 2026-08-14
- category: Library
- author: Nicola Asuni info@tecnick.com
- copyright: 2011-2026 Nicola Asuni - Tecnick.com LTD
- license: https://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE)
- link: https://github.com/tecnickcom/tc-lib-pdf-font
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.