# Force tool button panToolButton starting enabled by default

**URL:** <https://pdfjs.community/t/force-tool-button-pantoolbutton-starting-enabled-by-default/1449>\
**Category:** Technical Support\
**Created:** [March 6, 2022, 3:51pm UTC](https://pdfjs.community/t/force-tool-button-pantoolbutton-starting-enabled-by-default/1449 "2022-03-06T15:51:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![luigi](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@luigi](https://pdfjs.community/u/luigi)\
**Post date:** [March 6, 2022, 3:51pm UTC](https://pdfjs.community/t/force-tool-button-pantoolbutton-starting-enabled-by-default/1449/1 "2022-03-06T15:51:44Z")

</div>

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

**PDF.js Express Version**  
PDF.js Express Free Viewer

**Detailed description of issue**  
Programmatically in javascript I want “click” or enabled tool button “panToolButton”

**Expected behaviour**  
 ![imagen](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/0ca569161d51d3ad60af5589c41108585afe4fcf.png)

**Does your issue happen with every document, or just one?**  
Every

**Link to document**  
nop

**Code snippet**  
nop

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/ffbcd25c7d423db8d5acd5db201c272f4db306dd.png) [@system](https://pdfjs.community/u/system)\
**Post date:** [March 6, 2022, 3:51pm UTC](https://pdfjs.community/t/force-tool-button-pantoolbutton-starting-enabled-by-default/1449/3 "2022-03-06T15:51:49Z")

</div>

**Hello, I’m Ron, an automated tech support bot 🤖**

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:
- [Hiding/Showing DOM elements in WebViewer UI - List of elements](https://pdfjs.express/documentation/ui-customization/hiding-elements#list-of-elements)
- [Customize toolbar in viewer - Header items - ToolGroupButton](https://pdfjs.express/documentation/ui-customization/customizing-header.8#toolgroupbutton)
- [Customizing WebViewer UI Popups](https://pdfjs.express/documentation/ui-customization/customizing-popup.8)

APIs:
- [Core.Tools.TextUnderlineCreateTool - enableImmediateActionOnAnnotationSelection()](https://pdfjs.express/api/Core.Tools.TextUnderlineCreateTool.html#enableImmediateActionOnAnnotationSelection__anchor)
- [Core.Tools.TextStrikeoutCreateTool - setEnableImmediateActionOnAnnotationSelection(enable)](https://pdfjs.express/api/Core.Tools.TextStrikeoutCreateTool.html#setEnableImmediateActionOnAnnotationSelection__anchor)
- [UI.Popup](https://pdfjs.express/api/UI.Popup.html#__anchor)

Forums:
- [URGENT - Merge XFDF API giving [502] internal error](https://pdfjs.community/t/urgent-merge-xfdf-api-giving-502-internal-error/1092/1)
- [Add “Full Screen” button to main toolbar](https://pdfjs.community/t/add-full-screen-button-to-main-toolbar/1371/1)
- [How to Pan while tracing by pressing and holding the left click of the mouse](https://pdfjs.community/t/how-to-pan-while-tracing-by-pressing-and-holding-the-left-click-of-the-mouse/531/1)

---

<div class="post-metadata">

**Author:** ![dnavarro](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/dnavarro/32/707_2.png) [@dnavarro](https://pdfjs.community/u/dnavarro)\
**Post date:** [March 8, 2022, 5:51pm UTC](https://pdfjs.community/t/force-tool-button-pantoolbutton-starting-enabled-by-default/1449/4 "2022-03-08T17:51:20Z")

</div>

Hi Luigi,

Thanks for your question.

Here is a code snippet to help you enable the panToolButton.

```javascript
import WebViewer from '@pdftron/pdfjs-express-viewer'

WebViewer({
...options
}).then(instance => {

const { Tools } = instance.Core;

const panTool = Tools.ToolNames.PAN;

instance.UI.setToolMode(panTool);

})

```

Hope this helps and let me know if this approach works for you.

Thank you,

Dandara

---

<div class="post-metadata">

**Author:** ![luigi](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@luigi](https://pdfjs.community/u/luigi)\
**Post date:** [March 8, 2022, 8:52pm UTC](https://pdfjs.community/t/force-tool-button-pantoolbutton-starting-enabled-by-default/1449/5 "2022-03-08T20:52:06Z")

</div>

Hi Dandara!!! Sounds good and works perfectly!!! Thanks!!! You win a “paella valenciana”, I’m from Valencia (Spain) 😉. See you my next problem. 😂

---

<div class="post-metadata">

**Author:** ![dnavarro](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/dnavarro/32/707_2.png) [@dnavarro](https://pdfjs.community/u/dnavarro)\
**Post date:** [March 8, 2022, 10:21pm UTC](https://pdfjs.community/t/force-tool-button-pantoolbutton-starting-enabled-by-default/1449/6 "2022-03-08T22:21:35Z")

</div>


