TX Text Control .NET Server

Javascript: HeaderFooterCollection.remove Method

Method|Introduced in 28.0

Description

Removes a header or footer from the document or from a certain section.

Syntax

<void> HeaderFooterCollection.remove(<HeaderFooterType> headerFooterType, [<RequestBooleanCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
headerFooterType

Specifies the headers and/or footers to remove.

callback

Optional. Receives true, if the header or footer could be removed. Otherwise it is false.

errorCallback

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

Examples

The following example demonstrates HeaderFooterCollection.remove in a practical document-editing workflow. It removes a header or footer from the document or from a certain section.

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

TXTextControl.headersAndFooters.remove(
    TXTextControl.HeaderFooterType.Header,
    function(result) {
        if (result) {
            console.log("remove is available.");
        } else {
            console.warn("remove is not available in the current document state.");
        }
    },
    onTxError
);