Predictor

Reverses the predictor applied before LZW or Flate compression (PDF 32000-1:2008 Table 8).

Table of contents

Namespace: Com\Tecnick\Pdf\Filter

File: Predictor.php line 41

Reverses the predictor applied before LZW or Flate compression (PDF 32000-1:2008 Table 8).

Predictor 1 (default) leaves the data unchanged, 2 is the TIFF horizontal differencing predictor, and 10 to 15 are the PNG predictors of RFC 2083, where each row is prefixed by the tag of the algorithm used to encode it.

Tags

Methods

apply()

File: Predictor.php line 67

public apply(string $data[, array<string, mixed> $params = [] ]) : string

Parameters

  • $data : string: Decompressed data.
  • $params : array<string, mixed> = []: DecodeParms dictionary. - ‘Predictor’ (int): 1 = none (default), 2 = TIFF, 10 to 15 = PNG. - ‘Colors’ (int): colour components per sample, 1 to 65535 (default 1). - ‘BitsPerComponent’ (int): bits per component: 1, 2, 4, 8 or 16 (default 8). - ‘Columns’ (int): samples per row, 1 to 2147483647 (default 1).

Tags

Return values

string —

Data with the prediction removed.