DS Server

Javascript: TXTextControl.AppendSettings Enumeration

Enumeration|Introduced in 31.0

Description

Determines how text is appended to the document.

Members

MemberDescription
NoneThe loaded text is inserted at the end of the last paragraph of the existing document.
StartWithNewParagraphA new paragraph is created at the end of the document and the text is inserted in this paragraph.
StartWithNewSectionA new section is created at the end of the document and the text is inserted in this section.

Examples

The following example uses TXTextControl.AppendSettings.StartWithNewParagraph (a new paragraph is created at the end of the document and the text is inserted in this paragraph.) in a document-editing workflow.

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

TXTextControl.append(
    TXTextControl.StreamType.HTMLFormat,
    "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAFgAH/qbPzWQAAAABJRU5ErkJggg==",
    function(result) {
        if (!result) {
            console.warn("No load document callback data was returned.");
            return;
        }
        
        console.log("append result:", result);
    },
    { loadImages: true, loadHypertextLinks: true },
    TXTextControl.AppendSettings.StartWithNewParagraph,
    onTxError
);