new List()
A class representing a list in the document content tree.
Members
-
<static> NumberFormat
-
Type:
- number
Properties:
Name Type Description e_none
number e_decimal
number e_lower_roman
number e_upper_roman
number e_lower_letter
number e_upper_letter
number e_ordinal
number e_ordinal_text
number e_chinese_counting
number e_chinese_counting_thousand
number e_cardinal_text
number e_decimal_zero
number
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 format
number 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.suffix
string The suffix to append to the list item number. cascade
boolean 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 idx
number The start index value. Returns:
- Type
- Promise.<void>