API referenceAnnotations

pdfSet3DAnnotScript

Configure a 3D annotation's activation/deactivation behavior

C
BOOL32 __stdcall pdfSet3DAnnotProps(PPDF IPDF, uint32_t Annot, int32_t ActType, int32_t DeActType, int32_t InstType, int32_t DeInstType, BOOL32 DisplToolbar, BOOL32 DisplModelTree);
BOOL32 __stdcall pdfSet3DAnnotScriptA(PPDF IPDF, uint32_t Annot, const char* Value, uint32_t Len);
Delphi
function pdfSet3DAnnotProps(const IPDF: PPDF; Annot: Cardinal; ActType, DeActType, InstType, DeInstType: Integer; DisplToolbar, DisplModelTree: LongBool): LongBool; stdcall;
function pdfSet3DAnnotScriptA(const IPDF: PPDF; Annot: Cardinal; const Value: PAnsiChar; Len: Cardinal): LongBool; stdcall;

Purpose. Configure a 3D annotation's activation/deactivation behavior (/3DA — when the 3D view activates/deactivates and whether it's instantiated/uninstantiated then) and toolbar/model-tree UI visibility (pdfSet3DAnnotProps); attach a 3D-view JavaScript "on instantiate" script (pdfSet3DAnnotScript).

Description. pdfSet3DAnnotScript's Len is honored when both Value is non-null and Len > 0 (an explicit-length copy, allowing embedded nulls in the script text); otherwise it falls back to treating Value as a plain null-terminated C string. This is a real, length-aware code path, not a dropped parameter.

Parameters.

ParameterDescription
IPDFDocument handle.
AnnotDocument-wide 3D-annotation handle.
ActType, DeActType, InstType, DeInstTypeActivation/deactivation/instantiation trigger codes.
DisplToolbar, DisplModelTreeUI chrome visibility flags.
Value, Len*(Script only)* Script source; Len enables embedded-null-safe copying when > 0.

Return value. True if Annot resolves to a 3D annotation; False otherwise.

C# (P/Invoke)

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

Setters

Exported names

pdfSet3DAnnotScriptA

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.