Class Tree
- java.lang.Object
-
- com.pdftools.toolbox.internal.NativeBase
-
- com.pdftools.toolbox.internal.NativeObject
-
- com.pdftools.toolbox.pdf.structure.Tree
-
public class Tree extends NativeObject
The logical structure of a document is described by a hierarchy of objects called the structure hierarchy or structure tree.
The structure tree root is not made accessible through this interface, but it permits the creation of and reference to a Document node directly below the structure tree root.
It is only possible to use this interface to create a structure tree on a new document with no content that could have contained document structure copied from an existing document. Attempts either to create a structure tree in a document containing content copied without setting the copy option
toolbox.pdf.PageCopyOptions.getCopyLogicalStructure
tofalse
or to copy content into a document with a created structure tree afterwards will fail.When creating a structure element tree, the document metadata will automatically be updated to reflect that this is a tagged PDF.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Node
getDocumentNode()
The document node at the top of the structure element tree.RoleMap
getRoleMap()
The rolemap for structure elements in the structure tree.-
Methods inherited from class com.pdftools.toolbox.internal.NativeObject
equals, hashCode
-
-
-
-
Constructor Detail
-
Tree
public Tree(Document document)
Creates a new StructTreeRoot and adds a root-level “Document” node- Parameters:
document
- the output document with which the returned structure tree is associated- Throws:
java.lang.IllegalArgumentException
- if the document is invalid, or an input document, or a document where logical structure has been potentially copied from an existing document alreadyjava.lang.IllegalArgumentException
- ifdocument
isnull
-
-
Method Detail
-
getDocumentNode
public Node getDocumentNode()
The document node at the top of the structure element tree.- Throws:
java.lang.IllegalStateException
- if the object or the owning document has already been closed
-
getRoleMap
public RoleMap getRoleMap()
The rolemap for structure elements in the structure tree. If this does not exist it will be created.
-
-