# How to get active toolname

**URL:** <https://pdfjs.community/t/how-to-get-active-toolname/3108>\
**Category:** Technical Support\
**Created:** [January 26, 2024, 6:25am UTC](https://pdfjs.community/t/how-to-get-active-toolname/3108 "2024-01-26T06:25:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shahid.shaikh](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@shahid.shaikh](https://pdfjs.community/u/shahid.shaikh)\
**Post date:** [January 26, 2024, 6:25am UTC](https://pdfjs.community/t/how-to-get-active-toolname/3108/1 "2024-01-26T06:25:46Z")

</div>

**Which product are you using?**  
PDF.js Express Plus

**PDF.js Express Version**  
8.7.4

**Detailed description of issue**  
How to get active tool name programmatically on document load

**Expected behaviour**

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/4/447c74fcd8744c6abb7052c267f30d4d6f0ee90a.png)

---

<div class="post-metadata">

**Author:** ![darian.chen](https://avatars.discourse-cdn.com/v4/letter/d/3d9bf3/32.png) [@darian.chen](https://pdfjs.community/u/darian.chen)\
**Post date:** [January 26, 2024, 8:36pm UTC](https://pdfjs.community/t/how-to-get-active-toolname/3108/2 "2024-01-26T20:36:37Z")

</div>

Hello Shahid,

You can obtain the active tool in the viewer programmatically like so:

```javascript
instance.Core.documentViewer.getToolMode().name;

```

Best Regards,  
Darian
