API referenceForms

pdfReadImageFormat2

Same inspection as pdfReadImageFormat, but for a specific

C
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);
Delphi
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.

ParameterDescription
IPDFDocument handle.
FileNamePath to the image file.
Index0-based frame index — genuinely honored.
Width, Height, BitsPerPixel, UseZipSame 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)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Forms
Category

Core

Exported names

pdfReadImageFormat2 pdfReadImageFormat2A pdfReadImageFormat2W

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.