1.25 release notes
RSSNutrient Web SDK 1.25 fixes three security vulnerabilities and a leak of redacted form field values. This release introduces breaking changes to collections and models.
The SDK replaces Immutable.js with its own List, Map, Set, OrderedMap, and OrderedSet classes. It removes most collection methods deprecated in 1.22 and 1.23. Assigning a model field now throws a TypeError, and models deprecate equals() in favor of isEqual().
This release also includes these changes:
- View and toggle PDF layers in server-backed mode with Document Engine 1.20.0 or later.
- The comment link dialog adds an
https://prefix to links without a protocol. - Overlapping form field changes in standalone mode restore performance and resolve together in one batch.
- The WebAssembly PDF engine is about 10 percent smaller.
For complete details, refer to the changelog.
Security fixes
The security fixes don’t require code changes. Before upgrading, review the breaking changes in the following sections.
- CVE-2026-111497 — A crafted PDF using Brotli compression could trigger an out-of-bounds write in the bundled Brotli decoder. It could also stop PDF processing from completing. The SDK updates the decoder from version 1.1.0 to 1.1.1. Document Engine also decodes PDFs in server-backed mode. Update Document Engine to 1.19.1 or later.
- CVE-2026-111768 — An oversized AI Assistant tool request could exhaust the browser tab’s memory. Web SDK updates
@modelcontextprotocol/sdkfrom 1.27.1 to 1.32.1 and rejects oversized tool requests. This release doesn’t change the AI Assistant server, which has separate releases. This vulnerability doesn’t affect applications without AI Assistant. - CVE-2026-111758 — Crafted Markdown in an AI Assistant chat message could cause long rendering times. The SDK updates
markdown-itfrom version 14.2.0 to 14.3.3. This vulnerability doesn’t affect applications without AI Assistant. - Redacted form field values — Redacting a nested form field could leave its value in the PDF’s form data. Tools that read form fields could recover the value. Redaction now removes the value, its default, and its appearance. Documents redacted with earlier versions can still contain these values.
Loading Web SDK from Document Engine with <script src="https://<document_engine_url>/nutrient-viewer.js"> uses the Web SDK version that shipped with that Document Engine release. That version doesn’t include these fixes. For example, Document Engine 1.20.0 serves Web SDK 1.24.
Load Web SDK 1.25 from the content delivery network (CDN) or npm instead. Set serverUrl in NutrientViewer.load(). The SDK can’t infer the Document Engine URL from a script that you load from another source.
Before you upgrade
Check the following code and configuration before upgrading. The following sections explain each change:
- Find calls to removed collection and model methods, such as
keySeq()ortoSeq(). Plain JavaScript provides no runtime deprecation warning. - Find assignments to model fields, such as
annotation.opacity = 0.5. These assignments now throw. - Check where you pass SDK collections and models to your own copy of Immutable.js.
- Find model comparisons using helpers such as React Redux’s
shallowEqual. These comparisons can treat different models as equal without reporting an error. - Find TypeScript code that reads form field or annotation properties without narrowing the type first.
- Review error handling for overlapping
instance.create(),instance.update(), orinstance.delete()calls in standalone mode. - Use Document Engine 1.19.1 or later for the Brotli fix in server-backed mode.
- Use Document Engine 1.20.0 or later for PDF layers and the optical character recognition (OCR) text selection fix.
Removed collection methods
Web SDK removes most collection methods deprecated in 1.22 and 1.23, along with four model methods. The SDK now uses its own collection classes instead of Immutable.js collections. NutrientViewer.Immutable.List, Map, and Set still exist, so code that creates collections with them continues to work.
Calling a removed method throws a TypeError, such as TypeError: list.keySeq is not a function. TypeScript reports the call as an error. Previous releases documented deprecations only in type declarations, the API reference, and the 1.22 and 1.23 release notes. Plain JavaScript provided no runtime warning.
The following table lists the removed methods:
| Removed from | Methods |
|---|---|
List | keySeq(), valueSeq(), entrySeq(), toSeq(), toKeyedSeq(), toIndexedSeq(), toSetSeq(), toStack(), findKey(), findEntry(), fromEntrySeq(), asMutable(), asImmutable(), wasAltered(), setSize(), zip(), zipAll(), zipWith() |
Map, OrderedMap | keySeq(), valueSeq(), entrySeq(), toSeq(), toKeyedSeq(), toIndexedSeq(), toSetSeq(), toStack(), findKey(), findEntry(), asMutable(), asImmutable(), wasAltered() |
Set, OrderedSet | keySeq(), valueSeq(), entrySeq(), toSeq(), toKeyedSeq(), toIndexedSeq(), toSetSeq(), toStack(), findKey(), findEntry(), asMutable(), asImmutable(), wasAltered() |
OrderedSet only | zip(), zipAll(), zipWith() |
| Models | toSeq(), asMutable(), asImmutable(), wasAltered() |
The SDK also removes methods that its types never declared:
- All five collections remove
chain(),inspect(), andtoSource(). Map,OrderedMap,Set, andOrderedSetremovefromEntrySeq().
For replacements, refer to the 1.22 and 1.23 release notes. The following example shows common replacements:
const map = NutrientViewer.Immutable.Map({ a: 1, b: 2 });
// `keySeq()`, `valueSeq()`, and `entrySeq()` → `keys()`, `values()`, and `entries()`.// The new methods return iterators. To get a `List`, wrap the iterator in `NutrientViewer.Immutable.List()`.const keys = NutrientViewer.Immutable.List(map.keys());
// `toStack()` → `toList()`.const list = map.toList();
// `asMutable()` and `asImmutable()` → `withMutations()`.const updated = map.withMutations((m) => { m.set("a", 2).set("b", 3);});
// `wasAltered()` → compare the result with the original, using `!==` or `equals()`.// `withMutations()` returns the original if the callback changed nothing.const changed = updated !== map;When replacing toStack() with toList(), replace stack methods to preserve operations at the front of the collection:
- Use
unshift()instead ofpush(). - Use
shift()instead ofpop(). - Use
first()instead ofpeek().
The SDK no longer deprecates these methods:
- Collections and models —
hashCode(). SetandOrderedSet—union()andsubtract().Map—Map.of().
Type declarations now include hashCode() for annotations, geometry, and actions.
The 1.22 and 1.23 release notes recommended replacing hashCode() or wasAltered() with equals(). That replacement still works on collections. For models, use isEqual() instead.
For supported collection methods, refer to the NutrientViewer.Immutable.List API reference.
Using SDK values with your own Immutable.js
If your application uses its own copy of Immutable.js, check where you pass SDK collections and models to that copy.
Before 1.25, SDK collections and models were Immutable.js objects. Your copy now accepts SDK collections only where it expects the same kind of collection.
The following behavior applies to Immutable.js versions four and five. Version three throws in fewer cases:
List(),Map(),Set(),OrderedMap(), andOrderedSet()return SDK collections of exactly their own type unchanged.- On empty collections,
concat(),union(),merge(), andmergeDeep()also return the SDK collection unchanged. - The
fromJS()function returns any SDK value unchanged. - Calling a removed method, such as
toSeq(), on an unchanged SDK collection throws. Map()andSet()copy ordered SDK collections, such as the result ofsort().OrderedMap()andOrderedSet()copy unordered SDK collections.- On nonempty collections,
concat(),union(), andmerge()copy SDK collections of the same kind. These copies retain SDK models because the operations copy only the outer collection.
Other operations can throw a TypeError stating that a method such as toSeq isn’t a function. TypeScript doesn’t detect most of these calls.
You can still store SDK values in your collections and read them back. Immutable.is(), equals(), and checks such as Immutable.isList() also continue to work.
The following examples use these names:
Immutablerepresents your copy of Immutable.js.- Names starting with
myrepresent your collections. - The
annotationvariable represents an annotation. - The
annotationsvariable represents theListthatinstance.getAnnotations()returns. - Names starting with
sdkrepresent other SDK collections.
The following calls throw:
// `toJS()` on your collection while it holds a model, such as an annotation or a `Rect`, at any depth.Immutable.List([annotation]).toJS();
// `Map()` or `merge()` with a model.Immutable.Map(annotation);myImmutableMap.merge(annotation);
// `Map()` or `OrderedMap()` with an SDK `List` of [key, value] entries.Immutable.Map(sdkEntries);
// `mergeDeep()` when both sides hold a collection, object, or model under the same key// and one of them is an SDK value, including an SDK collection your map already holds.myImmutableMap.mergeDeep(sdkMap);
// `Seq()` with an SDK collection.Immutable.Seq(sdkMap);
// `concat()` on a list with an SDK set or map.myImmutableList.concat(sdkSet);
// `Set.fromKeys()` with an SDK collection.Immutable.Set.fromKeys(sdkMap);
// `List()`, `Set()`, or `OrderedSet()` with another kind of SDK collection.Immutable.Set(sdkList);Before passing SDK values to your copy of Immutable.js, convert them to plain JavaScript values. toArray() and toObject() convert only one level. For models and collections containing models, use toJS(). Like toObject(), toJS() converts numeric keys to strings:
Immutable.fromJS(annotation.toJS());Immutable.List(annotations.toJS());Immutable.Map(annotations.map((a) => [a.id, a.toJS()]).toArray());Immutable.Map(sdkMap.toArray()); // Unlike `toObject()`, this keeps number keys.myImmutableList.concat(sdkSet.toArray());myImmutableMap.mergeDeep(Immutable.fromJS(sdkMap.toJS()));To pass collections to SDK models, create them with NutrientViewer.Immutable.List instead of your own copy.
For example, using your own List for an ink annotation’s lines creates a list containing SDK DrawingPoint models. Calling toJS() on that annotation then throws a TypeError.
Models are stricter
These changes affect annotations, geometry, actions, form fields, and other models, including Color, Comment, and ViewState.
Assigning a field throws. In 1.24, assignments to annotation, action, form field, FormFieldValue, Point, and Rect fields had no effect. Assignments to Size, Color, Comment, ViewState, and most other models threw a plain Error.
Every model now throws a TypeError that names the field. Before replacing an assignment, check its intended effect. If the application works without that assignment, delete it. To change a field, use set() to create an updated copy:
// 1.24: ignored. 1.25: `TypeError`: Cannot set opacity on an immutable record.// annotation.opacity = 0.5;
// If the change should happen, create an updated copy and apply it.const updated = annotation.set("opacity", 0.5);await instance.update(updated);A constructor always returns a new instance of its own class. In 1.24, a constructor receiving another model could return that model unchanged. For example, new Rect(point) returned the Point, and new Rect(rect) returned the same rect.
Now new Rect(point) returns a new Rect with default values because Rect and Point have no fields in common. This change doesn’t throw an error. Search for code that passes a model to another model’s constructor.
To place a Rect at a point, pass the coordinates:
const point = new NutrientViewer.Geometry.Point({ x: 5, y: 7 });const rect = new NutrientViewer.Geometry.Rect({ left: point.x, top: point.y });Models deprecate equals() in favor of isEqual(). equals() compares field names and values but ignores the model class. It treats models from different classes as equal when their fields and values match. isEqual() also checks that both models have the same class.
equals() still works. Only the type declarations and API reference mark it as deprecated, as with the collection methods.
The following example compares annotations from different classes:
const { UnderlineAnnotation, SquiggleAnnotation } = NutrientViewer.Annotations;const props = { pageIndex: 0, color: NutrientViewer.Color.BLACK };
new UnderlineAnnotation(props).equals(new SquiggleAnnotation(props)); // truenew UnderlineAnnotation(props).isEqual(new SquiggleAnnotation(props)); // falseSDK collection lookups, such as has() on a Set, still compare values without checking the class. Your copy of Immutable.js does the same with Immutable.is().
When storing different annotation types in one Set or as Map keys, use their id values as keys instead.
equals() on Color isn’t deprecated. Unlike isEqual(), it still accepts a plain { r, g, b, transparent } object.
Object.keys() returns an empty array for a model. Helpers such as React Redux’s shallowEqual compare objects key by key. These helpers now treat any two models as equal.
A useSelector() call returning an annotation with shallowEqual no longer rerenders the component when that annotation changes. Compare models by reference or with isEqual() instead.
The TypeScript declarations are stricter. Code that compiled against 1.24 can fail against 1.25:
- Annotation, action, form field, and other model fields are read-only. Geometry fields have been read-only since 1.20.
- Methods such as
get(),set(),update(), andmerge()accept only keys that the model defines. Annotation constructors reject unknown properties. - On an
AnnotationsUnion, these methods accept only fields common to every annotation type. This includes annotations thatinstance.getAnnotations()returns. Before reading or changing another field, such asstrokeColor, narrow the type. For example, useannotation instanceof NutrientViewer.Annotations.InkAnnotation. - TypeScript rejects access to properties that
FormFielddoesn’t declare, such asvalueoroptions. For fields frominstance.getFormFields(), narrow the type before reading these properties. For example, checkfield instanceof NutrientViewer.FormFields.ChoiceFormFieldbefore readingoptions. - Type declarations now mark
FormFieldas abstract. Constructing it has always thrown at runtime. Create a concrete type, such asNutrientViewer.FormFields.TextFormField.
FormFieldValue now retains optionIndexes when set(), merge(), or another method returns an updated copy. The set("optionIndexes", …) call now works. has(), toObject(), toJS(), equals(), and hashCode() also include optionIndexes.
For more information, refer to the geometry primitives and view state guides.
Comment links and pasted mentions
The comment editor’s link dialog now adds https:// when saving links without a protocol, such as www.example.com. Links typed directly into a comment already included this prefix. Comment text from instance.getComments() now contains href="https://www.example.com" instead of href="www.example.com".
The dialog preserves relative links starting with / or . and links with another protocol, such as mailto:. Comments saved before 1.25 retain their stored links, which still work. If your code parses or compares stored comment HTML, account for the prefix on new links.
When a user pastes text containing a mention, the SDK checks the mention against your list of mentionable users. This includes mentions copied from another comment. Set the list with the mentionableUsers configuration option or instance.setMentionableUsers().
If the list includes the mentioned user, the mention shows their display name. Otherwise, the SDK converts the mention to plain @Name text. The comment’s getMentionedUserIds() then excludes that user.
For more information, refer to the comments guide.
Overlapping form field changes share one batch
Since 1.18, separate instance.create(), instance.update(), or instance.delete() calls for many form fields caused slow updates in standalone mode.
The SDK now applies overlapping calls in one batch. Each call resolves only after every call in the batch finishes. If the batch fails, every call rejects with the same error, including calls whose changes succeeded.
PDF layers in server-backed mode
With Document Engine 1.20.0 or later, the layers sidebar, getLayersVisibilityState(), and setLayersVisibilityState() now work in server-backed mode. PDF layers are also called optional content groups (OCGs).
In 1.24, Web SDK hid the layers button in server-backed mode. Both methods rejected with an error such as “instance.getLayersVisibilityState() is only available in Standalone mode.”
The layers button (sidebar-layers) belongs to the default toolbar. It now appears for documents with layers without additional configuration. To hide the button, remove it from the toolbar:
instance.setToolbarItems((items) => items.filter((item) => item.type !== "sidebar-layers"));A document opens with the layer visibility saved in the PDF. When a user shows or hides a layer, Document Engine renders the pages again. In both modes, pages and thumbnails retain their content while a layer change renders instead of going blank.
Some PDFs, including some CAD drawings, contain layers that don’t appear in the document’s layer list. The sidebar excludes these layers, which retain the visibility defined in the PDF.
A user’s visibility choices affect only their viewer. The viewer doesn’t save those choices to the document or share them with other users.
Reloading the document restores the PDF’s default visibility. This includes reloads after redaction, signing, saving in the Content Editor, or applying document operations.
The following example hides every layer in the document’s layer list and then restores the original visibility:
// Remember which layers are visible when the document opens.const initialState = await instance.getLayersVisibilityState();console.log(initialState.visibleLayerIds); // The IDs of the visible layers, in no guaranteed order.
// Hide every layer in the document’s layer list.await instance.setLayersVisibilityState({ visibleLayerIds: [] });
// Show the original layers again.await instance.setLayersVisibilityState(initialState);Server-backed mode differs from standalone mode in the following ways:
- The
setLayersVisibilityState()method rejects layer IDs that aren’t in the document’s layer list. Layer IDs can change when Document Engine replaces the document. Read the IDs again instead of reusing stored IDs. - Printing, exporting, and downloading use the layer visibility saved in the PDF, not the user’s choice.
- Users can still select text in hidden layers.
- Only standalone mode supports creating layers with
createLayer().
This feature requires Web SDK 1.25 and Document Engine 1.20.0 or later. With an older Document Engine, Web SDK hides the layers button. A layers sidebar opened through ViewState continues to show a loading indicator. Both methods reject with “OCG layers require Document Engine version 1.20.0 or later.”
If you load Web SDK from Document Engine, switch to the CDN or npm. Refer to the security fixes section.
When loading a document, the viewer sends GET requests to the document’s ocg-layers and ocg-layers-state endpoints. These endpoints use the same /i/d/ path as other viewer requests for that document.
If your proxy restricts access by path, enable requests to both endpoints. If the proxy blocks these requests, the document still opens. However, Web SDK hides the layers button, and the browser console reports an error.
For more information, refer to the layer visibility and layers sidebar guides.
This release supports Document Engine 1.5.6 or later. Specific features in server-backed mode require newer versions:
- 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, andblackRendering. - 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 OCR.
Document Engine ignores compound measurements, which work only in standalone mode.
For version requirements, refer to the Web SDK and Document Engine compatibility requirements guide.
For a complete list of changes and fixes, refer to the changelog. For the previous release, refer to the Web SDK 1.24 release notes.