API referenceCore SDK

pdfChangeOCGName

Rename an existing layer.

CategoryOptional content
Exported namespdfChangeOCGNameA, pdfChangeOCGNameW

Purpose — Rename an existing layer.

Description — Overwrites the display name of the OCG at Handle. The internal content-stream alias (OCn) is unaffected — existing /OC /OCn BDC references in already-written content remain valid.

Declarations

C
BOOL32 __stdcall pdfChangeOCGNameA(PPDF IPDF, uint32_t Handle, const char* Value);
BOOL32 __stdcall pdfChangeOCGNameW(PPDF IPDF, uint32_t Handle, const wchar_t* Value);
Delphi
function pdfChangeOCGNameA(const IPDF: PPDF; Handle: Cardinal; const Value: PAnsiChar): LongBool; stdcall; external 'LumasPdf.dll';
function pdfChangeOCGNameW(const IPDF: PPDF; Handle: Cardinal; const Value: PWideChar): LongBool; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
HandleCardinalOCG handle from pdfCreateOCG.
ValuestringNew display name. Empty is rejected.

Return valueTRUE on success; FALSE if Handle is out of range or Value is empty.

See alsopdfCreateOCG

C# (P/Invoke)

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

Core

Exported names

pdfChangeOCGNameA pdfChangeOCGNameW

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.