@Test public void positiveMultipleLevel() throws IOException { doc = PDDocument.load(TestPDPageTree.class.getResourceAsStream("/pdfbox/com/tom_roush/pdfbox/pdmodel/page_tree_multiple_levels.pdf")); for (int i = 0; i < doc.getNumberOfPages(); i++) { assertEquals(i, doc.getPages().indexOf(doc.getPage(i))); } }
public int indexOf(PDPage page) { SearchContext context = new SearchContext(page); if (findPage(context, root)) { return context.index; } return -1; }
PDPageTree implements COSObjectable, Iterable<PDPage> { public int indexOf(PDPage page) { SearchContext context = new SearchContext(page); if (findPage(context, root)) { return context.index; } return -1; } }
PDPageTree implements COSObjectable, Iterable<PDPage> { public int indexOf(PDPage page) { SearchContext context = new SearchContext(page); if (findPage(context, root)) { return context.index; } return -1; } PDPageTree();  PDPageTree(COSDictionary root);   PDPageTree(COSDictionary root, PDDocument document); }
PDPageTree implements COSObjectable, Iterable<PDPage> { public int indexOf(PDPage page) { SearchContext context = new SearchContext(page); if (findPage(context, root)) { return context.index; } return -1; } PDPageTree();  PDPageTree(COSDictionary root);   PDPageTree(COSDictionary root, PDDocument document); static COSBase getInheritableAttribute(COSDictionary node, COSName key); @Override Iterator<PDPage> iterator(); PDPage get(int index); int indexOf(PDPage page); int getCount(); @Override COSDictionary getCOSObject(); void remove(int index); void remove(PDPage page); void add(PDPage page); }
PDPageTree implements COSObjectable, Iterable<PDPage> { public int indexOf(PDPage page) { SearchContext context = new SearchContext(page); if (findPage(context, root)) { return context.index; } return -1; } PDPageTree();  PDPageTree(COSDictionary root);   PDPageTree(COSDictionary root, PDDocument document); static COSBase getInheritableAttribute(COSDictionary node, COSName key); @Override Iterator<PDPage> iterator(); PDPage get(int index); int indexOf(PDPage page); int getCount(); @Override COSDictionary getCOSObject(); void remove(int index); void remove(PDPage page); void add(PDPage page);  }