API referenceCore SDK

pdfGetOCGUsageUserName

Enumerate all /User /Name entries registered for a layer (not

CategoryOptional content

Purpose — Enumerate all /User /Name entries registered for a layer (not just the first one, unlike pdfGetOCGContUsage).

Description — Returns the Index-th user name previously appended via repeated pdfSetOCGContUsage calls with a non-empty UserNameA/W.

Declarations

C
BOOL32 __stdcall pdfGetOCGUsageUserName(PPDF IPDF, uint32_t Handle, uint32_t Index, const char* NameA, const wchar_t* NameW);
Delphi
function pdfGetOCGUsageUserName(const IPDF: PPDF; Handle, Index: Cardinal; var NameA: PAnsiChar; var NameW: PWideChar): LongBool; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
HandleCardinalOCG handle.
IndexCardinalZero-based position in the accumulated user-name list.
NameAPAnsiChar*Receives the ANSI name.
NameWPWideChar*Receives the same name as UTF-16 (derived from the ANSI buffer).

Return valueTRUE if Handle is valid and Index is within the accumulated list; FALSE otherwise (including when no usage names were ever registered for this OCG).

Memory & buffers — Both out pointers are backed by the same engine-owned buffer, valid until the next call on this instance.

See alsopdfSetOCGContUsage

C# (P/Invoke)

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

Getters

Exported names

pdfGetOCGUsageUserName

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.