HOOPS Advanced Publish 3D Annotation JavaScript API

Hello,

Is there sample code available that references this HOOPS Advanced Publish API;

CHECK_RET(A3DPDF3DAnnotSetActionJavascript(pPage, p3DAnnot,kA3DPDFEventFieldMouseDown, zoomLevelJavaScriptCode));

I was trying to figure out why my JavaScript wasn’t working, and as a simple test, I am calling this API with a ‘Hello World’ script, and it will still not log to the console when there’s a mouse down event on the p3DAnnot.

Thanks,
Justin

Hello Justin,
I noticed this issue when using kA3DPDFEventFieldMouseDown . I will check with the engineering team and get back to you soon.
However, if you need to verify that your Javascript is working correctly, I recommend setting kA3DPDFEventPageVisible to check the result.

Best Regards,
Siew Man LEE
Developer Support Engineer | Tech Soft 3D

Hello Justin,

After further analysis by our engineer, this is a restriction of Acrobat. HOOPS does create the JavaScript correctly, but Adobe does not execute the mouse events.

std::string sJS = "console.println(\"kA3DPDFEventFieldMouseUp\");\n";
A3DPDF3DAnnotSetActionJavascript(pPage, p3DAnnot, kA3DPDFEventFieldMouseUp, sJS.c_str());

Best Regards,
Siew Man LEE
Developer Support Engineer | Tech Soft 3D