API reference › Import & Output APIs
pdfInsertBMPFromBuffer
Place a BMP image held in memory onto the open page.
Purpose — Place a BMP image held in memory onto the open page.
Description — Validates the BM signature and takes the byte count from the BMP file header (bfSize at offset 2) — no separate size argument exists in this ABI, so the header must be intact. The image is then inserted exactly like pdfInsertImageFromBuffer at PosX/PosY scaled to ScaleWidth×ScaleHeight.
int32_t __stdcall pdfInsertBMPFromBuffer(PPDF IPDF, double PosX, double PosY, double ScaleWidth, double ScaleHeight, void* Buffer);
Return value — Image handle (> 0); 0 on failure (NULL buffer, bad signature, zero header size, decode failure, no open page).
C# (P/Invoke)
public static extern int pdfInsertBMPFromBuffer(IntPtr IPDF, double PosX, double PosY, double ScaleWidth, double ScaleHeight, IntPtr Buffer);
Core
pdfInsertBMPFromBuffer
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.