| Category | Optional content |
|---|
Purpose — Read back a layer's /Usage dictionary fields.
Description — Fills Value from the stored usage state. If pdfSetOCGContUsage was never called for this handle, all state fields come back -1 (unset) and strings empty — this is still a TRUE (valid-handle) result, distinct from a FALSE invalid-handle result. UserNameA reflects only the first registered user name even if multiple were added via pdfSetOCGContUsage; use pdfGetOCGUsageUserName to enumerate the full list.
Declarations
BOOL32 __stdcall pdfGetOCGContUsage(PPDF IPDF, uint32_t Handle, TPDFOCGContUsage* Value);
function pdfGetOCGContUsage(const IPDF: PPDF; Handle: Cardinal; var Value: TPDFOCGContUsage): LongBool; stdcall; external 'LumasPdf.dll';
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
Handle | Cardinal | OCG handle. |
Value | TPDFOCGContUsage* | Receives the usage state; Value.StructSize is written by this call. |
Return value — TRUE if Handle is a valid OCG (regardless of whether usage was ever set); FALSE if Handle is out of range.
See also — pdfSetOCGContUsage, pdfGetOCGUsageUserName
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Getters
pdfGetOCGContUsage
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.