DS Server

HeaderFooterCollection Object

Object|Introduced in 28.0

Description

Contains all headers and footers in a document or part of the document.

Syntax

HeaderFooterCollection

Examples

The following example demonstrates HeaderFooterCollection in a practical document-editing workflow. It contains all headers and footers in a document or part of the document.

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

TXTextControl.headersAndFooters.getItem(
    TXTextControl.HeaderFooterType.Header,
    function(headerFooter) {
        if (!headerFooter) {
            console.warn("No header footer was returned.");
            return;
        }
        
        console.log("get item result:", headerFooter);
    },
    onTxError
);

Members

Methods

MethodDescription
addAdds a new header or footer to a document or to a certain section of the document. If a header or footer is added to the complete document the first section receives the header or footer and all other sections receive headers or footers which are connected to their previous section. To add more than one header or footer a combination of the HeaderFooterType enumeration values can be used.
elementAtReturns the element at a specified index in the collection. (Inherited from Collection.)
forEachExecutes a callback function for each element. (Inherited from Collection.)
getCountGets the number of elements contained in the collection. (Inherited from Collection.)
getItemGets a particular header or footer from the collection.
removeRemoves a header or footer from the document or from a certain section.