# Custom UI event button

**URL:** <https://pdfjs.community/t/custom-ui-event-button/590>\
**Category:** Technical Support\
**Created:** [March 9, 2021, 2:13pm UTC](https://pdfjs.community/t/custom-ui-event-button/590 "2021-03-09T14:13:52Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)\
**Post date:** [March 9, 2021, 4:30pm UTC](https://pdfjs.community/t/custom-ui-event-button/590/2 "2021-03-09T16:30:56Z")

</div>

Hi,

For the zoom buttons, you can use the [setZoomLevel](https://pdfjs.express/api/WebViewerInstance.html#setZoomLevel__anchor) API to change the zoom.

For the eraser tool and pan tool, you can call

```javascript
// eraser
instance.setToolMode(
    instance.Tools.ToolNames.ERASER
  )

// pan
instance.setToolMode(
    instance.Tools.ToolNames.PAN
  )

```

Thanks!  
Logan

---

_[View the full topic](https://pdfjs.community/t/custom-ui-event-button/590)._
