Skip to main content

FitDestination Class

A destination that displays the entire page in the document window.

Declaration

public class FitDestination extends Destination

Remarks

  1. Create a GoToAction object.
  2. Create a FitDestination and pass it to the setDestination(Destination value) method.
  3. Call the setPage(Page value) method to specify the destination page.
  4. Assign the GoToAction object to the annotation.

The following code snippet creates a link annotation that opens the specified page in the current document:

void createGoToActionLinkAnnotation(Page page, Page destinationPage) {
    // Add link text.
    float textX = 50;
    float textY = 700;
    TextFragment textFragment = new TextFragment() {{
        setText("Learn More");
        setLocation(new PointF(textX, textY));
    }};
    page.getFragments().add(textFragment);

    // Create a link annotation.
    float textWidth = textFragment.measure().getSize().getWidth();
    float textHeight = textFragment.measure().getSize().getHeight();
    float offset = 10;

    LinkAnnotation link = new LinkAnnotation(new RectangleF(
            textX - offset,
            textY - offset,
            textWidth + offset * 2,
            textHeight + offset * 2));

    GoToAction action = new GoToAction();
    action.setDestination(new FitDestination());
    action.setPage(destinationPage);

    link.setAction(action);
    link.setHighlightingMode(AnnotationHighlightingMode.PUSH);

    page.getAnnotations().add(link);
}

Refer to the following help topic for additional information: Document Navigation Annotations.

Inherited Members

com.devexpress.system.JavaObject.clone()
com.devexpress.system.JavaObject.equals(java.lang.Object)
com.devexpress.system.JavaObject.hashCode()
com.devexpress.system.JavaObject.initFields()
com.devexpress.system.JavaObject.memberwiseClone()
com.devexpress.system.JavaObject.toString()
java.lang.Object.finalize()
java.lang.Object.getClass()
java.lang.Object.notify()
java.lang.Object.notifyAll()
java.lang.Object.wait()
java.lang.Object.wait(long)
java.lang.Object.wait(long,int)

Inheritance

Object
JavaObject
Destination
FitDestination

FitDestination()

Initializes a new instance of the FitDestination class.

Declaration

public FitDestination()