java.lang.Object | |
↳ | com.pdftron.pdf.struct.SElement |
SElement represents PDF structural elements, which are nodes in a tree structure, defining a PDF document's logical structure. Unlike the StructTree, SElement can have two different kinds of children: another SElement or a ContentItem (which can be marked content (MC), or a PDF object reference (OBJR)).
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
SElement()
Instantiates a new SElement.
| |||||||||||
SElement(Obj dict)
Initialize a SElement using an existing low-leval Cos/SDF object.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static SElement | __Create(long impl, Object ref) | ||||||||||
void |
close()
Frees the native memory of the object.
| ||||||||||
void |
destroy()
Frees the native memory of the object.
| ||||||||||
String |
getActualText()
Get contained ActualText
Note: The ActualText can be defined as an empty string. | ||||||||||
String |
getAlt()
Get the alternate description of the SElement
Note: The Alt text can be defined as an empty string. | ||||||||||
ContentItem |
getAsContentItem(int index)
Get the kid at give index as a ContentItem.
| ||||||||||
SElement |
getAsStructElem(int index)
Get the kid at give index as SElement.
| ||||||||||
Obj |
getID()
Get the ID of SElement
| ||||||||||
int |
getNumKids()
Get the num kids.
| ||||||||||
SElement |
getParent()
Get the parent as SElement
Note: If the element's parent is the structure tree root, the returned SElement will be not valid (i.e. | ||||||||||
Obj |
getSDFObj()
Get the SDFObj.
| ||||||||||
STree |
getStructTreeRoot()
Get root of the struct tree.
| ||||||||||
String |
getTitle()
Get the title of SElement
| ||||||||||
String |
getType()
Get the structural element type
| ||||||||||
boolean |
hasActualText()
Checks if SElement has ActualText
| ||||||||||
boolean |
hasAlt()
Checks if SElement has alternate description
| ||||||||||
boolean |
hasTitle()
Checks if SElement has title.
| ||||||||||
boolean |
isContentItem(int index)
Checks if SElement is content item.
| ||||||||||
boolean |
isValid()
Checks if SElement is valid.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.lang.AutoCloseable
|
Instantiates a new SElement.
Note: This constructor does not copy any data, but is instead the logical equivalent of a type cast.
PDFNetException | the PDF net exception |
---|
Initialize a SElement using an existing low-leval Cos/SDF object.
dict | the dict |
---|
PDFNetException |
---|
Frees the native memory of the object. This can be explicity called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.
PDFNetException |
---|
Frees the native memory of the object. This can be explicity called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.
PDFNetException |
---|
Get contained ActualText
Note: The ActualText can be defined as an empty string. To differentiate between an ActualText string of zero length and no ActualText being defined, use HasActualText().
PDFNetException |
---|
Get the alternate description of the SElement
Note: The Alt text can be defined as an empty string. To differentiate between an Alt text string of zero length and no Alt text being defined, use HasAlt().
PDFNetException |
---|
Get the kid at give index as a ContentItem.
Note: use IsContentItem(index) prior to calling this method to make sure that the kid is indeed a ContentItem.
index | The index of the kid to obtain. |
---|
PDFNetException |
---|
Get the kid at give index as SElement.
Note: use IsContentItem(index) prior to calling this method to make sure that the kid is not a ContentItem and is another SElement.
index | The index of the kid to obtain. |
---|
PDFNetException |
---|
Get the ID of SElement
PDFNetException |
---|
Get the parent as SElement
Note: If the element's parent is the structure tree root, the returned SElement will be not valid (i.e. element.IsValid() -> false) and the underlying SDF/Cos object will be NULL.
PDFNetException |
---|
Get root of the struct tree.
PDFNetException |
---|
Get the structural element type
PDFNetException |
---|
Checks if SElement has ActualText
PDFNetException |
---|
Checks if SElement has alternate description
PDFNetException |
---|
Checks if SElement has title.
PDFNetException |
---|
Checks if SElement is content item.
index | The index of the kid type to obtain. To retrieve a content item at a given array index use GetAsContentItem(index), otherwise use GetAsStructElem(index) |
---|
PDFNetException |
---|
Checks if SElement is valid.
PDFNetException |
---|