API referenceCore SDK

pdfChangeJavaScriptName

Rename an entry in the document-level named-JavaScript table.

Exported namespdfChangeJavaScriptNameA, 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

C
BOOL32 __stdcall pdfChangeJavaScriptNameA(PPDF IPDF, uint32_t Handle, const char* Name);
BOOL32 __stdcall pdfChangeJavaScriptNameW(PPDF IPDF, uint32_t Handle, const wchar_t* Name);
Delphi
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

ParameterTypeDescription
IPDFPPDFInstance handle.
HandleCardinal1-based handle into the named-JavaScript table.
NamestringNew key name; empty string is rejected.

Return valueTRUE on success; FALSE if Handle is out of range, Name is empty, or the slot is empty.

See alsopdfChangeJavaScript

C# (P/Invoke)

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

Core

Exported names

pdfChangeJavaScriptNameA pdfChangeJavaScriptNameW

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.