| Category | Optional content |
|---|
Purpose — Mark a layer as locked (its /Locked entry in /OCProperties/D) so a compliant viewer prevents the end user from toggling it.
Declarations
C
BOOL32 __stdcall pdfLockLayer(PPDF IPDF, uint32_t Layer);
Delphi
function pdfLockLayer(const IPDF: PPDF; Layer: Cardinal): LongBool; stdcall; external 'LumasPdf.dll';
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
Layer | Cardinal | OCG handle to lock. |
Return value — TRUE if Layer is a valid OCG; FALSE otherwise. Locking is advisory to viewers — this engine's own content-writing calls are not themselves restricted by the locked flag.
See also — pdfUnLockLayer
C# (P/Invoke)
wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Core SDK
Category
Core
Exported names
pdfLockLayer
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.