API referencePDF/A & Conformance

pdfAddMaskImage

Attach an explicit stencil/soft-mask buffer (/Mask or

C
BOOL32 __stdcall pdfAddMaskImage(PPDF IPDF, uint32_t BaseImage, void* Buffer, uint32_t BufSize, int32_t Stride, uint32_t BitsPerPixel, uint32_t Width, uint32_t Height);
Delphi
function pdfAddMaskImage(const IPDF: PPDF; BaseImage: Cardinal; const Buffer: Pointer; BufSize: Cardinal; Stride: Integer; BitsPerPixel, Width, Height: Cardinal): LongBool; stdcall;

Purpose. Attach an explicit stencil/soft-mask buffer (/Mask or /SMask, depending on BitsPerPixel) to an already-inserted base image — for image transparency not already encoded in the base image's own alpha channel.

Parameters.

ParameterDescription
IPDFDocument handle.
BaseImageThe already-inserted image handle to attach the mask to.
Buffer, BufSize, StrideRaw mask pixel data and its row stride.
BitsPerPixel1 = stencil mask (/Mask); 8 = soft mask (/SMask), per the standard PDF convention.
Width, HeightMask dimensions.

Return value. True on success.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
PDF/A & Conformance
Category

Content Creation

Exported names

pdfAddMaskImage

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.