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 AccessibleElementIdprivate PdfStructureElementHolds value of property kids.private PdfIndirectReferenceHolds value of property reference.private PdfNameprivate PdfStructureTreeRoot -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPdfStructureElement(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 booleancolorsEqual(PdfArray parentColor, float[] color) getAttribute(PdfName name) Gets the first entarance of attribute.protected AccessibleElementIdGets the parent of this node.getParent(boolean includeStructTreeRoot) private PdfObjectgetParentAttribute(IPdfStructureElement parent, PdfName name) Gets the reference this object will be written to.private voidinit(PdfDictionary parent, PdfName structureType) (package private) voidsetAnnotation(PdfAnnotation annot, PdfIndirectReference currentPage) voidsetAttribute(PdfName name, PdfObject obj) Sets the attribute value.private voidsetColorAttribute(BaseColor newColor, PdfObject oldColor, PdfName attributeName) (package private) voidsetPageMark(int page, int mark) protected voidprotected voidprivate voidsetTextAlignAttribute(int elementAlign) voidtoPdf(PdfWriter writer, OutputStream os) Writes the PDF representation of thisPdfDictionaryas an array ofbyteto the givenOutputStream.private voidwriteAttributes(Chunk chunk) private voidwriteAttributes(Document document) private voidwriteAttributes(Image image) private voidwriteAttributes(List list) private voidwriteAttributes(ListBody listBody) private voidwriteAttributes(ListItem listItem) private voidwriteAttributes(ListLabel listLabel) private voidwriteAttributes(Paragraph paragraph) voidwriteAttributes(IAccessibleElement element) private voidwriteAttributes(PdfDiv div) private voidwriteAttributes(PdfPCell cell) private voidwriteAttributes(PdfPHeaderCell headerCell) private voidwriteAttributes(PdfPRow row) private voidwriteAttributes(PdfPTable table) private voidwriteAttributes(PdfPTableBody body) private voidwriteAttributes(PdfPTableFooter footer) private voidwriteAttributes(PdfPTableHeader header) private voidwriteAttributes(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, toStringMethods 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:
getAttributein interfaceIPdfStructureElement- Since:
- 5.3.4
-
setAttribute
Sets the attribute value.- Specified by:
setAttributein 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:PdfDictionaryWrites the PDF representation of thisPdfDictionaryas an array ofbyteto the givenOutputStream.- Overrides:
toPdfin classPdfDictionary- Parameters:
writer- for backwards compatibilityos- theOutputStreamto write the bytes to.- Throws:
IOException
-
getParentAttribute
-
setStructureTreeRoot
-
setStructureElementParent
-
getElementId
-