public class PDFStructElem extends StructureHierarchyMember implements StructureTreeElement, Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
PDFStructElem.Placeholder
Class representing a placeholder for a PDF Structure Element.
|
| Modifier and Type | Field and Description |
|---|---|
protected List<PDFObject> |
kids
Elements to be added to the kids array.
|
protected PDFStructElem |
parentElement |
entries, order| Constructor and Description |
|---|
PDFStructElem()
Creates PDFStructElem with no entries.
|
PDFStructElem(PDFObject parent,
StructureType structureType)
Creates a new structure element.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addKid(PDFObject kid)
Adds a kid to this structure element.
|
void |
addKidInSpecificOrder(int position,
PDFStructElem kid) |
protected boolean |
attachKids()
Attaches all valid kids to the kids array.
|
List<PDFObject> |
getKids() |
String |
getLanguage()
Returns the language of this structure element.
|
PDFStructElem |
getParentStructElem()
Returns the parent of this structure element.
|
StructureType |
getStructureType()
Returns the structure type of this structure element.
|
int |
output(OutputStream stream)
Write the PDF represention of this object
|
void |
setLanguage(Locale language)
Sets the language of this structure element.
|
void |
setMCIDKid(int mcid)
Sets the given mcid as the kid of this structure element.
|
void |
setPage(PDFPage page)
Sets the page reference of this structure element.
|
void |
setParent(PDFObject parent)
Sets the direct parent object.
|
void |
setTableAttributeColSpan(int colSpan) |
void |
setTableAttributeRowSpan(int rowSpan) |
protected void |
writeDictionary(OutputStream out,
StringBuilder textBuffer)
Writes the contents of the dictionary to a StringBuffer.
|
containsKey, get, getChildren, getChildren, keySet, put, put, removecontentEquals, encode, encodeBinaryToHexString, encodeString, encodeText, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, outputInline, referencePDF, setDocument, setObjectNumber, setObjectNumber, setObjectNumber, supportsObjectStream, toPDF, toPDFStringprotected PDFStructElem parentElement
public PDFStructElem()
public PDFStructElem(PDFObject parent, StructureType structureType)
parent - parent of this elementstructureType - the structure type of this elementpublic PDFStructElem getParentStructElem()
null if the parent is not a structure
element (i.e., is the structure tree root)public void setParent(PDFObject parent)
public void addKid(PDFObject kid)
addKid in class StructureHierarchyMemberkid - element to be addedpublic void setMCIDKid(int mcid)
mcid - mcid of the marked-content sequence corresponding to this
structure element's kidpublic void setPage(PDFPage page)
page - value for the Pg entrypublic StructureType getStructureType()
public void setLanguage(Locale language)
language - a value for the Lang entrypublic String getLanguage()
null if no language was specified)protected void writeDictionary(OutputStream out, StringBuilder textBuffer) throws IOException
PDFDictionarywriteDictionary in class PDFDictionaryout - the OutputStream (for binary content)textBuffer - the text buffer for text outputIOException - if an I/O error occurspublic void addKidInSpecificOrder(int position,
PDFStructElem kid)
protected boolean attachKids()
public void setTableAttributeColSpan(int colSpan)
public void setTableAttributeRowSpan(int rowSpan)
public int output(OutputStream stream) throws IOException
PDFDictionaryoutput in class PDFDictionarystream - the stream to write the PDF toIOException - if there is an error writing to the streamCopyright © 2025 Apache Software Foundation. All rights reserved.