pdf-lite - v1.0.1
    Preparing search index...

    Handles PNG and TIFF predictor encoding and decoding for PDF streams. Predictors are used to improve compression efficiency by transforming image data before or after compression.

    Index

    Constructors

    Methods

    • Encodes data using a predictor algorithm.

      Parameters

      • data: ByteArray

        The data to encode.

      • params: DecodeParms = {}

        Optional encode parameters including Predictor, Columns, Colors, and BitsPerComponent.

      • PdfStreamFilterType: number = 0

        The PNG filter type to use for encoding.

      Returns ByteArray

      The encoded byte array.

      const encoded = Predictor.encode(rawData, { Predictor: 12, Columns: 100 }, 1)
      
    • Encodes data using PNG predictor.

      Parameters

      • data: ByteArray

        The data to encode.

      • columns: number

        The number of columns in the image.

      • bpp: number

        Bytes per pixel.

      • PdfStreamFilterType: number

        The PNG filter type (0-4) to use.

      Returns ByteArray

      The PNG encoded byte array.

      Error if an unsupported PNG filter type is specified.