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
This is a node in a document logical structure. It may contain a mark point or it may contain
other nodes.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AccessibleElementId
private PdfStructureElement
Holds value of property kids.private PdfIndirectReference
Holds value of property reference.private PdfName
private PdfStructureTreeRoot
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
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
Modifier and TypeMethodDescriptionprivate boolean
colorsEqual
(PdfArray parentColor, float[] color) getAttribute
(PdfName name) Gets the first entarance of attribute.protected AccessibleElementId
Gets the parent of this node.getParent
(boolean includeStructTreeRoot) private PdfObject
getParentAttribute
(IPdfStructureElement parent, PdfName name) Gets the reference this object will be written to.private void
init
(PdfDictionary parent, PdfName structureType) (package private) void
setAnnotation
(PdfAnnotation annot, PdfIndirectReference currentPage) void
setAttribute
(PdfName name, PdfObject obj) Sets the attribute value.private void
setColorAttribute
(BaseColor newColor, PdfObject oldColor, PdfName attributeName) (package private) void
setPageMark
(int page, int mark) protected void
protected void
private void
setTextAlignAttribute
(int elementAlign) void
toPdf
(PdfWriter writer, OutputStream os) Writes the PDF representation of thisPdfDictionary
as an array ofbyte
to the givenOutputStream
.private void
writeAttributes
(Chunk chunk) private void
writeAttributes
(Document document) private void
writeAttributes
(Image image) private void
writeAttributes
(List list) private void
writeAttributes
(ListBody listBody) private void
writeAttributes
(ListItem listItem) private void
writeAttributes
(ListLabel listLabel) private void
writeAttributes
(Paragraph paragraph) void
writeAttributes
(IAccessibleElement element) private void
writeAttributes
(PdfDiv div) private void
writeAttributes
(PdfPCell cell) private void
writeAttributes
(PdfPHeaderCell headerCell) private void
writeAttributes
(PdfPRow row) private void
writeAttributes
(PdfPTable table) private void
writeAttributes
(PdfPTableBody body) private void
writeAttributes
(PdfPTableFooter footer) private void
writeAttributes
(PdfPTableHeader header) private void
writeAttributes
(PdfTemplate template) 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
-
Field Details
-
parent
Holds value of property kids. -
top
-
elementId
-
reference
Holds value of property reference. -
structureType
-
-
Constructor Details
-
PdfStructureElement
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
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 Details
-
getStructureType
-
init
-
getParent
Gets the parent of this node.- Returns:
- the parent of this node
-
getParent
-
setPageMark
void setPageMark(int page, int mark) -
setAnnotation
-
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
Gets the first entarance of attribute.- Specified by:
getAttribute
in interfaceIPdfStructureElement
- Since:
- 5.3.4
-
setAttribute
Sets the attribute value.- Specified by:
setAttribute
in interfaceIPdfStructureElement
- Since:
- 5.3.4
-
writeAttributes
-
writeAttributes
-
writeAttributes
-
writeAttributes
-
writeAttributes
-
writeAttributes
-
writeAttributes
-
writeAttributes
-
writeAttributes
-
writeAttributes
-
writeAttributes
-
writeAttributes
-
writeAttributes
-
writeAttributes
-
writeAttributes
-
writeAttributes
-
writeAttributes
-
colorsEqual
-
setColorAttribute
-
setTextAlignAttribute
private void setTextAlignAttribute(int elementAlign) -
toPdf
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
-
getParentAttribute
-
setStructureTreeRoot
-
setStructureElementParent
-
getElementId
-