API referenceCore SDK

pdfLockLayer

Mark a layer as locked (its /Locked entry in /OCProperties/D)

CategoryOptional 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

ParameterTypeDescription
IPDFPPDFInstance handle.
LayerCardinalOCG handle to lock.

Return valueTRUE 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 alsopdfUnLockLayer

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.