AddImageJBIG2FromStream
Image handling
Description
Loads a bitmap stream, converts it to a monochrome image, applies optional scan cleanup, and stores it as a JBIG2 image XObject
Syntax
Delphi
Function TPDFlib.AddImageJBIG2FromStream(InStream: TStream; Options, BlackDotSize, LossyLevel: Integer): Integer;
Parameters
| InStream | Bitmap stream to encode |
|---|---|
| Options | Bit 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 |
| BlackDotSize | Maximum isolated black-pixel cluster size removed when cleanup is enabled |
| LossyLevel | Cleanup aggressiveness hint from 0 to 9 for scanned monochrome input |
Return values
Returns the new ImageID, or 0 when the stream cannot be read or encoded
Remarks
The stream position is read from its current location and the caller keeps stream ownership
See also
AddImageJBIG2FromFile, AddImageJBIG2FromString, AddImageJBIG2DirectFromStream