| Category | Optional content |
|---|---|
| Exported names | pdfChangeOCGNameA, 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
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
Handle | Cardinal | OCG handle from pdfCreateOCG. |
Value | string | New display name. Empty is rejected. |
Return value — TRUE on success; FALSE if Handle is out of range or Value is empty.
See also — pdfCreateOCG
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.