public class SElement
extends java.lang.Object
Constructor and Description |
---|
SElement()
Instantiates a new SElement.
|
SElement(Obj dict)
Initialize a SElement using an existing low-leval Cos/SDF object.
|
Modifier and Type | Method and Description |
---|---|
static SElement |
__Create(long impl,
java.lang.Object ref) |
void |
destroy()
Frees the native memory of the object.
|
java.lang.String |
getActualText()
Get contained ActualText
|
java.lang.String |
getAlt()
Get the alternate description of the SElement
|
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
|
Obj |
getSDFObj()
Get the SDFObj.
|
STree |
getStructTreeRoot()
Get root of the struct tree.
|
java.lang.String |
getTitle()
Get the title of SElement
|
java.lang.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.
|
public SElement() throws PDFNetException
Note: This constructor does not copy any data, but is instead the logical equivalent of a type cast.
PDFNetException
- the PDF net exceptionpublic SElement(Obj dict) throws PDFNetException
dict
- the dictPDFNetException
public boolean isValid() throws PDFNetException
PDFNetException
public java.lang.String getType() throws PDFNetException
PDFNetException
public int getNumKids() throws PDFNetException
PDFNetException
public boolean isContentItem(int index) throws PDFNetException
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
public ContentItem getAsContentItem(int index) throws PDFNetException
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
public SElement getAsStructElem(int index) throws PDFNetException
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
public SElement getParent() throws PDFNetException
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
public STree getStructTreeRoot() throws PDFNetException
PDFNetException
public boolean hasTitle() throws PDFNetException
PDFNetException
public java.lang.String getTitle() throws PDFNetException
PDFNetException
public Obj getID() throws PDFNetException
PDFNetException
public boolean hasActualText() throws PDFNetException
PDFNetException
public java.lang.String getActualText() throws PDFNetException
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
public boolean hasAlt() throws PDFNetException
PDFNetException
public java.lang.String getAlt() throws PDFNetException
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
public Obj getSDFObj() throws PDFNetException
PDFNetException
public void destroy() throws PDFNetException
PDFNetException
public static SElement __Create(long impl, java.lang.Object ref)