Package com.itextpdf.kernel.pdf.tagging
Class ParentTreeHandler
- java.lang.Object
-
- com.itextpdf.kernel.pdf.tagging.ParentTreeHandler
-
class ParentTreeHandler extends java.lang.Object
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 Classes Modifier and Type Class Description (package private) static class
ParentTreeHandler.PageMcrsContainer
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Logger
LOGGER
private int
maxStructParentIndex
private java.util.Map<PdfIndirectReference,ParentTreeHandler.PageMcrsContainer>
pageToPageMcrs
private java.util.Map<PdfIndirectReference,java.lang.Integer>
pageToStructParentsInd
private PdfNumTree
parentTree
Represents parentTree in structTreeRoot.private PdfStructTreeRoot
structTreeRoot
private java.util.Map<PdfIndirectReference,java.lang.Integer>
xObjectToStructParentsInd
-
Constructor Summary
Constructors Constructor Description ParentTreeHandler(PdfStructTreeRoot structTreeRoot)
Init ParentTreeHandler.
-
Method Summary
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
structTreeRoot
private PdfStructTreeRoot structTreeRoot
-
parentTree
private PdfNumTree parentTree
Represents parentTree in structTreeRoot. It contains only those entries that belong to the already flushed pages.
-
pageToPageMcrs
private java.util.Map<PdfIndirectReference,ParentTreeHandler.PageMcrsContainer> pageToPageMcrs
-
pageToStructParentsInd
private java.util.Map<PdfIndirectReference,java.lang.Integer> pageToStructParentsInd
-
xObjectToStructParentsInd
private java.util.Map<PdfIndirectReference,java.lang.Integer> xObjectToStructParentsInd
-
maxStructParentIndex
private int maxStructParentIndex
-
-
Constructor Detail
-
ParentTreeHandler
ParentTreeHandler(PdfStructTreeRoot structTreeRoot)
Init ParentTreeHandler. On init the parent tree is read and stored in this instance.
-
-
Method Detail
-
getPageMarkedContentReferences
public ParentTreeHandler.PageMcrsContainer getPageMarkedContentReferences(PdfPage page)
Gets a list of all marked content references on the page.
-
findMcrByMcid
public PdfMcr findMcrByMcid(PdfDictionary pageDict, int mcid)
-
findObjRefByStructParentIndex
public PdfObjRef findObjRefByStructParentIndex(PdfDictionary pageDict, int structParentIndex)
-
getNextMcidForPage
public int getNextMcidForPage(PdfPage page)
-
createParentTreeEntryForPage
public void createParentTreeEntryForPage(PdfPage page)
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
public void savePageStructParentIndexIfNeeded(PdfPage page)
-
buildParentTree
public PdfDictionary buildParentTree()
-
registerMcr
public void registerMcr(PdfMcr mcr)
-
registerMcr
private void registerMcr(PdfMcr mcr, boolean registeringOnInit)
-
unregisterMcr
public void unregisterMcr(PdfMcr mcrToUnregister)
-
isModificationAllowed
private boolean isModificationAllowed()
-
registerAllMcrs
private void registerAllMcrs()
-
updateStructParentTreeEntries
private boolean updateStructParentTreeEntries(PdfPage page, ParentTreeHandler.PageMcrsContainer mcrs)
-
updateStructParentTreeForContentStreamEntries
private boolean updateStructParentTreeForContentStreamEntries(java.util.Map<java.lang.Integer,PdfMcr> mcrsOfContentStream, int pageStructParentIndex)
-
getOrCreatePageStructParentIndex
private int getOrCreatePageStructParentIndex(PdfPage page)
-
-