Javascript: TXTextControl.saveDocument Method

Saves the current document in a certain format and sends the result back asynchronously by calling a given callback function.

Introduced: 23.0.

Syntax

[JavaScript]
<void> TXTextControl.saveDocument(<StreamType> streamType, <function> callback);
Parameter Description
streamType

Specifies one of the numerical StreamType values.

callback

A function with one parameter. Is called with an argument object of type SaveDocumentResult containing the document data after the document has been saved successfully.

Example

The following example shows how to save the current document and display the received document data in the console.

[JavaScript]
TXTextControl.saveDocument(TXTextControl.StreamType.HTMLFormat, function (e) {
    console.log(e.data);
});

Possible console output:

<?xml version="1.0" ?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
[...]

See Also