public class StructureItems extends ArrayList<StructureItem>
Modifier and Type | Field and Description |
---|---|
protected static Logger |
LOGGER
The Logger instance
|
protected HashMap<Integer,PdfObject> |
parentTree
The StructParents number tree values.
|
protected PdfDictionary |
structTreeRoot
The StructTreeRoot dictionary
|
modCount
Constructor and Description |
---|
StructureItems(PdfReader reader)
Creates a list of StructuredItem objects.
|
Modifier and Type | Method and Description |
---|---|
int |
getNextMCID(PdfNumber structParents)
Finds the next available MCID, which is either the lowest empty ID in the existing range, or the first available higher number.
|
int |
processMCID(PdfNumber structParents, PdfIndirectReference ref)
Creates a new MCID in the parent tree of the page and returns that new MCID so that it can be used in the content stream
|
protected void |
processStructElemKids(PdfDictionary structElem, PdfIndirectReference ref, PdfObject object)
Processes the kids object of a StructElem dictionary.
|
protected void |
processStructElems(PdfDictionary structElem, PdfIndirectReference ref)
Looks at a StructElem dictionary, and processes it.
|
void |
removeFromParentTree(PdfNumber structParent)
Removes a StructParent from the parent tree.
|
void |
writeParentTree(PdfWriter writer)
Writes the altered parent tree to a PdfWriter and updates the StructTreeRoot entry.
|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
equals, hashCode
containsAll, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode
parallelStream, stream
protected static final Logger LOGGER
protected PdfDictionary structTreeRoot
public StructureItems(PdfReader reader) throws DocumentException
reader
- the reader holding the PDF to examine
DocumentException
protected void processStructElems(PdfDictionary structElem, PdfIndirectReference ref)
structElem
- the StructElem dictionary that needs to be examined
ref
- the reference to the StructElem dictionary
DocumentException
protected void processStructElemKids(PdfDictionary structElem, PdfIndirectReference ref, PdfObject object)
structElem
- the StructElem dictionary
ref
- the reference to the StructElem dictionary
object
- the kids object
public void removeFromParentTree(PdfNumber structParent)
structParent
- the number to remove
public int processMCID(PdfNumber structParents, PdfIndirectReference ref) throws DocumentException
structParents
- the StructParents entry in the page dictionary
ref
- the item for which we need a new MCID
DocumentException
public int getNextMCID(PdfNumber structParents)
structParents
- the StructParents entry in the page dictionary
public void writeParentTree(PdfWriter writer) throws IOException
writer
- The writer to which the StructParents have to be written
IOException
Copyright © 1998–2016. All rights reserved.