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 | PDF_JBIG2_OPTION_INTERPOLATE (1) writes Interpolate, PDF_JBIG2_OPTION_SYMBOL_EXTRACT (2) enables symbol dictionaries where available, PDF_JBIG2_OPTION_EXTERNAL_ENCODER (4) prefers the external encoder backend, and PDF_JBIG2_OPTION_SKIP_BLACK_DOTS (8) 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