DS Server

TXDocumentViewer Object

Object

Description

Legacy browser-global entry point for the TX Text Control Document Viewer. The browser exposes this namespace as `window.TXDocumentViewer`. Before initialization it provides the init() method. After initialization it references the same object as the most recently created DocumentViewerController while retaining the `init()` method for compatibility. The controller's public methods, properties, and namespaces are therefore available directly through `window.TXDocumentViewer` after initialization. Modern integrations should use the ES module or the DocumentViewerElement custom element instead.

Syntax

TXDocumentViewer

Examples

The following example demonstrates TXDocumentViewer in a practical Document Viewer workflow. The TXDocumentViewer JavaScript object provides a public API to manipulate the document viewer via JavaScript functions in the browser.

TXDocumentViewer.addEventListener("annotationsChanged", function() {
    console.log("The Document Viewer annotations changed.");
});

Members

Methods

MethodDescription
initInitializes a controller through the legacy browser-global API. The method creates a DocumentViewerController for the supplied container. If `viewerSettings.documentData` is provided, the document is loaded during initialization. The global then references the same controller instance and keeps this method available as `TXDocumentViewer.init()`. The controller's public API can subsequently be accessed directly through `TXDocumentViewer`.