BOOL32 __stdcall pdfReadImageFormat2A(PPDF IPDF, const char* FileName, uint32_t Index, uint32_t* Width, uint32_t* Height, int32_t* BitsPerPixel, int32_t* UseZip);
BOOL32 __stdcall pdfReadImageFormat2W(PPDF IPDF, const wchar_t* FileName, uint32_t Index, uint32_t* Width, uint32_t* Height, int32_t* BitsPerPixel, int32_t* UseZip);
function pdfReadImageFormat2A(const IPDF: PPDF; const FileName: PAnsiChar; Index: Cardinal; var Width, Height: Cardinal; var BitsPerPixel, UseZip: Integer): LongBool; stdcall;
function pdfReadImageFormat2W(const IPDF: PPDF; const FileName: PWideChar; Index: Cardinal; var Width, Height: Cardinal; var BitsPerPixel, UseZip: Integer): LongBool; stdcall;
Purpose. Same inspection as pdfReadImageFormat, but for a specific frame of a multi-frame image file (animated GIF, multi-page TIFF).
Description. Identical to pdfReadImageFormatH except Index is genuinely passed through to LoadImageFile(FileName, Img, Integer(Index)) to select the frame (0 = first frame) — this Index is honored, in direct contrast to pdfReadImageFormatFromBuffer below, which accepts an Index parameter but never uses it.
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
FileName | Path to the image file. |
Index | 0-based frame index — genuinely honored. |
Width, Height, BitsPerPixel, UseZip | Same semantics as pdfReadImageFormat. |
Return value. True on successful decode of the requested frame; False if the file, or that frame index, doesn't resolve.
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Core
pdfReadImageFormat2
pdfReadImageFormat2A
pdfReadImageFormat2W
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.