API referenceImport & 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.

C
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)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfInsertBMPFromBuffer(IntPtr IPDF, double PosX, double PosY, double ScaleWidth, double ScaleHeight, IntPtr Buffer);
Area
Import & Output APIs
Category

Core

Exported names

pdfInsertBMPFromBuffer

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.