pdfGetOCGUsageUserName
Enumerate all /User /Name entries registered for a layer (not
| Category | Optional 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
BOOL32 __stdcall pdfGetOCGUsageUserName(PPDF IPDF, uint32_t Handle, uint32_t Index, const char* NameA, const wchar_t* NameW);
function pdfGetOCGUsageUserName(const IPDF: PPDF; Handle, Index: Cardinal; var NameA: PAnsiChar; var NameW: PWideChar): LongBool; stdcall; external 'LumasPdf.dll';
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
Handle | Cardinal | OCG handle. |
Index | Cardinal | Zero-based position in the accumulated user-name list. |
NameA | PAnsiChar* | Receives the ANSI name. |
NameW | PWideChar* | Receives the same name as UTF-16 (derived from the ANSI buffer). |
Return value — TRUE 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 also — pdfSetOCGContUsage
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Getters
pdfGetOCGUsageUserName
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.