# HOOPS Advanced Publish 3D Annotation JavaScript API

**URL:** <https://forum.techsoft3d.com/t/hoops-advanced-publish-3d-annotation-javascript-api/4056>\
**Category:** HOOPS Exchange\
**Tags:** code, sample, how-to, 3d-pdf\
**Created:** [September 24, 2024, 3:56pm UTC](https://forum.techsoft3d.com/t/hoops-advanced-publish-3d-annotation-javascript-api/4056 "2024-09-24T15:56:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![justin.larosa](https://avatars.discourse-cdn.com/v4/letter/j/73ab20/32.png) [@justin.larosa](https://forum.techsoft3d.com/u/justin.larosa)\
**Post date:** [September 24, 2024, 3:56pm UTC](https://forum.techsoft3d.com/t/hoops-advanced-publish-3d-annotation-javascript-api/4056/1 "2024-09-24T15:56:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Man](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Man](https://forum.techsoft3d.com/u/Man)\
**Post date:** [September 27, 2024, 11:15am UTC](https://forum.techsoft3d.com/t/hoops-advanced-publish-3d-annotation-javascript-api/4056/2 "2024-09-27T11:15:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Man](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Man](https://forum.techsoft3d.com/u/Man)\
**Post date:** [September 30, 2024, 12:46pm UTC](https://forum.techsoft3d.com/t/hoops-advanced-publish-3d-annotation-javascript-api/4056/3 "2024-09-30T12:46:19Z")

</div>

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.

```auto
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
