@Test public void outlineLevels() throws IOException { try (PDDocument doc = PDFParser.parse( SeekableSources.inMemorySeekableSourceFrom(getClass().getResourceAsStream("/pdf/test_outline.pdf")))) { Set<Integer> levels = OutlineUtils.getOutlineLevelsWithPageDestination(doc); assertEquals(3, levels.size()); assertTrue(levels.contains(1)); assertTrue(levels.contains(2)); assertTrue(levels.contains(3)); } }
public static Set<Integer> getOutlineLevelsWithPageDestination(PDDocument document) { return getFlatOutline(document).stream().map(i -> i.level).collect(Collectors.toSet()); }
OutlineUtils { public static Set<Integer> getOutlineLevelsWithPageDestination(PDDocument document) { return getFlatOutline(document).stream().map(i -> i.level).collect(Collectors.toSet()); } }
OutlineUtils { public static Set<Integer> getOutlineLevelsWithPageDestination(PDDocument document) { return getFlatOutline(document).stream().map(i -> i.level).collect(Collectors.toSet()); } private  OutlineUtils(); }
OutlineUtils { public static Set<Integer> getOutlineLevelsWithPageDestination(PDDocument document) { return getFlatOutline(document).stream().map(i -> i.level).collect(Collectors.toSet()); } private  OutlineUtils(); static Set<Integer> getOutlineLevelsWithPageDestination(PDDocument document); static Optional<PDPageDestination> toPageDestination(PDOutlineItem current, PDDocumentCatalog catalog); static PDPageXYZDestination pageDestinationFor(PDPage page); static PDPageDestination clonePageDestination(PDPageDestination dest, PDPage destPage); static PDPage resolvePageDestination(PDPageDestination destination, PDDocument document); static void copyOutlineDictionary(PDOutlineItem from, PDOutlineItem to); static List<OutlineItem> getFlatOutline(PDDocument document); static void printOutline(PDDocument document); }
OutlineUtils { public static Set<Integer> getOutlineLevelsWithPageDestination(PDDocument document) { return getFlatOutline(document).stream().map(i -> i.level).collect(Collectors.toSet()); } private  OutlineUtils(); static Set<Integer> getOutlineLevelsWithPageDestination(PDDocument document); static Optional<PDPageDestination> toPageDestination(PDOutlineItem current, PDDocumentCatalog catalog); static PDPageXYZDestination pageDestinationFor(PDPage page); static PDPageDestination clonePageDestination(PDPageDestination dest, PDPage destPage); static PDPage resolvePageDestination(PDPageDestination destination, PDDocument document); static void copyOutlineDictionary(PDOutlineItem from, PDOutlineItem to); static List<OutlineItem> getFlatOutline(PDDocument document); static void printOutline(PDDocument document);  }