@Test(expected = IllegalArgumentException.class) public void pageDestinationForNull() { OutlineUtils.pageDestinationFor(null); }
public static PDPageXYZDestination pageDestinationFor(PDPage page) { requireNotNullArg(page, "Cannot create a destination to a null page"); PDPageXYZDestination pageDest = new PDPageXYZDestination(); pageDest.setPage(page); PDRectangle cropBox = page.getCropBox(); switch (Rotation.getRotation(page.getRotation())) { case DEGREES_180: pageDest.setLeft((int) cropBox.getUpperRightX()); pageDest.setTop((int) cropBox.getLowerLeftY()); break; case DEGREES_270: pageDest.setLeft((int) cropBox.getUpperRightX()); pageDest.setTop((int) cropBox.getUpperRightY()); break; case DEGREES_90: pageDest.setLeft((int) cropBox.getLowerLeftX()); pageDest.setTop((int) cropBox.getLowerLeftY()); break; default: pageDest.setLeft((int) cropBox.getLowerLeftX()); pageDest.setTop((int) cropBox.getUpperRightY()); break; } return pageDest; }
OutlineUtils { public static PDPageXYZDestination pageDestinationFor(PDPage page) { requireNotNullArg(page, "Cannot create a destination to a null page"); PDPageXYZDestination pageDest = new PDPageXYZDestination(); pageDest.setPage(page); PDRectangle cropBox = page.getCropBox(); switch (Rotation.getRotation(page.getRotation())) { case DEGREES_180: pageDest.setLeft((int) cropBox.getUpperRightX()); pageDest.setTop((int) cropBox.getLowerLeftY()); break; case DEGREES_270: pageDest.setLeft((int) cropBox.getUpperRightX()); pageDest.setTop((int) cropBox.getUpperRightY()); break; case DEGREES_90: pageDest.setLeft((int) cropBox.getLowerLeftX()); pageDest.setTop((int) cropBox.getLowerLeftY()); break; default: pageDest.setLeft((int) cropBox.getLowerLeftX()); pageDest.setTop((int) cropBox.getUpperRightY()); break; } return pageDest; } }
OutlineUtils { public static PDPageXYZDestination pageDestinationFor(PDPage page) { requireNotNullArg(page, "Cannot create a destination to a null page"); PDPageXYZDestination pageDest = new PDPageXYZDestination(); pageDest.setPage(page); PDRectangle cropBox = page.getCropBox(); switch (Rotation.getRotation(page.getRotation())) { case DEGREES_180: pageDest.setLeft((int) cropBox.getUpperRightX()); pageDest.setTop((int) cropBox.getLowerLeftY()); break; case DEGREES_270: pageDest.setLeft((int) cropBox.getUpperRightX()); pageDest.setTop((int) cropBox.getUpperRightY()); break; case DEGREES_90: pageDest.setLeft((int) cropBox.getLowerLeftX()); pageDest.setTop((int) cropBox.getLowerLeftY()); break; default: pageDest.setLeft((int) cropBox.getLowerLeftX()); pageDest.setTop((int) cropBox.getUpperRightY()); break; } return pageDest; } private  OutlineUtils(); }
OutlineUtils { public static PDPageXYZDestination pageDestinationFor(PDPage page) { requireNotNullArg(page, "Cannot create a destination to a null page"); PDPageXYZDestination pageDest = new PDPageXYZDestination(); pageDest.setPage(page); PDRectangle cropBox = page.getCropBox(); switch (Rotation.getRotation(page.getRotation())) { case DEGREES_180: pageDest.setLeft((int) cropBox.getUpperRightX()); pageDest.setTop((int) cropBox.getLowerLeftY()); break; case DEGREES_270: pageDest.setLeft((int) cropBox.getUpperRightX()); pageDest.setTop((int) cropBox.getUpperRightY()); break; case DEGREES_90: pageDest.setLeft((int) cropBox.getLowerLeftX()); pageDest.setTop((int) cropBox.getLowerLeftY()); break; default: pageDest.setLeft((int) cropBox.getLowerLeftX()); pageDest.setTop((int) cropBox.getUpperRightY()); break; } return pageDest; } 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 PDPageXYZDestination pageDestinationFor(PDPage page) { requireNotNullArg(page, "Cannot create a destination to a null page"); PDPageXYZDestination pageDest = new PDPageXYZDestination(); pageDest.setPage(page); PDRectangle cropBox = page.getCropBox(); switch (Rotation.getRotation(page.getRotation())) { case DEGREES_180: pageDest.setLeft((int) cropBox.getUpperRightX()); pageDest.setTop((int) cropBox.getLowerLeftY()); break; case DEGREES_270: pageDest.setLeft((int) cropBox.getUpperRightX()); pageDest.setTop((int) cropBox.getUpperRightY()); break; case DEGREES_90: pageDest.setLeft((int) cropBox.getLowerLeftX()); pageDest.setTop((int) cropBox.getLowerLeftY()); break; default: pageDest.setLeft((int) cropBox.getLowerLeftX()); pageDest.setTop((int) cropBox.getUpperRightY()); break; } return pageDest; } 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);  }