AddImageJBIG2FromString

Image handling

Description

Loads bitmap bytes from an AnsiString, converts them to a monochrome image, applies optional scan cleanup, and stores them as a JBIG2 image XObject

Syntax

Delphi

Function TPDFlib.AddImageJBIG2FromString(Const Source: AnsiString; Options, BlackDotSize, LossyLevel: Integer): Integer;

Parameters

SourceBitmap bytes to encode
OptionsBit 0 writes Interpolate, bit 1 enables symbol dictionaries where available, bit 2 prefers the external encoder backend, and bit 3 enables isolated black-dot cleanup before encoding
BlackDotSizeMaximum isolated black-pixel cluster size removed when cleanup is enabled
LossyLevelCleanup aggressiveness hint from 0 to 9 for scanned monochrome input

Return values

Returns the new ImageID, or 0 when the bytes cannot be read or encoded

Remarks

Use this overload when bitmap input is already available in memory and no file or stream object is needed

See also

AddImageJBIG2FromFile, AddImageJBIG2FromStream, AddImageJBIG2DirectFromString