DS Server

Javascript: TXTextControl.HeaderFooterType Enumeration

Enumeration

Description

Determines the type of a header or footer.

Members

MemberDescription
HeaderThe object is a header. When an even header exists, the object represents the odd header. Otherwise it represents the header of all pages.
FirstPageHeaderThe object represents a special header of the document's or section's first page.
FirstPageFooterThe object represents a special footer of the document's or section's first page.
EvenHeaderThe object represents an even header.
EvenFooterThe object represents an even footer.
AllThe object represents an footer or header.

Examples

The following example uses TXTextControl.HeaderFooterType.Header (the object is a header. When an even header exists, the object represents the odd header. Otherwise it represents the header of all pages.) in a document-editing workflow.

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
);