AddImageJBIG2FromFile
Image handling
Description
Loads a bitmap file, converts it to a monochrome image, applies optional scan cleanup, and stores it as a JBIG2 image XObject
Syntax
Delphi
Function TPDFlib.AddImageJBIG2FromFile(Const FileName: WideString; Options, BlackDotSize, LossyLevel: Integer): Integer;
Parameters
| FileName | Bitmap file 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 file cannot be read or encoded
Remarks
This helper is intended for scanned black-and-white input where JBIG2 can reduce PDF size more than Flate or CCITT paths
See also
AddImageJBIG2FromStream, AddImageJBIG2FromString, AddImageJBIG2DirectFromFile