Class ParentTreeHandler
java.lang.Object
com.itextpdf.kernel.pdf.tagging.ParentTreeHandler
Internal helper class which is used to effectively build parent tree and also find marked content references:
for specified page, by MCID or by struct parent index.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Loggerprivate intprivate Map<PdfIndirectReference, Integer> private PdfNumTreeRepresents parentTree in structTreeRoot.private PdfStructTreeRootprivate Map<PdfIndirectReference, Integer> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCreates and flushes parent tree entry for the page.findMcrByMcid(PdfDictionary pageDict, int mcid) findObjRefByStructParentIndex(PdfDictionary pageDict, int structParentIndex) intgetNextMcidForPage(PdfPage page) private intGets a list of all marked content references on the page.private static PdfObjectprivate booleanprivate voidvoidregisterMcr(PdfMcr mcr) private voidregisterMcr(PdfMcr mcr, boolean registeringOnInit) voidvoidunregisterMcr(PdfMcr mcrToUnregister) private booleanprivate booleanupdateStructParentTreeForContentStreamEntries(Map<Integer, PdfMcr> mcrsOfContentStream, int pageStructParentIndex)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
structTreeRoot
-
parentTree
Represents parentTree in structTreeRoot. It contains only those entries that belong to the already flushed pages. -
pageToPageMcrs
-
pageToStructParentsInd
-
xObjectToStructParentsInd
-
maxStructParentIndex
private int maxStructParentIndex
-
-
Constructor Details
-
ParentTreeHandler
ParentTreeHandler(PdfStructTreeRoot structTreeRoot) Init ParentTreeHandler. On init the parent tree is read and stored in this instance.
-
-
Method Details
-
getPageMarkedContentReferences
Gets a list of all marked content references on the page. -
findMcrByMcid
-
findObjRefByStructParentIndex
-
getNextMcidForPage
-
createParentTreeEntryForPage
-
savePageStructParentIndexIfNeeded
-
buildParentTree
-
registerMcr
-
registerMcr
-
unregisterMcr
-
isModificationAllowed
private boolean isModificationAllowed() -
registerAllMcrs
private void registerAllMcrs() -
updateStructParentTreeEntries
private boolean updateStructParentTreeEntries(PdfPage page, ParentTreeHandler.PageMcrsContainer mcrs) -
updateStructParentTreeForContentStreamEntries
-
getOrCreatePageStructParentIndex
-
getStm
-