Footnote Object
Description
A Footnote object represents a footnote in a TextControl document. A footnote can be inserted trough the FootnoteCollection.add method. It consists of a reference mark in the document and the footnote itself appearing at the bottom of the page. The footnote has a footnote mark with the same number as the reference mark. All Footnote objects are contained in the FootnoteCollection, which can be obtained with the TXTextControl.footnotes property.
Syntax
FootnoteExamples
The following example demonstrates Footnote in a practical document-editing workflow. A Footnote object represents a footnote in a TextControl document. A footnote can be inserted trough the FootnoteCollection.add method. It consists of a reference mark in the document and the footnote itself appearing at the bottom of the page. The footnote has a footnote mark with the same number as the reference mark. All Footnote objects are contained in the FootnoteCollection, which can be obtained with the TXTextControl.footnotes property.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.footnotes.elementAt(0, function(footnote) {
if (!footnote) {
console.warn("No footnote is available.");
return;
}
footnote.getID(
function(result) {
console.log("get id result:", result);
},
onTxError
);
}, onTxError);Members
Methods
| Method | Description |
|---|---|
| edit | Sets the current text input position in the footnote section at the end of the current footnote text, so that the text can be edited or formatted. |
| getHighlightColor | Gets the highlight color for the reference mark and the footnote mark. |
| getHighlightMode | Gets a value indicating whether the reference mark and the footnote mark is highlighted. |
| getID | Gets a user-defined identifier. It must be a one-based value. A value of zero indicates that the footnote has no identifier. |
| getName | Gets the footnote's name. An empty string indicates that the footnote has no name. |
| getNumber | Gets the footnote's number in the text. The first footnote in the document has the number 1. The number is defined through the textflow. |
| getReferenceMarkLength | Gets the number of characters the reference mark consists of. |
| getReferenceMarkStart | Gets the index (one-based) of the first character of the footnote's reference mark. |
| scrollTo | Scrolls the beginning of the footnote mark into the visible part of the document using a default position depending on the previous position. |
| scrollToPosition | Scrolls the beginning of the footnote mark into the visible part of the document using the specified position. |
| setHighlightColor | Sets the highlight color for the reference mark and the footnote mark. |
| setHighlightMode | Sets a value indicating whether the reference mark and the footnote mark is highlighted. |
| setID | Sets a user-defined identifier. It must be a one-based value. A value of zero indicates that the footnote has no identifier. |
| setName | Sets a name for the footnote. An empty string indicates that the footnote has no name. |