DS Server

DocumentSaveResult Class

Class

Description

Result returned by DocumentViewerElement.saveDocument() or DocumentViewerController.saveDocument() for reading the saved document as Base64 or binary data.

Syntax

DocumentSaveResult

Examples

The following example demonstrates DocumentSaveResult in a practical Document Viewer workflow. This object provides functionalities for receiving a document's data.

async function inspectDocumentSaveResult(saveResult) {
    const base64 = await saveResult.base64();
    const bytes = await saveResult.arrayBuffer();
    console.log({ base64Length: base64.length, byteLength: bytes.byteLength });
}

Members

Methods

MethodDescription
arrayBufferGets the saved document as binary data.
base64Gets the saved document as a Base64 string.