API referenceCore SDK

pdfGetOCGContUsage

Read back a layer's /Usage dictionary fields.

CategoryOptional 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

C
BOOL32 __stdcall pdfGetOCGContUsage(PPDF IPDF, uint32_t Handle, TPDFOCGContUsage* Value);
Delphi
function pdfGetOCGContUsage(const IPDF: PPDF; Handle: Cardinal; var Value: TPDFOCGContUsage): LongBool; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
HandleCardinalOCG handle.
ValueTPDFOCGContUsage*Receives the usage state; Value.StructSize is written by this call.

Return valueTRUE if Handle is a valid OCG (regardless of whether usage was ever set); FALSE if Handle is out of range.

See alsopdfSetOCGContUsage, pdfGetOCGUsageUserName

C# (P/Invoke)

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

Getters

Exported names

pdfGetOCGContUsage

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.