diff --git a/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDParentTreeValue.java b/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDParentTreeValue.java index b82d4255392..028d6af82ee 100644 --- a/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDParentTreeValue.java +++ b/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDParentTreeValue.java @@ -22,8 +22,11 @@ import org.apache.pdfbox.pdmodel.common.COSObjectable; /** - * Described in the PDF specification in the ParentTree segment of the table "Entries in the - * structure tree root". This is either a dictionary or an array. + * This is described in the PDF specification in the ParentTree segment of the table "Entries + * in the structure tree root". This is either a dictionary or an array. It's a dictionary for + * individual objects like an annotation or an XObject, and an array for a page object or a content + * stream containing marked-content sequences identified by an MCID. The index in the array is + * identical to the MCID. You can pass null if the MCIDs are not continous. * * @author Tilman Hausherr */ diff --git a/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDStructureTreeRoot.java b/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDStructureTreeRoot.java index 2a979c935ec..763b092b1ac 100644 --- a/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDStructureTreeRoot.java +++ b/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDStructureTreeRoot.java @@ -112,9 +112,15 @@ public void setIDTree(PDNameTreeNode idTree) } /** - * Returns the parent tree. - * - * @return the parent tree + * Returns the parent tree.

+ * The keys correspond to a single page of the document or to an individual object, e.g. an + * annotation or an XObject, which have a /StructParent or /StructParents + * entry.

+ * The values of type {@link PDParentTreeValue} are either a dictionary or an array. It's a + * dictionary for individual objects like an annotation or an XObject, and an array for a page + * object or a content stream containing marked-content sequences identified by an MCID. + * + * @return the parent tree. */ public PDNumberTreeNode getParentTree() { @@ -123,8 +129,16 @@ public PDNumberTreeNode getParentTree() } /** - * Sets the parent tree. - * + * Sets the parent tree.

+ * The keys correspond to a single page of the document or to an individual object, e.g. an + * annotation or an XObject, which have a /StructParent or /StructParents + * entry.

+ * The values of type {@link PDParentTreeValue} are either a dictionary or an array. It's a + * dictionary for individual objects like an annotation or an XObject, and an array for a page + * object or a content stream containing marked-content sequences identified by an MCID. + *

+ * To create an empty parent tree, call {@code new PDNumberTreeNode(PDParentTreeValue.class)}. + * * @param parentTree the parent tree */ public void setParentTree(PDNumberTreeNode parentTree) @@ -133,9 +147,10 @@ public void setParentTree(PDNumberTreeNode parentTree) } /** - * Returns the next key in the parent tree. - * - * @return the next key in the parent tree + * Returns The next key for the parent tree. This is a number greater than any existing key, and + * which shall be used for the next entry to be added to the tree. + * + * @return The next key for the parent tree */ public int getParentTreeNextKey() { @@ -143,9 +158,10 @@ public int getParentTreeNextKey() } /** - * Sets the next key in the parent tree. + * Sets the next key in the parent tree. This is a number greater than any existing key, and + * which shall be used for the next entry to be added to the tree. * - * @param parentTreeNextkey the next key in the parent tree. + * @param parentTreeNextkey The next key in the parent tree. */ public void setParentTreeNextKey(int parentTreeNextkey) {