API referenceCore SDK

pdfCreateSoftMask

Build an ExtGState carrying a real /SMask soft mask

C
void* __stdcall pdfCreateSoftMask(PPDF IPDF, uint32_t TranspGroup, TSoftMaskType MaskType, uint32_t BackColor);
Delphi
function pdfCreateSoftMask(const IPDF: PPDF; TranspGroup: Cardinal; MaskType: TSoftMaskType; BackColor: Cardinal): Pointer; stdcall;

Purpose. Build an ExtGState carrying a real /SMask soft mask (luminosity or alpha) derived from an existing transparency-group template (pdfBeginTransparencyGroup above) — the mechanism referenced back in Patterns, Shadings, ExtGState Creation, and Template Placement as the way to attach a genuine soft mask, since pdfCreateExtGState's own GS.SoftMask struct field is dropped.

Description. MaskType is reduced to a binary check — MaskType = smtLuminosity becomes the boolean passed to CreateSoftMaskGS; any other TSoftMaskType value (e.g. an alpha-type mask, if the enum defines one) is treated the same as "not luminosity" rather than being distinctly handled.

Parameters.

ParameterDescription
IPDFDocument handle.
TranspGroupHandle of an existing transparency-group template.
MaskTypeOnly smtLuminosity is distinctly recognized; every other value collapses to the same "non-luminosity" path.
BackColorThe mask's backdrop color.

Return value. An opaque ExtGState handle (as a Pointer), consumable via pdfSetExtGState (Extended Graphics State & Color Space Handles); nil if TranspGroup doesn't resolve to an existing template or IPDF is invalid.

See also. pdfBeginTransparencyGroup, pdfSetExtGState.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern IntPtr pdfCreateSoftMask(IntPtr IPDF, uint TranspGroup, TSoftMaskType MaskType, uint BackColor);
Area
Core SDK
Category

Object Creation

Exported names

pdfCreateSoftMask

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.