Class PDOutlineNode
java.lang.Object
org.apache.pdfbox.pdmodel.common.PDDictionaryWrapper
org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineNode
- All Implemented Interfaces:
COSObjectable
- Direct Known Subclasses:
PDDocumentOutline
,PDOutlineItem
Base class for a node in the outline of a PDF document.
- Author:
- Ben Litchfield
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFirst
(PDOutlineItem newChild) Adds the given node to the top of the children list.void
addLast
(PDOutlineItem newChild) Adds the given node to the bottom of the children list.children()
void
Close this node.int
Get the number of open nodes or a negative number if this node is closed.boolean
boolean
void
openNode()
This will set this node to be open when it is shown in the viewer.Methods inherited from class org.apache.pdfbox.pdmodel.common.PDDictionaryWrapper
equals, getCOSObject, hashCode
-
Constructor Details
-
PDOutlineNode
public PDOutlineNode()Default Constructor. -
PDOutlineNode
- Parameters:
dict
- The dictionary storage.
-
-
Method Details
-
hasChildren
public boolean hasChildren()- Returns:
- true if the node has at least one child
-
getFirstChild
- Returns:
- The first child or null if there is no child.
-
getLastChild
- Returns:
- The last child or null if there is no child.
-
getOpenCount
public int getOpenCount()Get the number of open nodes or a negative number if this node is closed. See PDF Reference 32000-1:2008 table 152 and 153 for more details. This value is updated as you append children and siblings.- Returns:
- The Count attribute of the outline dictionary.
-
openNode
public void openNode()This will set this node to be open when it is shown in the viewer. By default, when a new node is created it will be closed. This will do nothing if the node is already open. -
closeNode
public void closeNode()Close this node. -
isNodeOpen
public boolean isNodeOpen()- Returns:
- true if this node count is greater than zero, false otherwise.
-
children
- Returns:
- An
Iterable
view of the items children