Package org.openpdf.text.pdf
Class PdfStructureTreeRoot
java.lang.Object
org.openpdf.text.pdf.PdfObject
org.openpdf.text.pdf.PdfDictionary
org.openpdf.text.pdf.PdfStructureTreeRoot
The structure tree root corresponds to the highest hierarchy level in a tagged PDF.
-
Field Summary
FieldsModifier and TypeFieldDescriptionMap which connects [page number] with corresponding [parentTree entry key]private intNext key to be used for adding to the parentTreeprivate final PdfIndirectReferenceprivate final PdfWriterHolds value of property writer. -
Constructor Summary
ConstructorsConstructorDescriptionPdfStructureTreeRoot(PdfWriter writer) Creates a new instance of PdfStructureTreeRoot -
Method Summary
Modifier and TypeMethodDescriptionintaddExistingObject(PdfIndirectReference reference) Adds a reference to the existing (already added to the document) object to the parentTree.(package private) void(package private) intgetOrCreatePageKey(int pageNumber) Returns array ID for a page-related entry or creates a new one if not exists.Gets the reference this object will be written to.Gets the writer.voidMaps the user tags to the standard tags.private voidnodeProcess(PdfDictionary dictionary, PdfIndirectReference reference) (package private) voidsetPageMark(int pageNumber, PdfIndirectReference reference) Methods inherited from class org.openpdf.text.pdf.PdfDictionary
clear, contains, get, getAsArray, getAsBoolean, getAsDict, getAsIndirectObject, getAsName, getAsNumber, getAsStream, getAsString, getDirectObject, getKeys, getKeysAndValues, isCatalog, isFont, isOutlineTree, isPage, isPages, merge, mergeDifferent, put, putAll, putEx, remove, size, toPdf, toStringMethods inherited from class org.openpdf.text.pdf.PdfObject
canBeInObjStm, getBytes, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, length, setContent, setIndRef, type
-
Field Details
-
parentTree
-
reference
-
parentTreeNextKey
private int parentTreeNextKeyNext key to be used for adding to the parentTree -
pageKeysMap
Map which connects [page number] with corresponding [parentTree entry key] -
writer
Holds value of property writer.
-
-
Constructor Details
-
PdfStructureTreeRoot
PdfStructureTreeRoot(PdfWriter writer) Creates a new instance of PdfStructureTreeRoot
-
-
Method Details
-
mapRole
Maps the user tags to the standard tags. The mapping will allow a standard application to make some sense of the tagged document whatever the user tags may be.- Parameters:
used- the user tagstandard- the standard tag
-
getWriter
Gets the writer.- Returns:
- the writer
-
getReference
Gets the reference this object will be written to.- Returns:
- the reference this object will be written to
- Since:
- 2.1.6 method removed in 2.1.5, but restored in 2.1.6
-
addExistingObject
Adds a reference to the existing (already added to the document) object to the parentTree. This method can be used when the object is need to be referenced via /StructParent key.- Returns:
- key which define the object record key (e.g. in /NUMS array)
-
setPageMark
-
getOrCreatePageKey
int getOrCreatePageKey(int pageNumber) Returns array ID for a page-related entry or creates a new one if not exists. Can be used for STRUCTPARENTS tag value- Parameters:
pageNumber- number of page for which the ID is required- Returns:
- Optional with array ID, empty Optional otherwise
-
nodeProcess
private void nodeProcess(PdfDictionary dictionary, PdfIndirectReference reference) throws IOException - Throws:
IOException
-
buildTree
- Throws:
IOException
-