Class LinkAnnotation

  • All Implemented Interfaces:

    
    public class LinkAnnotation
    extends Annotation
                        

    Link type of annotation either carrying an URI or a page destination.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      LinkAnnotation(AnnotationPropertyManager properties, boolean markDirty)
      LinkAnnotation(int pageIndex) Creates new link annotation.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      AnnotationType getType() Gets the annotation type of the annotation.
      void updateTransformationProperties(@NonNull() RectF newBoundingBox, @NonNull() RectF oldBoundingBox) Annotations may override this method to transform their properties (i.e.
      Action getAction() Returns the action set on this annotation.
      void setAction(@Nullable() Action action) Sets the action to the annotation.
      void setFillColor(int color) Note that this property does not affect LinkAnnotations as this type of annotation does not render any appearance.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LinkAnnotation

        LinkAnnotation(AnnotationPropertyManager properties, boolean markDirty)
      • LinkAnnotation

        LinkAnnotation(int pageIndex)
        Creates new link annotation.
        Parameters:
        pageIndex - Page index to attach the link annotation to.
    • Method Detail

      • getType

        @NonNull() AnnotationType getType()

        Gets the annotation type of the annotation.

        Returns:

        The type of the annotation. Makes down casting easier.

      • updateTransformationProperties

         void updateTransformationProperties(@NonNull() RectF newBoundingBox, @NonNull() RectF oldBoundingBox)

        Annotations may override this method to transform their properties (i.e. points, rects, sizes) whenever the bounding box of the annotation changed.

        Parameters:
        newBoundingBox - New bounding box of the annotation (in PDF points).
        oldBoundingBox - Old bounding box of the annotation (in PDF points).
      • getAction

        @Nullable() Action getAction()

        Returns the action set on this annotation.

        Returns:

        Action to be performed once this annotation is tapped.

      • setAction

         void setAction(@Nullable() Action action)

        Sets the action to the annotation.

        Parameters:
        action - Action to be executed when the annotation is tapped, null to remove action.
      • setFillColor

         void setFillColor(int color)

        Note that this property does not affect LinkAnnotations as this type of annotation does not render any appearance. They are created only as interactive, transparent bounding boxes.

        Parameters:
        color - The annotation color or Color#TRANSPARENT to clear the field.