This guide outlines the changes you should review before upgrading from an earlier version to WebViewer 12.0. Use it to identify breaking changes, removed APIs, migration requirements, and any updates needed to ensure a smooth transition.
WebViewer 12.0 modernizes its JavaScript architecture by replacing Webpack with Vite as the build tool and targeting native ES6 (es2022). As part of this transition, several framework-provided base types are now implemented as true ES6 classes, including:
Custom tools and annotations that extend these types must be updated to use standard ES6 class inheritance patterns.
Legacy ES5 inheritance patterns are no longer supported. For example, constructor calls such as:
Will throw the following error:
When migrating custom tools and annotations:
class syntax.Parent.call(this, ...) with super(...).Parent.prototype.method.call(this, ...) with super.method(...).The following example shows how to migrate a custom tool from the legacy ES5 inheritance pattern to standard ES6 class syntax.
We recommend migrating custom tools and annotations to ES6 classes. If build constraints or legacy code requirements prevent this, Reflect.construct can be used as a temporary compatibility bridge in place of .call(this).
The Legacy UI is no longer included with WebViewer 12.0. Moving forward, WebViewer uses the Modular UI as the default supported user interface and customization framework. This consolidation provides a single customization path, reduces package size, and simplifies ongoing maintenance and upgrades.
If you're upgrading from WebViewer 11.0 or earlier, review the following migration guidance and update any Legacy UI implementations to their Module UI equivalents. Key changes include:
ui: 'legacy'.setHeaderItems, have been removed.For more details, see Migrating to V11 Modular UI. For API changes, see WebViewer API changes.
In WebViewer 12.0, event listeners registered with instance.UI.addEventListener() no longer receive a CustomEvent object. Event payloads are now passed directly to the callback as positional arguments.
If your event handlers access values using event.detail, update them to accept the event payload directly as callback arguments.
Argument patterns by event
The following events provide multiple positional arguments:
The following events provide a single object or array argument:
The following events don't provide a payload:
Refer to UI.Events for the complete payload definition for each event.
UI events dispatched on window continue to use CustomEvent for backward compatibility. However, the structure of event.detail has changed to match the new event listener payload format.
Review any code that reads values from event.detail and update it to use the new payload structure for affected events.
Updated event.detail formats
The following events now expose payload values as arrays instead of objects:
The following events now return a single value instead of an object:
The following events now return a single-element array:
The payload format for the following events has not changed:
WebViewer has strengthened the security boundaries of the embedded JavaScript runtime for PDF documents. Embedded JavaScript is no longer executed through eval and now runs in a more restricted execution environment.
Embedded JavaScript that relies on any of the following may no longer work as expected:
Review and test any embedded JavaScript used in your PDF documents to ensure compatibility with the updated runtime.
Replacement APIs may be located in a different namespace or class than the removed API. Review the replacement column carefully when updating your implementation.
The following WebViewer APIs were deprecated in previous releases and have been removed in v12.0.
Core.AccessibleReadingOrderManager
Removed API | Replacement |
|---|---|
getPreProcessingLevel() | — |
setPreProcessingLevel(level) |
Core.Annotations
Removed API | Replacement |
|---|---|
FreeTextAnnotation.disableEnterKeypress() | Core.Annotations.FreeTextAnnotation.RichTextEditor.disableEnterKeypress() |
FreeTextAnnotation.enableEnterKeypress() | Core.Annotations.FreeTextAnnotation.RichTextEditor.enableEnterKeypress() |
FreeTextAnnotation.getEditor() | Core.Annotations.EditBoxManager.getEditor(FreeTextAnnotation) |
Model3DAnnotation | — |
SignatureWidgetAnnotation.isSignedDigitally() | Core.Annotations.SignatureWidgetAnnotation.isSignedByAppearance() |
3D annotations are no longer supported in WebViewer 12.0.
Core.DocumentViewer
Removed API | Replacement |
|---|---|
disableReadOnlyMode() | |
enableReadOnlyMode() |
Core.Tools
Removed API | Replacement |
|---|---|
Tool.disableTextSelection() | |
Tool.enableTextSelection() |
UI
Removed API | Replacement |
|---|---|
createToolbarGroup(toolbarGroup) | Use Modular UI replacement. |
disableHighContrastMode() | — |
enableHighContrastMode() | — |
setHeaderItems(headerCallback) | Use Modular UI replacement. |
High-contrast mode APIs have been removed. WebViewer's default UI now meets WCAG 2.2 AA requirements without additional configuration.
The following DOCX Editor APIs were deprecated in previous versions and have been removed in v12.0.
Core.Document
Removed API | Replacement |
|---|---|
OfficeEditorCursorStyle | |
OfficeEditorParagraphStyle | |
OfficeEditorSelectionStyle |
Core.Document.OfficeEditor
Removed API | Replacement |
|---|---|
acceptTrackedChange(id) | Core.Document.OfficeEditor.TrackedChangeManager.acceptTrackedChange(id) |
getTrackChangeManager() | |
getTrackedChangeOOXMLIds() | Core.Document.OfficeEditor.TrackedChangeManager.getTrackedChangeOOXMLIds() |
getTrackedChanges() | Core.Document.OfficeEditor.TrackedChangeManager.getTrackedChanges() |
moveCursorToTrackedChange(id) | Core.Document.OfficeEditor.TrackedChangeManager.moveCursorToTrackedChange(id) |
rejectTrackedChange(id) | Core.Document.OfficeEditor.TrackedChangeManager.rejectTrackedChange(id) |
TrackedChange | Core.Document.OfficeEditor.TrackedChangeManager.TrackedChange |
Undocumented Office Editor APIs also removed in v12.0:
Core.Document.OfficeEditor.toggleMainCursorStyle()Core.Document.OfficeEditor.freezeMainCursor()Core.Document.OfficeEditor.showMainCursor()Core.Document.OfficeEditor.getContentListType()The following Spreadsheet Editor APIs have changed in v12.0. The SpreadsheetEditorManager.setEditMode() method is no longer asynchronous.
Core.SpreadsheetEditorDocument
Removed API | Replacement |
|---|---|
getWorkbook() | Core.SpreadsheetEditor.SpreadsheetEditorManager.getWorkbook() |
getClipboard() | Core.SpreadsheetEditor.SpreadsheetEditorManager.getSpreadsheetEditorClipboard() |
selectCellRange(cellRange) | Core.SpreadsheetEditor.SpreadsheetEditorManager.selectCellRange() |
Did you find this helpful?
Trial setup questions?
Ask experts on DiscordNeed other help?
Contact SupportPricing or product questions?
Contact Sales