Package com.pspdfkit.annotations
Class LinkAnnotation
-
- All Implemented Interfaces:
public class LinkAnnotation extends Annotation
Link type of annotation either carrying an URI or a page destination.
-
-
Constructor Summary
Constructors Constructor Description LinkAnnotation(AnnotationPropertyManager properties, boolean markDirty)
LinkAnnotation(int pageIndex)
Creates new link annotation.
-
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. -
-
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 orColor#TRANSPARENT
to clear the field.
-
-
-
-