Class FileAnnotation

    • Constructor Detail

      • FileAnnotation

        FileAnnotation(int pageIndex, RectF boundingBox, EmbeddedFileSource embeddedFileSource)
        Creates a new file annotation.
        Parameters:
        pageIndex - Page to which this annotation will be attached to.
        boundingBox - Annotation's bounding box on the page in PDF coordinates.
        embeddedFileSource - Source of the file data that should be attached to the annotation.
      • FileAnnotation

        FileAnnotation(AnnotationPropertyMap properties, boolean markDirty, String resourceId)
        Intended for internal usage only.
    • Method Detail

      • getIconName

        @NonNull() String getIconName()

        Returns the name of the icon that should be displayed for this annotation.

        Returns:

        Icon name, {@value PUSH_PIN} by default.

      • getFile

        @Nullable() EmbeddedFile getFile()

        Returns a file set for this annotation.

        Returns:

        Embedded file associated with this annotation or null if no embedded file is currently set.

      • setFileSource

         void setFileSource(@NonNull() EmbeddedFileSource fileSource)

        Replaces an embedded file associated with this annotation.

        Parameters:
        fileSource - Source for the embedded file data.
      • 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).
      • isResizable

         boolean isResizable()

        Check if the annotation is resizable, or if this is a non-resizable annotation.

        Returns:

        true if the annotation can be resized (e.g. ink annotation) or false if it is a non-resizable one (e.g. note annotation).

      • isLocked

         boolean isLocked()

        Check if the annotation is locked - i.e. annotation can't be deleted or modified (except contents).

        Returns:

        true if the annotation is locked or false if it can be freely modified.