---
title: "1.27 release notes"
canonical_url: "https://www.nutrient.io/guides/web/release-notes/1-27/"
md_url: "https://www.nutrient.io/guides/web/release-notes/1-27.md"
last_updated: "2026-12-02T00:00:00.000Z"
description: "Nutrient Web SDK 1.27 loads another document into a mounted viewer, reports missing annotation dates as null, and adds options that protect unsaved changes."
---

Nutrient Web SDK 1.27 adds the `instance.load()` method, which loads another document into a viewer that’s already mounted. The instance, its event listeners, and its user interface (UI) customization stay in place.

This release also includes these changes:

- The `createdAt` property is `null` when a document stores no creation date, and `updatedAt` falls back to the creation date.

- Two new options protect unsaved changes when the viewer unloads or the user leaves the page.

- Each `NutrientViewer.load()` call applies its own `dynamicFonts` and `fontSubstitutions` values.

- AI Assistant waits 90 seconds for response data instead of 30.

- The `instance.getDefaultEmbeddedFile()` method returns the file that a PDF Portfolio opens by default.

For a complete list of changes and fixes, refer to the [changelog](https://www.nutrient.io/guides/web/changelog.md#1.27.0).

### Switching documents in a mounted viewer

Before 1.27, showing another document required `NutrientViewer.unload()` followed by `NutrientViewer.load()`. This created a new instance, so an application had to register its event listeners and apply its UI customization again.

In standalone mode, the `instance.load()` method loads another document into the same viewer:

```js
const instance = await NutrientViewer.load({
  container: "#viewer",
  document: "/first.pdf",
});

// Load another document into the same viewer.
await instance.load({ document: "/second.pdf" });
```

The promise resolves to the same instance. The viewer retains its event listeners, toolbar items, annotation presets, theme, locale, custom UIs, and custom renderers. It also reuses the WebAssembly engine.

The page, zoom, rotation, and scroll position reset for the new document. The SDK also resets the interaction mode and clears the selection, the search, and the undo history.

The method accepts the following keys and rejects any other key with an error:

- `document` — The document to load, as a URL or an `ArrayBuffer`.

- `password` — The password of a protected document. Without it, the SDK calls the `onPasswordRequired` callback once. The method never shows the password prompt.

- `initialViewState` — The page, zoom, rotation, layout, or scroll mode that the new document opens with. Derive the value from the current view state — for example, with `instance.viewState.set("currentPageIndex", 2)`. The method rejects a view state that changes a viewer setting, such as `readOnly` or `sidebarMode`. A new `ViewState` instance carries the defaults for those settings, so the method usually rejects it.

The rejected keys include `instantJSON` and `XFDF`, because the method doesn’t import annotations during a load.

The following also applies:

- With `AutoSaveMode.IMMEDIATE` or `AutoSaveMode.INTELLIGENT`, the SDK saves pending changes before the switch. With `AutoSaveMode.DISABLED`, it discards them, so call `instance.save()` first.

- A save doesn’t carry changes over to the new document. To retain the changes, export them after the save — for example, with `instance.exportPDF()` or `instance.exportInstantJSON()`.

- The SDK discards unsaved Content Editor changes in every autosave mode. Save them in the Content Editor before the call.

- Calls run one at a time. When several calls wait, only the most recent call runs. A superseded call rejects with an error that `NutrientViewer.isDocumentLoadSupersededError()` recognizes.

- When a load fails, the previous document usually stays open. The `NutrientViewer.isPreviousDocumentClosedError()` function recognizes errors from loads that closed the previous document.

- The `document.willSwap` event fires when the new document has opened, and the `document.swap` event fires when it’s ready.

A superseded call is part of normal use — for example, when a user switches documents quickly. Every `instance.load()` call therefore needs a rejection handler, or the browser reports unhandled promise rejections:

```js
async function switchDocument(nextDocument) {
  try {
    await instance.load({ document: nextDocument });
  } catch (error) {
    // A newer call replaced this one before it started.
    if (NutrientViewer.isDocumentLoadSupersededError(error)) return;
    throw error;
  }
}
```

The method isn’t available in server-backed mode or with DWS Viewer API. In those cases, unload the viewer and load it again.

For more information, refer to the [switch documents](https://www.nutrient.io/guides/web/open-a-document/switch-documents.md) guide and the [`instance.load()`](https://www.nutrient.io/api/web/classes/NutrientViewer.Instance.html#load) API reference.

### Missing annotation and comment dates

A PDF doesn’t have to store a creation or modification date for an annotation or comment. When a date was missing, the `createdAt` and `updatedAt` properties used to return the time the document was opened.

The `createdAt` property is now `null` when the document stores no creation date. The `updatedAt` property returns the creation date when the document stores no modification date. It’s `null` when the document stores neither date. Both properties have the type `Date | null`.

Code that reads these properties must handle `null`:

```js
// Before 1.27. This line now throws when the date is missing.
// const created = annotation.createdAt.toISOString();

// 1.27 and later.
const created = annotation.createdAt?.toISOString() ?? null;
```

TypeScript reports a missing check only when strict null checks are enabled.

The following also changes:

- The annotations sidebar, comment threads, and the Form Creator show no date when an annotation or comment has none.

- The `toSerializableObject()` function omits a missing date. On a serialized comment, `createdAt` and `updatedAt` are optional, as they’re already on a serialized annotation.

- The SDK doesn’t call the `dateTimeString` callback for a missing date.

- The `instance.update()` method retains an existing creation date when it receives `createdAt: null`.

In standalone mode, the following also applies:

- The `instance.exportInstantJSON()` method omits `createdAt` for an annotation without a creation date. Before 1.27, it set `createdAt` to the time of the export.

- Annotations imported from Instant JSON or XML Forms Data Format (XFDF) have only the dates that the data contains.

- The `instance.create()` method still sets the current time on an annotation without dates.

With Document Engine, annotations that a PDF stores without dates retain the date that Document Engine assigned to them.

For more information, refer to the [`createdAt`](https://www.nutrient.io/api/web/classes/NutrientViewer.Annotations.Annotation.html#createdat) and [`updatedAt`](https://www.nutrient.io/api/web/classes/NutrientViewer.Annotations.Annotation.html#updatedat) API references.

### Protecting unsaved changes

Two new configuration options protect unsaved changes. Both are disabled by default:

- `onBeforeUnload` — A synchronous callback that the SDK calls before `NutrientViewer.unload()` removes the viewer. Returning `false` stops the unload, and `NutrientViewer.unload()` returns `false`.

- `warnOnUnsavedChanges` — When this option is `true`, the browser shows its own warning before the user leaves the page. The warning appears only while `instance.hasUnsavedChanges()` returns `true`.

The following example enables both options:

```js
NutrientViewer.load({
  // Don't unload the viewer while it has unsaved changes.
  onBeforeUnload: (instance) => !instance.hasUnsavedChanges(),
  warnOnUnsavedChanges: true,
});
```

The following limits apply:

- The callback doesn’t support promises. If it returns a promise, `NutrientViewer.unload()` throws an error.

- The callback doesn’t run when a framework or other code removes the viewer’s container from the page.

- Browsers control the text of the warning and usually show it only after the user interacts with the page. The warning may not appear on mobile browsers.

- The browser can’t wait for a save to finish.

- In standalone mode, having no unsaved changes doesn’t mean that the PDF was exported or uploaded.

For more information, refer to the [detect unsaved changes](https://www.nutrient.io/guides/web/save-a-document/detect-unsaved-changes.md) guide.

### Font options for each load

In earlier versions, a load could ignore its `dynamicFonts` and `fontSubstitutions` options when `NutrientViewer.preloadWorker()` or an earlier `NutrientViewer.load()` on the page ran with different values. Text in non-embedded fonts then stayed blank.

Each `NutrientViewer.load()` call now applies its own `dynamicFonts` and `fontSubstitutions` values. A call without these options no longer applies the values from `NutrientViewer.preloadWorker()` or an earlier load. Fonts that an earlier call downloaded stay available until the page reloads.

If your application relied on the earlier values, pass the options to each call:

```js
const configuration = {
  container: "#viewer",
  document: "/document.pdf",
  dynamicFonts: "https://example.com/assets/fonts.json",
};

// Pass the font options to the preload and to each load.
await NutrientViewer.preloadWorker(configuration);
await NutrientViewer.load(configuration);
```

For more information, refer to the [font substitution](https://www.nutrient.io/guides/web/viewer/fonts/substitution.md) guide.

### AI Assistant response timeout

AI Assistant used to stop with an error when it received no response data for 30 seconds. On large documents, this happened while the service was still working on the response.

The default timeout is now 90 seconds. To change it, set `streamInactivityTimeout` in the `aiAssistant` configuration to a value in milliseconds:

```js
NutrientViewer.load({
  aiAssistant: {
    sessionId: "session123",
    jwt: "your-jwt-token",
    backendUrl: "http://localhost:4000",
    // Wait up to three minutes for response data.
    streamInactivityTimeout: 180000,
  },
});
```

The value must be greater than `30000` and at most `2147483647`. Increase it when a proxy between the browser and the AI Assistant service delays or buffers the response.

For more information, refer to the [AI Assistant integration](https://www.nutrient.io/guides/ai-assistant/viewer-integration/nutrient-web-sdk.md) guide.

### Default file of a PDF Portfolio

A PDF Portfolio stores its documents as embedded files and can name one of them as the file to open first. PDF viewers such as Adobe Acrobat show that file instead of the portfolio’s cover page.

The `instance.getDefaultEmbeddedFile()` method returns this file, or `null` when the document doesn’t name a default file:

```js
const defaultFile = await instance.getDefaultEmbeddedFile();

if (defaultFile) {
  const fileContent = await instance.getAttachment(defaultFile.attachmentId);
}
```

In server-backed mode, the method requires Document Engine 1.21.0 or later, which isn’t released yet. With an older version, it always resolves to `null`.

This release supports Document Engine 1.5.6 or later. Specific features in server-backed mode require newer versions:

- **Document Engine 1.15.0 or later** — Form fields without the fillable highlight when the viewer is read-only.

- **Document Engine 1.16.0 or later** — `SearchType.WORD_BASED`, PDF exports without password protection, and removing annotation notes after an XFDF roundtrip.

- **Document Engine 1.18.0 or later** — Document-defined annotation tab order, `Annotation.createdBy`, `overprintPreview`, and `blackRendering`.

- **Document Engine 1.20.0 or later** — Viewing and toggling PDF layers. This version also fixes text selection highlights that skip spaces between words in certain PDFs after optical character recognition (OCR).

- **Document Engine 1.21.0 or later** — `instance.getDefaultEmbeddedFile()` and document order for annotations from an uploaded PDF when `forceRenderWidgetsInAnnotationsOrder` is `true`. This version isn’t released yet.

In server-backed mode, Document Engine runs the PDF engine, so the engine fixes in this release also require Document Engine 1.21.0. One of them fixes text selection gaps in scanned PDFs whose OCR text layer draws each space as a separate text object. The others cover Symbol font characters, redaction, and saved PDFs. The faster first-page load requires this version too.

Document Engine ignores compound measurements, which work only in standalone mode.

For version requirements, refer to the [Web SDK and Document Engine compatibility requirements](https://www.nutrient.io/guides/document-engine/viewer/client-integration/web.md#version-compatibility) guide.

For the previous release, refer to the [Web SDK 1.26 release notes](https://www.nutrient.io/guides/web/release-notes/1-26.md).
---

## Related pages

- [1 0](/guides/web/release-notes/1-0.md)
- [1 1](/guides/web/release-notes/1-1.md)
- [1 10](/guides/web/release-notes/1-10.md)
- [1 11](/guides/web/release-notes/1-11.md)
- [1 12](/guides/web/release-notes/1-12.md)
- [1 13 1](/guides/web/release-notes/1-13-1.md)
- [1 13](/guides/web/release-notes/1-13.md)
- [1 14](/guides/web/release-notes/1-14.md)
- [1 15](/guides/web/release-notes/1-15.md)
- [1 16](/guides/web/release-notes/1-16.md)
- [1 17](/guides/web/release-notes/1-17.md)
- [1 18](/guides/web/release-notes/1-18.md)
- [1 19](/guides/web/release-notes/1-19.md)
- [1 2](/guides/web/release-notes/1-2.md)
- [1 20](/guides/web/release-notes/1-20.md)
- [1 21](/guides/web/release-notes/1-21.md)
- [1 22](/guides/web/release-notes/1-22.md)
- [1 23](/guides/web/release-notes/1-23.md)
- [1 24](/guides/web/release-notes/1-24.md)
- [1 25](/guides/web/release-notes/1-25.md)
- [1 26](/guides/web/release-notes/1-26.md)
- [1 3](/guides/web/release-notes/1-3.md)
- [1 4](/guides/web/release-notes/1-4.md)
- [1 5](/guides/web/release-notes/1-5.md)
- [1 6](/guides/web/release-notes/1-6.md)
- [1 7](/guides/web/release-notes/1-7.md)
- [1 8](/guides/web/release-notes/1-8.md)
- [1 9](/guides/web/release-notes/1-9.md)
- [2017 3](/guides/web/release-notes/2017-3.md)
- [2017 6](/guides/web/release-notes/2017-6.md)
- [Update your PSPDFKit for Web to version 2017.7](/guides/web/release-notes/2017-7.md)
- [Upgrade annotations in PSPDFKit Web 2017.8](/guides/web/release-notes/2017-8.md)
- [Explore new features in PSPDFKit for Web 2017.9](/guides/web/release-notes/2017-9.md)
- [New features in the 2018.1 migration guide](/guides/web/release-notes/2018-1.md)
- [PSPDFKit for Web 2018.2 migration insights](/guides/web/release-notes/2018-2.md)
- [Discover the new features in PSPDFKit for Web 2018.3](/guides/web/release-notes/2018-3.md)
- [Explore PSPDFKit for Web 2018.4 features](/guides/web/release-notes/2018-4.md)
- [Explore new features in PSPDFKit 2018.5](/guides/web/release-notes/2018-5.md)
- [Explore PSPDFKit for Web 2018.6 enhancements](/guides/web/release-notes/2018-6.md)
- [Explore the new features in PSPDFKit 2018.7](/guides/web/release-notes/2018-7.md)
- [Key updates in PSPDFKit for Web 2019.1](/guides/web/release-notes/2019-1.md)
- [2019 2](/guides/web/release-notes/2019-2.md)
- [PSPDFKit for Web 2019.3 migration highlights](/guides/web/release-notes/2019-3.md)
- [Essential updates in PSPDFKit for Web 2019.4](/guides/web/release-notes/2019-4.md)
- [PSPDFKit for Web 2019.5 migration insights](/guides/web/release-notes/2019-5.md)
- [Key changes in PSPDFKit for Web 2020.1](/guides/web/release-notes/2020-1.md)
- [Seamless migration to PSPDFKit for Web 2020.2](/guides/web/release-notes/2020-2.md)
- [Upgrade to PSPDFKit Web 2020.3 seamlessly](/guides/web/release-notes/2020-3.md)
- [PSPDFKit Web and Server 2020.4 migration update](/guides/web/release-notes/2020-4.md)
- [Unified CRUD API enhancements for easy migration](/guides/web/release-notes/2020-5.md)
- [PSPDFKit Web 2020.6 migration insights](/guides/web/release-notes/2020-6.md)
- [Upgrade to PSPDFKit for Web 2021.1 with ease](/guides/web/release-notes/2021-1.md)
- [Seamlessly migrate to PSPDFKit for Web 2021.2](/guides/web/release-notes/2021-2.md)
- [2021 3](/guides/web/release-notes/2021-3.md)
- [PSPDFKit 2021.4 migration guide for seamless updates](/guides/web/release-notes/2021-4.md)
- [Migration guide for PSPDFKit 2021.5](/guides/web/release-notes/2021-5.md)
- [2021 6](/guides/web/release-notes/2021-6.md)
- [PSPDFKit 2022.1.1 migration changes](/guides/web/release-notes/2022-1.md)
- [Enhancements in PSPDFKit for Web 2022.2](/guides/web/release-notes/2022-2.md)
- [Explore the new features of PSPDFKit for Web 2022.3](/guides/web/release-notes/2022-3.md)
- [PSPDFKit for Web 2022.4 migration overview](/guides/web/release-notes/2022-4.md)
- [Key improvements in PSPDFKit for Web 2022.5](/guides/web/release-notes/2022-5.md)
- [Discover the key updates in PSPDFKit for Web 2023.1](/guides/web/release-notes/2023-1.md)
- [PSPDFKit 2023.2 migration and updates](/guides/web/release-notes/2023-2.md)
- [Key updates in PSPDFKit for Web 2023.3](/guides/web/release-notes/2023-3.md)
- [Explore key updates in PSPDFKit for Web 2023.4](/guides/web/release-notes/2023-4.md)
- [Key updates in PSPDFKit for Web 2023.5](/guides/web/release-notes/2023-5.md)
- [Essential Nutrient Web SDK 2024.1 migration tips](/guides/web/release-notes/2024-1.md)
- [2024 2](/guides/web/release-notes/2024-2.md)
- [2024 3](/guides/web/release-notes/2024-3.md)
- [2024 4](/guides/web/release-notes/2024-4.md)
- [2024 5](/guides/web/release-notes/2024-5.md)
- [2024 7](/guides/web/release-notes/2024-7.md)
- [2024 8](/guides/web/release-notes/2024-8.md)
- [Upgrading Nutrient Web SDK](/guides/web/release-notes/upgrading.md)
- [Nutrient Web SDK versioning policy](/guides/web/release-notes/versioning-policy.md)

