Class Node
- java.lang.Object
-
- com.pdftools.toolbox.internal.NativeBase
-
- com.pdftools.toolbox.internal.NativeObject
-
- com.pdftools.toolbox.pdf.structure.Node
-
public class Node extends NativeObject
This class represents a structure element node in the structure element tree of a tagged PDF. Nodes may either have a collection of other nodes as children, or be associated with marked content. These two roles cannot be mixed.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAlternateText()
Alternate text to be used where the content denoted by the structure element and its children cannot be rendered because of accessibility or other concerns.Rectangle
getBoundingBox()
Bounding box for contents - should only be set for Figure, Formula and Table (Getter)NodeList
getChildren()
The list of child nodes under this node in the structure element tree.Page
getPage()
The page on which marked content associated with the structure element node is to be found.Node
getParent()
The parent node in the structure element tree.java.lang.String
getTag()
Tags should conform to the Standard Structure Types described within the PDF standard.void
setAlternateText(java.lang.String value)
Alternate text to be used where the content denoted by the structure element and its children cannot be rendered because of accessibility or other concerns.void
setBoundingBox(Rectangle value)
Bounding box for contents - should only be set for Figure, Formula and Table (Setter)void
setPage(Page value)
The page on which marked content associated with the structure element node is to be found.void
setTag(java.lang.String value)
Tags should conform to the Standard Structure Types described within the PDF standard.-
Methods inherited from class com.pdftools.toolbox.internal.NativeObject
equals, hashCode
-
-
-
-
Constructor Detail
-
Node
public Node(java.lang.String tag, Document document)
- Parameters:
tag
- Tags should conform to the Standard Structure Types described within the PDF standard or refer to entries in the RoleMap. Allowed values from the PDF standard are: Document, Part, Sect, Art, Div, H1, H2, H3, H4, H5, H6, P, L, LI, Lbl, LBody, Table, TR, TH, TD, THead, TBody, TFoot, Span, Quote, Note, Reference, Figure, Caption, Artifact, Form, Field, Link, Code, Annot, Ruby, Warichu, TOC, TOCI, Index and BibEntry.document
- The document containing the structure element tree.- Throws:
java.lang.IllegalStateException
- if the object or the owning document has already been closedjava.lang.IllegalArgumentException
- iftag
isnull
java.lang.IllegalArgumentException
- ifdocument
isnull
-
Node
public Node(java.lang.String tag, Document document, Page page)
- Parameters:
tag
- Tags should conform to the Standard Structure Types described within the PDF standard or refer to entries in the RoleMap. Allowed values from the PDF standard are: Document, Part, Sect, Art, Div, H1, H2, H3, H4, H5, H6, P, L, LI, Lbl, LBody, Table, TR, TH, TD, THead, TBody, TFoot, Span, Quote, Note, Reference, Figure, Caption, Artifact, Form, Field, Link, Code, Annot, Ruby, Warichu, TOC, TOCI, Index and BibEntry.document
- The document containing the structure element tree.page
- The page on which marked content associated with the structure element node is to be found. This is optional, but is best omitted for nodes which are not associated with marked content.- Throws:
java.lang.IllegalStateException
- if the object or the owning document has already been closedjava.lang.IllegalArgumentException
- iftag
isnull
java.lang.IllegalArgumentException
- ifdocument
isnull
-
-
Method Detail
-
getParent
public Node getParent()
The parent node in the structure element tree.- Throws:
java.lang.IllegalStateException
- if the object or the owning document has already been closedjava.lang.UnsupportedOperationException
- if the parent is the structure element tree root node
-
getChildren
public NodeList getChildren() throws NotFoundException
The list of child nodes under this node in the structure element tree. Once child nodes have been added to a node, it can no longer be associated with marked content.- Throws:
java.lang.IllegalStateException
- if the object or the owning document has already been closedNotFoundException
- if the node's list of children is invalid
-
getTag
public java.lang.String getTag() throws NotFoundException
Tags should conform to the Standard Structure Types described within the PDF standard.- Throws:
java.lang.IllegalStateException
- if the object or the owning document has already been closedNotFoundException
- if the node tag is invalid
-
setTag
public void setTag(java.lang.String value) throws NotFoundException
Tags should conform to the Standard Structure Types described within the PDF standard.- Throws:
java.lang.IllegalStateException
- if the object or the owning document has already been closedNotFoundException
- if the node tag is invalidjava.lang.IllegalArgumentException
- ifvalue
isnull
-
getPage
public Page getPage()
The page on which marked content associated with the structure element node is to be found. This is optional, but is best omitted for nodes which are not associated with marked content.- Throws:
java.lang.IllegalStateException
- if the object or the owning document has already been closed
-
setPage
public void setPage(Page value)
The page on which marked content associated with the structure element node is to be found. This is optional, but is best omitted for nodes which are not associated with marked content.- Throws:
java.lang.IllegalStateException
- if the object or the owning document has already been closed
-
getAlternateText
public java.lang.String getAlternateText()
Alternate text to be used where the content denoted by the structure element and its children cannot be rendered because of accessibility or other concerns.- Throws:
java.lang.IllegalStateException
- if the object or the owning document has already been closed
-
setAlternateText
public void setAlternateText(java.lang.String value)
Alternate text to be used where the content denoted by the structure element and its children cannot be rendered because of accessibility or other concerns.- Throws:
java.lang.IllegalStateException
- if the object or the owning document has already been closed
-
getBoundingBox
public Rectangle getBoundingBox()
Bounding box for contents - should only be set for Figure, Formula and Table (Getter)
- Throws:
java.lang.IllegalStateException
- if the object has already been closed
-
setBoundingBox
public void setBoundingBox(Rectangle value)
Bounding box for contents - should only be set for Figure, Formula and Table (Setter)
- Throws:
java.lang.IllegalStateException
- if the object has already been closedjava.lang.IllegalArgumentException
- if a valid bounding box is not supplied
-
-