---
title: "Disable print option in PDF using JavaScript | Nutrient SDK"
canonical_url: "https://www.nutrient.io/guides/web/print/disable-printing/"
md_url: "https://www.nutrient.io/guides/web/print/disable-printing.md"
last_updated: "2026-05-18T04:02:30.353Z"
description: "Sometimes you won’t want your users to be able to print the content you serve. This guide outlines the default printing behavior."
---

# Disable print options in PDFs using JavaScript

Sometimes you won’t want your users to be able to print the content you serve. This guide outlines the default printing behavior and then shows a few ways to disable printing.

## Web SDK with Document Engine

The [printing toolbar item](https://www.nutrient.io/api/web/NutrientViewer.html#.defaultToolbarItems) is enabled by default when the [`download` permission](https://www.nutrient.io/api/reference/document-engine/upstream/#tag/Documents/operation/fetch-document-info) is granted in the JSON Web Token (JWT) used for authentication. This permission is required so that the client can access the raw PDF document needed.

## Web SDK

The [printing toolbar item](https://www.nutrient.io/api/web/NutrientViewer.html#.defaultToolbarItems) is always enabled by default.

## Enabling and disabling printing via the JavaScript API

It’s possible to enable or disable printing via [`instance.setViewState()`](https://www.nutrient.io/api/web/NutrientViewer.Instance.html#setViewState), which allows you to toggle the [`allowPrinting`](https://www.nutrient.io/api/web/NutrientViewer.ViewState.html#allowPrinting) flag.

Below is an example of how to disable printing:

```js

instance.setViewState((state) => state.set("allowPrinting", false));

```

The button will be marked as `disabled` in the main toolbar. Refer to the [Toolbar API](https://www.nutrient.io/api/web/NutrientViewer.Instance.html#setToolbarItems) to find out how to remove the print button when it’s disabled.

## Disable high-quality printing

When `NutrientViewer.PrintMode.DOM` is used as the print mode, the printed document will have a resolution of 300 DPI. You can reduce the resolution to 150 DPI by [disabling high-quality printing](https://www.nutrient.io/guides/web/features/document-permissions.md#high-quality-printing).
---

## Related pages

- [Auto print PDFs using JavaScript](/guides/web/print/auto-print.md)
- [Print PDFs from URLs using JavaScript](/guides/web/print/from-url.md)
- [Print PDFs from Base64 using JavaScript](/guides/web/print/from-base64.md)
- [Print PDFs without opening using JavaScript](/guides/web/print/without-opening-pdf.md)
- [Print to PDFs programmatically using JavaScript](/guides/web/features/printing.md)
- [Print modes in our JavaScript PDF viewer](/guides/web/print/print-modes.md)
- [JavaScript library to print PDFs](/guides/web/print.md)
- [Print PDFs from a Blob using JavaScript](/guides/web/print/from-blob.md)
- [Print PDFs without annotations using JavaScript](/guides/web/print/without-annotations.md)

