Package com.itextpdf.kernel.pdf.tagging
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.Logger
private int
private Map
<PdfIndirectReference, Integer> private PdfNumTree
Represents parentTree in structTreeRoot.private PdfStructTreeRoot
private Map
<PdfIndirectReference, Integer> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Creates and flushes parent tree entry for the page.findMcrByMcid
(PdfDictionary pageDict, int mcid) findObjRefByStructParentIndex
(PdfDictionary pageDict, int structParentIndex) int
getNextMcidForPage
(PdfPage page) private int
Gets a list of all marked content references on the page.private static PdfObject
private void
void
registerMcr
(PdfMcr mcr) private void
registerMcr
(PdfMcr mcr, boolean registeringOnInit) void
void
unregisterMcr
(PdfMcr mcrToUnregister) private boolean
private boolean
updateStructParentTreeForContentStreamEntries
(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
Creates and flushes parent tree entry for the page. Effectively this means that new content mustn't be added to the page.- Parameters:
page
-PdfPage
for which to create parent tree entry. Typically this page is flushed after this call.
-
savePageStructParentIndexIfNeeded
-
buildParentTree
-
registerMcr
-
registerMcr
-
unregisterMcr
-
registerAllMcrs
private void registerAllMcrs() -
updateStructParentTreeEntries
private boolean updateStructParentTreeEntries(PdfPage page, ParentTreeHandler.PageMcrsContainer mcrs) -
updateStructParentTreeForContentStreamEntries
-
getOrCreatePageStructParentIndex
-
getStm
-