# Want to get the toolname

**URL:** <https://pdfjs.community/t/want-to-get-the-toolname/2632>\
**Category:** Feature Requests\
**Created:** [June 12, 2023, 1:21pm UTC](https://pdfjs.community/t/want-to-get-the-toolname/2632 "2023-06-12T13:21:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shubham.gunjal](https://avatars.discourse-cdn.com/v4/letter/s/e56c9b/32.png) [@shubham.gunjal](https://pdfjs.community/u/shubham.gunjal)\
**Post date:** [June 12, 2023, 1:21pm UTC](https://pdfjs.community/t/want-to-get-the-toolname/2632/1 "2023-06-12T13:21:01Z")

</div>

Hi,  
I want to get toolname on tool click of Toolheader.  
For example When I click on Annotation tool-Group,and further click on Tools like “Highlight” or “Note”,  
I should get its name. So that I can use that name with other Api calls.  
Please help me out with toolname on tool click.

---

<div class="post-metadata">

**Author:** ![kkim](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@kkim](https://pdfjs.community/u/kkim)\
**Post date:** [June 12, 2023, 4:09pm UTC](https://pdfjs.community/t/want-to-get-the-toolname/2632/2 "2023-06-12T16:09:01Z")

</div>

Hi there,

Thank you for contacting pdf.js express forums,

Here is our general guide on customizing toolbar in the viewer:

> **[PDF.js Express Viewer Customize Toolbar | Documentation](https://pdfjs.express/documentation/ui-customization/customizing-header.8)**

To get the specific toolnames, you can see them in the API docs here:  
[https://pdfjs.express/api/Core.Tools.html#.ToolNames](https://pdfjs.express/api/Core.Tools.html#.ToolNames)

If you need the tool that you are currently on, you can use the following API:  
UI: instance.UI.getToolMode().name  
or  
Core: instance.Core.documentViewer.getToolMode().name

Best regards,  
Kevin Kim

---

<div class="post-metadata">

**Author:** ![shubham.gunjal](https://avatars.discourse-cdn.com/v4/letter/s/e56c9b/32.png) [@shubham.gunjal](https://pdfjs.community/u/shubham.gunjal)\
**Post date:** [June 13, 2023, 12:25pm UTC](https://pdfjs.community/t/want-to-get-the-toolname/2632/3 "2023-06-13T12:25:18Z")

</div>

I am able to get the tool name.  
Thank You.  
But, I am not able to get the code to get click event for tools(on the tool-Header).  
I want to access the tool name as and when I click on the tool.  
So, provide me the integrated code where I can have tool name on clicking the tool.  
Thank You.

---

<div class="post-metadata">

**Author:** ![kkim](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@kkim](https://pdfjs.community/u/kkim)\
**Post date:** [June 13, 2023, 2:36pm UTC](https://pdfjs.community/t/want-to-get-the-toolname/2632/4 "2023-06-13T14:36:08Z")

</div>

Hi there,

We do not have an event for when a tool is clicked, but we do have an event when the tool bar group changes:  
[https://pdfjs.express/api/UI.html#event:toolbarGroupChanged](https://pdfjs.express/api/UI.html#event:toolbarGroupChanged)

If you would like a specific event for when the tool is selected, you can follow the advanced UI customization here: [Advanced Customization with PDF.js Express Viewer | Documentation](https://pdfjs.express/documentation/ui-customization/advanced-customization)

Best regards,  
Kevin Kim
