Example usage for org.apache.pdfbox.pdmodel.interactive.action PDActionGoTo setDestination

List of usage examples for org.apache.pdfbox.pdmodel.interactive.action PDActionGoTo setDestination

Introduction

In this page you can find the example usage for org.apache.pdfbox.pdmodel.interactive.action PDActionGoTo setDestination.

Prototype

public void setDestination(PDDestination d) 

Source Link

Document

This will set the destination to jump to.

Usage

From source file:org.pdfsam.pdfbox.component.PDFBoxOutlineUtilsTest.java

License:Open Source License

@Test
public void toPageDestinationAction() {
    PDPageFitDestination destination = new PDPageFitDestination();
    destination.setPageNumber(5);/* w  w w.j  a v  a  2 s  . c  om*/
    PDActionGoTo action = new PDActionGoTo();
    action.setDestination(destination);
    PDOutlineItem victim = new PDOutlineItem();
    victim.setAction(action);
    assertEquals(5, PDFBoxOutlineUtils.toPageDestination(victim, null).get().getPageNumber());
}