GetImageListItemNativeDataToString
Images
Description
Returns the raw still-encoded codec stream of one listed image without decoding
Syntax
Delphi
Function GetImageListItemNativeDataToString(ImageListID, ImageIndex: Integer): AnsiString;Parameters
| ImageListID | Image-list handle returned by GetPageImageList or another image enumeration |
|---|---|
| ImageIndex | One-based item index within the list |
Return values
| The raw stream bytes behind the image XObject, or an empty string when the list handle or index is invalid |
Remarks
Unlike GetImageListItemDataToString, which returns decoded pixels, this reads the undecoded stream of the image XObject directly, so JPEG, JPEG 2000, JBIG2 and CCITT payloads round-trip byte-for-byte. Pair with GetImageListItemNativeFormat to learn the codec and with SaveImageListItemNativeDataToFile to write the payload with the right file extension. Flate-only streams report flate and carry the deflated samples; predictor-encoded data keeps its encoded form
Example
ListID:= PDF.GetPageImageList(0);
if PDF.GetImageListItemNativeFormat(ListID, 1)= "jpeg" then
PDF.SaveImageListItemNativeDataToFile(ListID, 1, "img1.jpg");