Package com.pd4ml.pdf.cos.util
Class PageTree
- java.lang.Object
-
- com.pd4ml.pdf.cos.util.PageTree
-
public final class PageTree extends java.lang.ObjectWalks a parsed document's page tree (/Root/Pages/Kids/...), resolving indirect references at every step. General-purpose COS navigation -- useful to any feature that needs "page N", not just digital signatures (annotations, form-filling, page-level metadata, ...).
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intcountPages(COSDictionary catalog)Total number of leaf pages undercatalog's/Pagestree.static COSDictionaryfindPage(COSDictionary catalog, int index)Returns the zero-basedindex-th page dictionary undercatalog's/Pagestree, ornullif the catalog has no (usable) page tree orindexis out of range.
-
-
-
Method Detail
-
findPage
public static COSDictionary findPage(COSDictionary catalog, int index)
Returns the zero-basedindex-th page dictionary undercatalog's/Pagestree, ornullif the catalog has no (usable) page tree orindexis out of range.
-
countPages
public static int countPages(COSDictionary catalog)
Total number of leaf pages undercatalog's/Pagestree. Trusts the root/Pagesnode's/Countentry (required by the spec to reflect the total leaf-page count), falling back to a full tree walk only if that entry is missing -- a malformed but real-world document.
-
-