pdfCreateExtGState
Register a new ExtGState resource from a fully-populated
int32_t __stdcall pdfCreateExtGState(PPDF IPDF, TPDFExtGState* GS);
function pdfCreateExtGState(const IPDF: PPDF; var GS: TPDFExtGState): Integer; stdcall;
Purpose. Register a new ExtGState resource from a fully-populated TPDFExtGState struct in one call (as opposed to configuring an existing ExtGState field-by-field via the individual pdfSetExtGState* setters covered in Extended Graphics State & Color Space Handles).
Description. Reads GS.FillAlpha/StrokeAlpha (clamped to 0.0..1.0), GS.BlendMode, GS.AlphaIsShape, GS.SoftMaskNone, and the G-35 prepress extras (OverPrintFill/OverPrintStroke/OverPrintMode/ AutoStrokeAdjust/TextKnockout — each individually validated to 0/1 via a local Bit() helper, any other value becomes -1/"not set"; RenderingIntent similarly must be <= 3 or becomes -1) plus FlatnessTol/SmoothnessTol, and registers them all into a new ExtGState entry. GS.SoftMask (a Pointer field in the struct) is never read — a caller-supplied soft-mask reference through this field has no effect; a real /SMask is instead attached to an ExtGState only via the separate CreateSoftMaskGS mechanism (built from a transparency-group template handle, not exposed as part of this struct-based creation call). The 7 Reserved1..Reserved7 pointer fields are, as their name states, untouched.
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
GS | Input struct. Every field is read and applied except GS.SoftMask, which is silently ignored. |
Return value. The new ExtGState handle on success; -1 if IPDF is invalid.
Remarks. To attach a real soft mask, create the ExtGState here (or via pdfInitExtGState+pdfSetExtGState) for the alpha/blend settings, and separately obtain a soft-mask-carrying ExtGState via the transparency-group mechanism if one is needed — the two are not combinable through this single call.
See also. pdfSetExtGState, pdfSetUndercolorRemovalFunction (a sibling ExtGState-field setter).
C# (P/Invoke)
public static extern int pdfCreateExtGState(IntPtr IPDF, ref TPDFExtGState GS);
Object Creation
pdfCreateExtGState
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.