Javascript: HeaderFooterCollection.remove Method
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
| Parameter | Description |
|---|---|
| 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
);