new List()
A class representing a list in the document content tree.
Members
-
<static> NumberFormat
-
Type:
- number
Properties:
Name Type Description e_nonenumber e_decimalnumber e_lower_romannumber e_upper_romannumber e_lower_letternumber e_upper_letternumber e_ordinalnumber e_ordinal_textnumber e_chinese_countingnumber e_chinese_counting_thousandnumber e_cardinal_textnumber e_decimal_zeronumber
Methods
-
addItem()
-
Add a new list item to the list.
Returns:
A promise that resolves to the ListItem object representing the newly added item.- Type
- Promise.<PDFNet.ListItem>
-
asContentElement()
-
Returns:
A promise that resolves to an object of type: "PDFNet.ContentElement"- Type
- Promise.<PDFNet.ContentElement>
-
continueList()
-
Continues the logical continuation of a particular list, even if other non-list content items have been created since the last call to AddItem(). This method is useful when splitting a sublist and wanting to continue the new items as part of the original sublist hierarchy. Note: Without calling ContinueList(), new list items created after a split (e.g., a split paragraph) would be added to the main list structure (above the split) based on their natural positions in the list/sublist hierarchy. Example usage: To continue a root-level list after a split, call ContinueList() on the root-level list.
Returns:
- Type
- Promise.<void>
-
getContentNodeIterator()
-
Retrieve a ContentElementIterator object from the list
The ContentElementIterator object can be used to traverse the children of the list.
Returns:
A promise that resolves to the ContentElementIterator object- Type
- Promise.<PDFNet.Iterator.<PDFNet.ContentElement>>
-
getIndentationLevel()
-
Get the indentation level of the list.
Returns:
A promise that resolves to the indentation level.- Type
- Promise.<number>
-
getListIdentifier()
-
Get the identifier of the list.
Returns:
A promise that resolves to the list identifier.- Type
- Promise.<number>
-
getTextStyledElement()
-
Returns:
A promise that resolves to an object of type: "PDFNet.TextStyledElement"- Type
- Promise.<PDFNet.TextStyledElement>
-
setNumberFormat(format, suffix, cascade)
-
Set the number format of the list with a custom suffix and cascade flag.
Parameters:
Name Type Description formatnumber PDFNet.List.NumberFormat = { e_none : 0 e_decimal : 1 e_lower_roman : 2 e_upper_roman : 3 e_lower_letter : 4 e_upper_letter : 5 e_ordinal : 6 e_ordinal_text : 7 e_chinese_counting : 8 e_chinese_counting_thousand : 9 e_cardinal_text : 10 e_decimal_zero : 11 }The number format to set for the list.suffixstring The suffix to append to the list item number. cascadeboolean If true, the number format will be applied to nested lists as well. Returns:
- Type
- Promise.<void>
-
setStartIndex(idx)
-
Set the start index for the list items.
Parameters:
Name Type Description idxnumber The start index value. Returns:
- Type
- Promise.<void>