ImageType

Image handling

Description

Returns the storage type of the selected image

Syntax

Delphi

Function TPDFlib.ImageType: Integer;

ActiveX

Function PDFlib::ImageType() As Long

DLL

int DLImageType(int InstanceID);

Return values

0No image is selected
1JPEG
2BMP
3TIFF, including a native CCITT strip in a standalone TIFF wrapper
4PNG
5WMF
6EMF
7GIF
8WebP
9Standalone JBIG2 with the original page and global segments

JBIG2 decoding limits

Internal bitmap decoding accepts sequential JBIG2 streams and standalone random-access files with known segment lengths. Local or global capability profiles are supported, including unknown profile identifiers. Random-access file organization does not add an API for selecting arbitrary pages; the decoder continues to return its first-page bitmap. Custom Huffman tables are supported for symbol dictionaries and text regions, including Huffman refinement bitmap sizes. Prefixes longer than 32 bits, tables with more than 65,536 entries, and unknown or oversized segment lengths are rejected explicitly. Direct users of TPLJBIG2Decoder can inspect LastError after a failed load; this diagnostic is separate from TPDFlib.LastErrorCode

Native JBIG2 extraction preserves encoded segments without decoding them, so storage type 9 does not imply that every segment combination can be rendered by the internal decoder

See also

FindImages, SaveImageToFile