@Test
public void pageDestinationFor() {

    PDPage page = new PDPage(PDRectangle.A4);
    PDPageXYZDestination noRotation = OutlineUtils.pageDestinationFor(page);
    assertEquals(0, noRotation.getLeft());
    assertEquals((int) PDRectangle.A4.getHeight(), noRotation.getTop());
    page.setRotation(90);
    PDPageXYZDestination rotation90 = OutlineUtils.pageDestinationFor(page);
    assertEquals(0, rotation90.getLeft());
    assertEquals(0, rotation90.getTop());
    page.setRotation(180);
    PDPageXYZDestination rotation180 = OutlineUtils.pageDestinationFor(page);
    assertEquals((int) PDRectangle.A4.getWidth(), rotation180.getLeft());
    assertEquals(0, rotation180.getTop());
    page.setRotation(270);
    PDPageXYZDestination rotation270 = OutlineUtils.pageDestinationFor(page);
    assertEquals((int) PDRectangle.A4.getWidth(), rotation270.getLeft());
    assertEquals((int) PDRectangle.A4.getHeight(), rotation270.getTop());
}