# Custom Button FreeText

**URL:** <https://pdfjs.community/t/custom-button-freetext/3726>\
**Category:** Technical Support\
**Created:** [June 13, 2025, 11:31am UTC](https://pdfjs.community/t/custom-button-freetext/3726 "2025-06-13T11:31:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elvisdosreis](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/elvisdosreis/32/311_2.png) [@elvisdosreis](https://pdfjs.community/u/elvisdosreis)\
**Post date:** [June 13, 2025, 11:31am UTC](https://pdfjs.community/t/custom-button-freetext/3726/1 "2025-06-13T11:31:57Z")

</div>

I have a custom button bar and I need to add another “FreeText” button but I can’t find the code for the button

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

```javascript
instance.UI.setHeaderItems(header => {
        const items = header.getItems();
        const lateral = items.slice(0, 1)[0];
        this.zoom = items.slice(3, 4)[0];
        const menu = [ {
          type: 'toolButton',
          toolName: 'AnnotationCreateDistanceMeasurement'
        }, {
          type: 'toolButton',
          toolName: 'AnnotationCreatePerimeterMeasurement'
        }, {
          type: 'toolButton',
          toolGroup: 'shapeTools',
          toolName: 'AnnotationCreateArcMeasurement'
        }, {
          type: 'toolButton',
          toolGroup: 'shapeTools',
          toolName: 'AnnotationCreateAreaMeasurement'
        }, {
          type: 'toolButton',
          toolGroup: 'shapeTools',
          toolName: 'AnnotationCreateRectangularAreaMeasurement'
        }, {
          type: 'toolButton',
          toolGroup: 'shapeTools',
          toolName: 'AnnotationCreateEllipseMeasurement'
        }, {
          type: 'toolButton',
          toolGroup: 'shapeTools',
          toolName: 'AnnotationCreateRectangle'
        }, {
          type: 'toolButton',
          toolGroup: 'shapeTools',
          toolName: 'AnnotationCreateEllipse'
        }, {
          type: 'toolButton',
          toolGroup: 'shapeTools',
          toolName: 'AnnotationCreateFreeHandHighlight'
        }, {
          type: 'toolButton',
          toolGroup: 'shapeTools',
          toolName: 'AnnotationCreateArrow'
        }, {
          type: 'toolButton',
          toolName: 'AnnotationCreateCallout'
        }
      });

```

---

<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, 2025, 1:57pm UTC](https://pdfjs.community/t/custom-button-freetext/3726/2 "2025-06-13T13:57:08Z")

</div>

Hi there,

You can find the full list of Tools in the API documentation here:

> **[PDFJS Express WebViewer Namespace: Tools](https://pdfjs.express/api/Core.Tools.html)**

For the free-text tool, that would be equivalent to

```javascript
Core.Tools.ToolNames.FREETEXT = 'AnnotationCreateFreeText'

```

best regards,  
Kevin
