---
title: "JavaScript secure PDF viewer | Nutrient SDK"
canonical_url: "https://www.nutrient.io/guides/web/document-security/"
md_url: "https://www.nutrient.io/guides/web/document-security.md"
last_updated: "2026-06-08T16:26:44.137Z"
description: "Enhance your document security: Discover expert tips and best practices to safeguard your content. Dive in now!"
---

# Document security in our JavaScript PDF viewer

Nutrient Web SDK offers developers control over document security when PDF, Word, Excel, PowerPoint, or image files are displayed in the viewer.

[Try for free](https://www.nutrient.io/sdk/web/getting-started.md)

[Launch demo](https://www.nutrient.io/demo/document-security)

## Quick start

Open a password-protected PDF document:

```js

NutrientViewer.load({
  container: "#pspdfkit",

  document: "/path/to/protected.pdf",
  password: "user-password"
}).then((instance) => {
    console.log("Protected document opened");
  }).catch((error) => {
    if (error.message.includes("password")) {
      console.error("Invalid password");
    } else {
      console.error("Failed to open:", error.message);
    }
  });

```

## Key capabilities

- **Dynamic watermarks** — Render user identifiers on top of a PDF

- **Disable PDF export** — Remove the download button

- **Set and enforce permissions** — Disable printing and copying

- **Password protected** — Programmatically encrypt or decrypt PDF documents

- **Extendable** — Add digital signatures, redaction, and more

## Guides for document security

**[Prevent print or download](https://www.nutrient.io/guides/web/document-security/prevent-print-or-download.md)**\
How to configure printing and make it difficult to download PDFs

**[Open without downloading](https://www.nutrient.io/guides/web/document-security/open-without-downloading.md)**\
How to make it difficult to download PDF documents

**[Add a watermark](https://www.nutrient.io/guides/web/document-security/add-a-watermark.md)**\
How to render dynamic watermarks on top of a PDF document

**[Password protect a PDF](https://www.nutrient.io/guides/web/document-security/password-protect-pdf.md)**\
How to protect a PDF document with a password

**[With Document Engine](https://www.nutrient.io/guides/web/document-security/with-server-backed.md)**\
Learn how Nutrient Web SDK with Document Engine improves document security

**[PDF JavaScript security](https://www.nutrient.io/guides/web/features/javascript.md#security-considerations)**\
Understand PDF JavaScript sandboxing and when to disable it

**Call to Action**

Start your free trial for unlimited access and expert support.

[Learn More](https://www.nutrient.io/sdk/web/getting-started/other-frameworks/javascript.md)
---

## Related pages

- [Open PDFs without downloading using JavaScript](/guides/web/document-security/open-without-downloading.md)
- [Add watermarks to PDFs using JavaScript](/guides/web/document-security/add-a-watermark.md)
- [Disable download and print options in our JavaScript PDF viewer](/guides/web/document-security/prevent-print-or-download.md)
- [Password protect PDFs using JavaScript](/guides/web/document-security/password-protect-pdf.md)
- [Document security with Nutrient Web SDK](/guides/web/document-security/with-server-backed.md)

