Package com.itextpdf.text.pdf
Class PdfStructureElement
- java.lang.Object
-
- com.itextpdf.text.pdf.PdfObject
-
- com.itextpdf.text.pdf.PdfDictionary
-
- com.itextpdf.text.pdf.PdfStructureElement
-
- All Implemented Interfaces:
IPdfStructureElement
,Serializable
public class PdfStructureElement extends PdfDictionary implements IPdfStructureElement
This is a node in a document logical structure. It may contain a mark point or it may contain other nodes.- Author:
- Paulo Soares
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PdfStructureElement(PdfDictionary parent, PdfName structureType, AccessibleElementId elementId)
PdfStructureElement(PdfStructureElement parent, PdfName structureType)
Creates a new instance of PdfStructureElement.PdfStructureElement(PdfStructureTreeRoot root, PdfName structureType)
Creates a new instance of PdfStructureElement.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PdfObject
getAttribute(PdfName name)
Gets the first entarance of attribute.protected AccessibleElementId
getElementId()
PdfDictionary
getParent()
Gets the parent of this node.PdfDictionary
getParent(boolean includeStructTreeRoot)
PdfIndirectReference
getReference()
Gets the reference this object will be written to.PdfName
getStructureType()
void
setAttribute(PdfName name, PdfObject obj)
Sets the attribute value.protected void
setStructureElementParent(PdfStructureElement parent)
protected void
setStructureTreeRoot(PdfStructureTreeRoot root)
void
toPdf(PdfWriter writer, OutputStream os)
Writes the PDF representation of thisPdfDictionary
as an array ofbyte
to the givenOutputStream
.void
writeAttributes(IAccessibleElement element)
-
Methods inherited from class com.itextpdf.text.pdf.PdfDictionary
checkType, clear, contains, get, getAsArray, getAsBoolean, getAsDict, getAsIndirectObject, getAsName, getAsNumber, getAsStream, getAsString, getDirectObject, getKeys, isCatalog, isFont, isOutlineTree, isPage, isPages, merge, mergeDifferent, put, putAll, putEx, remove, size, toString
-
Methods inherited from class com.itextpdf.text.pdf.PdfObject
canBeInObjStm, getBytes, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, length, setContent, setIndRef, type
-
-
-
-
Constructor Detail
-
PdfStructureElement
public PdfStructureElement(PdfStructureElement parent, PdfName structureType)
Creates a new instance of PdfStructureElement.- Parameters:
parent
- the parent of this nodestructureType
- the type of structure. It may be a standard type or a user type mapped by the role map
-
PdfStructureElement
public PdfStructureElement(PdfStructureTreeRoot root, PdfName structureType)
Creates a new instance of PdfStructureElement.- Parameters:
root
- the parent of this nodestructureType
- the type of structure. It may be a standard type or a user type mapped by the role map
-
PdfStructureElement
protected PdfStructureElement(PdfDictionary parent, PdfName structureType, AccessibleElementId elementId)
-
-
Method Detail
-
getStructureType
public PdfName getStructureType()
-
getParent
public PdfDictionary getParent()
Gets the parent of this node.- Returns:
- the parent of this node
-
getParent
public PdfDictionary getParent(boolean includeStructTreeRoot)
-
getReference
public PdfIndirectReference getReference()
Gets the reference this object will be written to.- Returns:
- the reference this object will be written to
- Since:
- 2.1.6 method removed in 2.1.5, but restored in 2.1.6
-
getAttribute
public PdfObject getAttribute(PdfName name)
Gets the first entarance of attribute.- Specified by:
getAttribute
in interfaceIPdfStructureElement
- Since:
- 5.3.4
-
setAttribute
public void setAttribute(PdfName name, PdfObject obj)
Sets the attribute value.- Specified by:
setAttribute
in interfaceIPdfStructureElement
- Since:
- 5.3.4
-
writeAttributes
public void writeAttributes(IAccessibleElement element)
-
toPdf
public void toPdf(PdfWriter writer, OutputStream os) throws IOException
Description copied from class:PdfDictionary
Writes the PDF representation of thisPdfDictionary
as an array ofbyte
to the givenOutputStream
.- Overrides:
toPdf
in classPdfDictionary
- Parameters:
writer
- for backwards compatibilityos
- theOutputStream
to write the bytes to.- Throws:
IOException
-
setStructureTreeRoot
protected void setStructureTreeRoot(PdfStructureTreeRoot root)
-
setStructureElementParent
protected void setStructureElementParent(PdfStructureElement parent)
-
getElementId
protected AccessibleElementId getElementId()
-
-