# Show only print button in header

**URL:** https://pdfjs.community/t/show-only-print-button-in-header/1428
**Category:** Technical Support
**Created:** [March 1, 2022, 5:22pm UTC](https://pdfjs.community/t/show-only-print-button-in-header/1428 "2022-03-01T17:22:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sebastian.ancavil](https://avatars.discourse-cdn.com/v4/letter/s/977dab/32.png) [@sebastian.ancavil](https://pdfjs.community/u/sebastian.ancavil)
#### Post date: [March 1, 2022, 5:22pm UTC](https://pdfjs.community/t/show-only-print-button-in-header/1428/1 "2022-03-01T17:22:07Z")

</div>

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

I want to customize the header so that only the print icon is visible.

Note: I tried disabling all icons except the print icon but it didn’t work.

I thought of it this way:

```javascript
const newButton = {
                    type: 'actionButton',
                    img: 'icon-header-print-line',
                    title: 'action.print',
                    onClick: () => {
                        alert('Printing!');
                    },
                    dataElement: 'printButton',
                }

                    instance.UI.setHeaderItems((header) => {
                    const items = header.update([]); //erase all items
                    header.push(newButton)
                    }

```

But I don’t know how to show printModal ???

Thanks!!!

---

<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 1, 2022, 5:22pm UTC](https://pdfjs.community/t/show-only-print-button-in-header/1428/3 "2022-03-01T17:22:12Z")

</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:
- [Customize toolbar in viewer](https://pdfjs.express/documentation/ui-customization/customizing-header.8)
- [PDF.js Express Documentation - Customizing the UI](https://pdfjs.express/documentation#customizing-the-ui)
- [UI & toolbar customization sample](https://pdfjs.express/documentation/ui-customization/samples)

APIs:
- [PDF.js Express Utilities](https://pdfjs.express/api/utils/index.html#__anchor)
- [Adding a download button](https://pdfjs.express/api/utils/tutorial-Adding%20a%20download%20button.html#__anchor)
- [Core.Annotations.Forms.FieldManager - setPrintHandler()](https://pdfjs.express/api/Core.Annotations.Forms.FieldManager.html#setPrintHandler__anchor)

Forums:
- [How to change the icons of the header toolbar](https://pdfjs.community/t/how-to-change-the-icons-of-the-header-toolbar/1069/1)
- [How to customize UI?](https://pdfjs.community/t/how-to-customize-ui/1199/1)
- [How to hide and unhide thumbnail pages on button click?](https://pdfjs.community/t/how-to-hide-and-unhide-thumbnail-pages-on-button-click/1197/1)

---

<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 2, 2022, 4:25pm UTC](https://pdfjs.community/t/show-only-print-button-in-header/1428/4 "2022-03-02T16:25:08Z")

</div>

Hey there,

You’re super close! You can open the print modal with `instance.UI.print()`

```javascript
  const newButton = {
    type: 'actionButton',
    img: 'icon-header-print-line',
    title: 'action.print',
    onClick: () => {
        instance.UI.print()
    },
    dataElement: 'printButton',
  }

  instance.UI.setHeaderItems((header) => {
    const items = header.update([]); //erase all items
    header.push(newButton)
  }

```

Thanks,  
Logan
