DS Server

Javascript: DocumentSettings.setDocumentBasePath Method

Method|Introduced in 29.0

Description

Sets a file path that is used to search for resources like images or hypertext links.

Syntax

<void> DocumentSettings.setDocumentBasePath(<string> value, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
value

The property value.

callback

Optional. Is called when the operation completed.

errorCallback

Optional. Is called when the operation failed with an error.

Examples

The following example demonstrates DocumentSettings.setDocumentBasePath in a practical document-editing workflow. It sets a file path that is used to search for resources like images or hypertext links.

function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

TXTextControl.documentSettings.setDocumentBasePath(
    "https://www.example.com/documents/",
    function() {
        console.log("set document base path completed.");
    },
    onTxError
);