Class 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 to false 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.

    • Constructor Summary

      Constructors 
      Constructor Description
      Tree​(Document document)
      Creates a new StructTreeRoot and adds a root-level “Document” node
    • 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 already
        java.lang.IllegalArgumentException - if document is null
    • 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.