---
title: "Save & download PDF to Document Engine | Nutrient SDK"
canonical_url: "https://www.nutrient.io/guides/web/save-a-document/to-document-engine/"
md_url: "https://www.nutrient.io/guides/web/save-a-document/to-document-engine.md"
last_updated: "2026-05-20T19:49:34.907Z"
description: "Learn how to configure auto-saving in Nutrient Web SDK, using immediate or controlled save modes for efficient document management."
---

# Save PDFs to Document Engine using JavaScript

When using Nutrient Web SDK in server-backed [operational mode](https://www.nutrient.io/guides/web/about/operational-modes.md), saving a document to the Document Engine backend is easy. Depending on the [autoSaveMode](https://www.nutrient.io/api/web/NutrientViewer.html#.AutoSaveMode) set, it can be done automatically with `NutrientViewer.AutoSaveMode#IMMEDIATE` and `NutrientViewer.AutoSaveMode#INTELLIGENT`, or programmatically on demand by setting `NutrientViewer.AutoSaveMode#DISABLED` and calling [`instance.save`](https://www.nutrient.io/api/web/NutrientViewer.Instance.html#save) when required.

The following example shows how to set the [configuration object](https://www.nutrient.io/api/web/NutrientViewer.Configuration.html) so that saving is performed automatically:

```js

NutrientViewer.load({...otherOptions,
  autoSaveMode: NutrientViewer.AutoSaveMode.IMMEDIATE
}).catch((error) => {
  console.error("Failed to load document:", error.message);
});

```

If you want more control over when saving is performed, you can disable auto saving and call `instance.save` when needed:

```js

NutrientViewer.load({...otherOptions,
  autoSaveMode: NutrientViewer.AutoSaveMode.DISABLED
}).then((instance) => {
    instance.addEventListener("annotations.create", (annotations) => {
      console.log("annotations created:", annotations.toJS());
      // Save changes when new annotations are created.
      instance.save();
    });
  }).catch((error) => {
    console.error("Failed to load document:", error.message);
  });

```

When exporting a document, you have several options. Refer to our guides on [flattening annotations](https://www.nutrient.io/guides/web/annotations/flatten.md) and [incremental saving](https://www.nutrient.io/guides/web/features/document-processing.md) for more details.

Auto saving can be configured for different scenarios and use cases. You can find more information in our [auto save](https://www.nutrient.io/guides/web/features/saving.md) guide.
---

## Related pages

- [Detecting unsaved changes in PDFs](/guides/web/save-a-document/detect-unsaved-changes.md)
- [Auto-saving PDF changes in our JavaScript viewer](/guides/web/features/saving.md)
- [Enable incremental saving of PDFs using JavaScript](/guides/web/features/document-processing.md)
- [Save PDF files using JavaScript](/guides/web/save-a-document.md)
- [Save documents as PDFs on the web](/guides/web/save-a-document/save-as.md)
- [Save PDFs to an ArrayBuffer using JavaScript](/guides/web/save-a-document/to-arraybuffer.md)
- [Save PDFs to local storage using JavaScript](/guides/web/save-a-document/to-local-storage.md)
- [Save PDFs to a remote server using JavaScript](/guides/web/save-a-document/to-remote-server.md)
- [Save PDF without annotations using JavaScript](/guides/web/save-a-document/without-annotations.md)

