---
title: "Disable & remove download button in JavaScript PDF viewer | Nutrient"
canonical_url: "https://www.nutrient.io/guides/web/user-interface/main-toolbar/download-export-button/"
md_url: "https://www.nutrient.io/guides/web/user-interface/main-toolbar/download-export-button.md"
last_updated: "2026-05-20T07:45:29.091Z"
description: "Customize, add, or hide the PDF download button in your JavaScript viewer with Nutrient Web SDK. Use setToolbarItems() to enable export-pdf or create custom download handlers."
---

# Customizing download/export buttons in our JavaScript PDF viewer

The built-in download button can be activated using [`instance.setToolbarItems()`](https://www.nutrient.io/api/web/NutrientViewer.Instance.html#setToolbarItems):

```js

instance.setToolbarItems((items) =>
  items.concat([{ type: "export-pdf" }])
);

```

Or, if you prefer, you can also set it in the [`NutrientViewer.Configuration`](https://www.nutrient.io/api/web/NutrientViewer.Configuration.html) object passed to [`NutrientViewer.load()`](https://www.nutrient.io/api/web/NutrientViewer.html#.load):

```js

NutrientViewer.load({
  toolbarItems: NutrientViewer.defaultToolbarItems.concat([
    { type: "export-pdf" }
  ])
});

```

If you need more fine-grained control over the download operation, with [`instance.exportPDF()`](https://www.nutrient.io/api/web/NutrientViewer.Instance.html#exportPDF) and the possibility of [customizing the toolbar](https://www.nutrient.io/guides/web/user-interface/main-toolbar/customize-existing-tools.md), you can easily add your own download button to Nutrient Web SDK:

```js

const downloadButton = {
  type: "custom",
  id: "download-pdf",
  icon: "/download.svg",
  title: "Download",
  onPress: () => {
    pspdfkitInstance.exportPDF().then((buffer) => {
      const blob = new Blob([buffer], { type: "application/pdf" });
      const fileName = "document.pdf";
      if (window.navigator.msSaveOrOpenBlob) {
        window.navigator.msSaveOrOpenBlob(blob, fileName);
      } else {
        const objectUrl = window.URL.createObjectURL(blob);
        const a = document.createElement("a");
        a.href = objectUrl;
        a.style = "display: none";
        a.download = fileName;
        document.body.appendChild(a);
        a.click();
        window.URL.revokeObjectURL(objectUrl);
        document.body.removeChild(a);
      }
    });
  }
};

NutrientViewer.load({
  toolbarItems: NutrientViewer.defaultToolbarItems.concat([downloadButton])
});

```

## Hiding the download button

You can remove the `download` button from the toolbar by getting the array of current toolbar items via [`instance.toolbaritems`](https://www.nutrient.io/api/web/NutrientViewer.Instance.html#toolbarItems) and then filtering it and setting the new array:

```js

const items = instance.toolbarItems;
// Hide the toolbar item with the type "export-pdf" by removing it from the array of items.
instance.setToolbarItems(
  items.filter((item) => item.type!== "export-pdf")
);

```
---

## Related pages

- [Activate or deactivate tools in our viewer toolbar](/guides/web/customizing-the-interface/controlling-the-toolbar-via-api.md)
- [Create a new tool in PDF viewer toolbar](/guides/web/user-interface/main-toolbar/create-a-new-tool.md)
- [Configuring pager toolbar display behavior](/guides/web/user-interface/main-toolbar/pager-display.md)
- [Customizing tools in the JavaScript PDF viewer toolbar](/guides/web/user-interface/main-toolbar/customize-existing-tools.md)
- [Hiding the toolbar in our JavaScript PDF viewer](/guides/web/user-interface/main-toolbar/hide-the-toolbar.md)
- [Customize dropdown navigation in the viewer toolbar](/guides/web/user-interface/main-toolbar/dropdown-groups.md)
- [Adding page labels to navigation in our viewer](/guides/web/features/navigation-page-labels.md)
- [Adjust the placement of the toolbar in our viewer](/guides/web/user-interface/main-toolbar/placement.md)
- [Rearrange tools in our viewer toolbar](/guides/web/user-interface/main-toolbar/rearrange.md)
- [Customize the print button (hide/enable) in our JavaScript PDF viewer](/guides/web/user-interface/main-toolbar/print-button.md)
- [Removing a tool from the toolbar in our JavaScript viewer](/guides/web/customizing-the-interface/customizing-the-toolbar.md)
- [Customizing responsive navigation in our viewer toolbar](/guides/web/user-interface/main-toolbar/responsive-groups.md)

