Class PDStructureTreeRoot
- All Implemented Interfaces:
COSObjectable
- Author:
- Ben Litchfield, Johannes Koch
-
Constructor Summary
ConstructorsConstructorDescriptionDefault Constructor.Constructor for an existing structure element. -
Method Summary
Modifier and TypeMethodDescriptionSets the ClassMap.Returns the ID tree.getK()Returns the K entry.Deprecated.Returns the parent tree.intReturns The next key for the parent tree.Returns the role map.voidsetClassMap(Map<String, Object> classMap) Sets the ClassMap.voidsetIDTree(PDNameTreeNode<PDStructureElement> idTree) Sets the ID tree.voidSets the K entry.voidsetParentTree(PDNumberTreeNode parentTree) Sets the parent tree.voidsetParentTreeNextKey(int parentTreeNextkey) Sets the next key in the parent tree.voidsetRoleMap(Map<String, String> roleMap) Sets the role map.Methods inherited from class org.apache.pdfbox.pdmodel.documentinterchange.logicalstructure.PDStructureNode
appendKid, appendKid, appendObjectableKid, create, createObject, getCOSObject, getKids, getType, insertBefore, insertBefore, insertObjectableBefore, removeKid, removeKid, removeObjectableKid, setKids
-
Constructor Details
-
PDStructureTreeRoot
public PDStructureTreeRoot()Default Constructor. -
PDStructureTreeRoot
Constructor for an existing structure element.- Parameters:
dic- The existing dictionary.
-
-
Method Details
-
getKArray
Deprecated.usegetK()only. /K can be a dictionary or an array, and the next level can also be a dictionary. See file 054080.pdf in PDFBOX-4417 and read "Entries in the structure tree root" in the PDF specification.Returns the K array entry.- Returns:
- the K array entry
-
getK
Returns the K entry. This can be a dictionary representing a structure element, or an array of them. To get it as a list of PDStructureElement objects, usePDStructureNode.getKids()instead.- Returns:
- the K entry.
-
setK
Sets the K entry.- Parameters:
k- the K value
-
getIDTree
Returns the ID tree.- Returns:
- the ID tree
-
setIDTree
Sets the ID tree.- Parameters:
idTree- the ID tree
-
getParentTree
Returns the parent tree.The keys correspond to a single page of the document or to an individual object, e.g. an annotation or an XObject, which have a /StructParent or /StructParents entry.
The values of type
PDParentTreeValueare either a dictionary or an array. It's a dictionary for individual objects like an annotation or an XObject, and an array for a page object or a content stream containing marked-content sequences identified by an MCID.- Returns:
- the parent tree.
-
setParentTree
Sets the parent tree.The keys correspond to a single page of the document or to an individual object, e.g. an annotation or an XObject, which have a /StructParent or /StructParents entry.
The values of type
PDParentTreeValueare either a dictionary or an array. It's a dictionary for individual objects like an annotation or an XObject, and an array for a page object or a content stream containing marked-content sequences identified by an MCID.To create an empty parent tree, call
new PDNumberTreeNode(PDParentTreeValue.class).- Parameters:
parentTree- the parent tree
-
getParentTreeNextKey
public int getParentTreeNextKey()Returns The next key for the parent tree. This is a number greater than any existing key, and which shall be used for the next entry to be added to the tree.- Returns:
- The next key for the parent tree
-
setParentTreeNextKey
public void setParentTreeNextKey(int parentTreeNextkey) Sets the next key in the parent tree. This is a number greater than any existing key, and which shall be used for the next entry to be added to the tree.- Parameters:
parentTreeNextkey- The next key in the parent tree.
-
getRoleMap
Returns the role map.- Returns:
- the role map
-
setRoleMap
Sets the role map.- Parameters:
roleMap- the role map
-
getClassMap
Sets the ClassMap.- Returns:
- the ClassMap, never null. The elements are either
PDAttributeObjector lists of it.
-
setClassMap
Sets the ClassMap.- Parameters:
classMap- null, or a map whose elements are eitherPDAttributeObjector lists of it.
-
getK()only.