API referenceImages

pdfSaveImageListItemDataToFile

Write a specific, directly-addressed image (by index) to

C
int32_t __stdcall pdfSaveImageListItemDataToFileA(PPDF IPDF, int32_t ImageListID, int32_t ImageIndex, int32_t Options, const char* ImageFileName);
int32_t __stdcall pdfSaveImageListItemDataToFileW(PPDF IPDF, int32_t ImageListID, int32_t ImageIndex, int32_t Options, const wchar_t* ImageFileName);
Delphi
function pdfSaveImageListItemDataToFileA(const IPDF: PPDF; ImageListID, ImageIndex, Options: Integer; ImageFileName: PAnsiChar): Integer; stdcall;
function pdfSaveImageListItemDataToFileW(const IPDF: PPDF; ImageListID, ImageIndex, Options: Integer; ImageFileName: PWideChar): Integer; stdcall;

Purpose. Write a specific, directly-addressed image (by index) to a file — the one function in this cluster that does not rely on either of the two implicit "current image" conventions above.

Description. Both ImageListID and Options are accepted by the ABI but never read — the implementation resolves the target purely by ImageIndex (passed straight through to the same underlying SaveImageIdxToFile helper pdfSaveImageToFile uses, but here with an explicit index rather than the selection cursor) and writes the same raw encoded bytes as pdfSaveImageToFile. ImageListID's name implies this SDK might expose multiple independent per-context image lists (e.g. one per import session), but in fact there is only ever the single document- wide FImages array — the parameter has nothing to select between. Options similarly implies configurable output behavior (format conversion, quality, etc.) that does not exist — the bytes are always written verbatim, unmodified.

Parameters.

ParameterDescription
IPDFDocument handle.
ImageListIDAccepted but never read.
ImageIndexThe target image's index (semantics match FindImageIdx-style 0-based indexing into the single document image list).
OptionsAccepted but never read.
ImageFileNameOutput file path.

Return value. Non-zero on success; 0 if ImageIndex is out of range or the write failed.

See also. pdfSaveImageToFile.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfSaveImageListItemDataToFileW(IntPtr IPDF, int ImageListID, int ImageIndex, int Options, IntPtr ImageFileName);
public static extern int pdfSaveImageListItemDataToFile(IntPtr IPDF, int ImageListID, int ImageIndex, int Options, IntPtr ImageFileName);
public static extern int pdfSaveImageListItemDataToFileA(IntPtr IPDF, int ImageListID, int ImageIndex, int Options, IntPtr ImageFileName);
Area
Images
Category

Core

Exported names

pdfSaveImageListItemDataToFileW pdfSaveImageListItemDataToFile pdfSaveImageListItemDataToFileA

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.