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, InvalidPdfException
reader
- the reader holding the PDF to examineDocumentException
InvalidPdfException
protected void processStructElems(PdfDictionary structElem, PdfIndirectReference ref) throws InvalidPdfException
structElem
- the StructElem dictionary that needs to be examinedref
- the reference to the StructElem dictionaryDocumentException
InvalidPdfException
protected void processStructElemKids(PdfDictionary structElem, PdfIndirectReference ref, PdfObject object) throws InvalidPdfException
structElem
- the StructElem dictionaryref
- the reference to the StructElem dictionaryobject
- the kids objectInvalidPdfException
public void removeFromParentTree(PdfNumber structParent)
structParent
- the number to removepublic int processMCID(PdfNumber structParents, PdfIndirectReference ref) throws DocumentException
structParents
- the StructParents entry in the page dictionaryref
- the item for which we need a new MCIDDocumentException
public int getNextMCID(PdfNumber structParents)
structParents
- the StructParents entry in the page dictionarypublic void writeParentTree(PdfWriter writer) throws IOException
writer
- The writer to which the StructParents have to be writtenIOException
Copyright © 2017. All rights reserved.