public class

FileAnnotation

extends Annotation
java.lang.Object
   ↳ com.pspdfkit.annotations.Annotation
     ↳ com.pspdfkit.annotations.FileAnnotation

Class Overview

Represents an annotation associated with EmbeddedFile.

Summary

Nested Classes
@interface FileAnnotation.IconName Denotes that a parameter must belong to on of these strings defined in FileAnnotation: PUSH_PIN, PAPERCLIP, GRAPH, TAG
Constants
String GRAPH
String PAPERCLIP
String PUSH_PIN
String TAG
[Expand]
Inherited Constants
From class com.pspdfkit.annotations.Annotation
[Expand]
Inherited Fields
From class com.pspdfkit.annotations.Annotation
Public Constructors
FileAnnotation(int pageIndex, RectF boundingBox, EmbeddedFileSource embeddedFileSource)
Creates a new file annotation.
Public Methods
EmbeddedFile getFile()
Returns a file set for this annotation.
String getIconName()
Returns the name of the icon that should be displayed for this annotation.
AnnotationType getType()
Gets the annotation type of the annotation.
boolean isLocked()
Check if the annotation is locked - i.e.
boolean isResizable()
Check if the annotation is resizable, or if this is a non-resizable annotation.
void setFileSource(EmbeddedFileSource fileSource)
Replaces an embedded file associated with this annotation.
void setIconName(String iconName)
Sets the name of the icon that should be displayed for this annotation.
void updateTransformationProperties(RectF newBoundingBox, RectF oldBoundingBox)
Annotations may override this method to transform their properties (i.e.
[Expand]
Inherited Methods
From class com.pspdfkit.annotations.Annotation
From class java.lang.Object

Constants

public static final String GRAPH

Constant Value: "Graph"

public static final String PAPERCLIP

Constant Value: "Paperclip"

public static final String PUSH_PIN

Constant Value: "PushPin"

public static final String TAG

Constant Value: "Tag"

Public Constructors

public 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.

Public Methods

public 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.

public String getIconName ()

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

Returns
  • Icon name, {@value PUSH_PIN} by default.

public AnnotationType getType ()

Gets the annotation type of the annotation.

Returns
  • The type of the annotation. Makes down casting easier.

public 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.

public 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).

public void setFileSource (EmbeddedFileSource fileSource)

Replaces an embedded file associated with this annotation.

Parameters
fileSource Source for the embedded file data.

public void setIconName (String iconName)

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

Parameters
iconName Icon name to be set.

public void updateTransformationProperties (RectF newBoundingBox, 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).