pdfChangeJavaScriptName
Rename an entry in the document-level named-JavaScript table.
| Exported names | pdfChangeJavaScriptNameA, pdfChangeJavaScriptNameW |
|---|
Purpose — Rename an entry in the document-level named-JavaScript table.
Description — Same registry and handle space as pdfChangeJavaScript (FJSName); overwrites the key name in place. Note the underlying AddJavaScript treats names as unique keys and *merges* on insert (adding a script with an existing name overwrites that entry rather than creating a duplicate) — renaming via this call does not itself perform that dedup check, so renaming one entry to match another existing name can produce two entries with the same name.
Declarations
BOOL32 __stdcall pdfChangeJavaScriptNameA(PPDF IPDF, uint32_t Handle, const char* Name);
BOOL32 __stdcall pdfChangeJavaScriptNameW(PPDF IPDF, uint32_t Handle, const wchar_t* Name);
function pdfChangeJavaScriptNameA(const IPDF: PPDF; Handle: Cardinal; const Name: PAnsiChar): LongBool; stdcall; external 'LumasPdf.dll';
function pdfChangeJavaScriptNameW(const IPDF: PPDF; Handle: Cardinal; const Name: PWideChar): LongBool; stdcall; external 'LumasPdf.dll';
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
Handle | Cardinal | 1-based handle into the named-JavaScript table. |
Name | string | New key name; empty string is rejected. |
Return value — TRUE on success; FALSE if Handle is out of range, Name is empty, or the slot is empty.
See also — pdfChangeJavaScript
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Core
pdfChangeJavaScriptNameA
pdfChangeJavaScriptNameW
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.