PageNumberFieldCollection Object
Description
Contains the page number fields in a header or footer of a Text Control document.
Syntax
PageNumberFieldCollectionExamples
The following example demonstrates PageNumberFieldCollection in a practical document-editing workflow. It contains the page number fields in a header or footer of a Text Control document.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.textParts.getMainText(function(mainText) {
const pageNumberFields = mainText.pageNumberFields;
pageNumberFields.getItem(
function(field) {
if (!field) {
console.warn("No pagenumber field was returned.");
return;
}
console.log("get item result:", field);
},
onTxError,
25
);
}, onTxError);Members
Methods
| Method | Description |
|---|---|
| add | Inserts a new page number field at the current input position which displays Arabic numbers starting with 1. |
| getCanAdd | Gets a value indicating whether a new text field can be inserted at the current input position. (Inherited from TextFieldCollectionBase.) |
| getItem | Gets the field at the current input position or null, if there is no such field at the current input position. |
| remove | Removes a page number from a header or footer of a Text control document. |