API referenceForms

pdfReadImageFormatFromBuffer

Same inspection as pdfReadImageFormat, but decoding an

C
BOOL32 __stdcall pdfReadImageFormatFromBuffer(void* IPDF, void* Buffer, uint32_t BufSize, uint32_t Index, uint32_t* Width, uint32_t* Height, int32_t* BitsPerPixel, int32_t* UseZip);
Delphi
function pdfReadImageFormatFromBuffer(IPDF, Buffer: Pointer; BufSize, Index: Cardinal; var Width, Height: Cardinal; var BitsPerPixel, UseZip: Integer): LongBool; stdcall;

Purpose. Same inspection as pdfReadImageFormat, but decoding an in-memory image buffer instead of a file path.

Description. Ignored parameter: Index is accepted by the wrapper but never forwarded — the call site is Drifb.ReadImageFormatFromBufH(Buffer, BufSize, Width, Height, BitsPerPixel, UseZip), omitting Index entirely, and ReadImageFormatFromBufH's implementation (LoadImageFromBuffer(Buf, BufSz, Img), no frame parameter at all) has no way to honor it even if it were passed. A multi-frame GIF/TIFF supplied as an in-memory buffer always reports frame 0's geometry, regardless of Index — the buffer-based counterpart to pdfReadImageFormat2's file-based, genuinely-honored Index.

Parameters.

ParameterDescription
IPDFDocument handle.
BufferPointer to the in-memory image bytes.
BufSizeBuffer length in bytes.
IndexAccepted but silently ignored — always reads frame/image 0.
Width, Height, BitsPerPixel, UseZipSame semantics as pdfReadImageFormat.

Return value. True if the buffer decoded successfully; False otherwise.

C# (P/Invoke)

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

Core

Exported names

pdfReadImageFormatFromBuffer

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.