API referenceCore SDK

pdfGetLayerConfig

Read metadata (intent, default flag, name) for one configuration

CategoryOptional content

Purpose — Read metadata (intent, default flag, name) for one configuration by index.

DescriptionIndex=0 always returns IsDefault=TRUE, Intent=oiView (4), NameA=NULL (the built-in default config is unnamed). Index >= 1 reads a named config's stored Intent and Name.

Declarations

C
BOOL32 __stdcall pdfGetLayerConfig(PPDF IPDF, int32_t Index, TPDFOCLayerConfig* Config);
Delphi
function pdfGetLayerConfig(const IPDF: PPDF; Index: Integer; var Config: TPDFOCLayerConfig): LongBool; stdcall; external 'LumasPdf.dll';

TPDFOCLayerConfig:

Delphi
TPDFOCLayerConfig = record
  StructSize: Cardinal;
  Intent:     Cardinal;    // TOCGIntent: oiDesign=2, oiView=4 (default), oiAll=8
  IsDefault:  LongBool;
  NameA:      PAnsiChar;   // engine-owned; nil for the (unnamed) default config
  NameW:      PWideChar;   // always nil in this build
  NameLen:    Cardinal;
end;

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
IndexInteger0..pdfGetLayerConfigCount-1.
ConfigTPDFOCLayerConfig*Receives the metadata; Config.StructSize is written by this call (unlike several sibling getters in this SDK).

Return valueTRUE if Index is in range; FALSE otherwise.

Memory & buffersConfig.NameA points into an engine-owned buffer valid until the next call on the same handle.

See alsopdfGetLayerConfigCount, pdfLoadLayerConfig

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Core SDK
Category

Getters

Exported names

pdfGetLayerConfig

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.