pdfReadImageFormatFromBuffer
Same inspection as pdfReadImageFormat, but decoding an
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);
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.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
Buffer | Pointer to the in-memory image bytes. |
BufSize | Buffer length in bytes. |
Index | Accepted but silently ignored — always reads frame/image 0. |
Width, Height, BitsPerPixel, UseZip | Same semantics as pdfReadImageFormat. |
Return value. True if the buffer decoded successfully; False otherwise.
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Core
pdfReadImageFormatFromBuffer
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.