java.lang.Object | ||
↳ | com.pspdfkit.annotations.Annotation | |
↳ | com.pspdfkit.annotations.FreeTextAnnotation |
Represents a free text annotation on the page. The annotation’s text color comes from the color
property of Annotation
.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
enum | FreeTextAnnotation.FreeTextAnnotationIntent | Possible styles of free text annotation. | |||||||||
enum | FreeTextAnnotation.FreeTextTextJustification | Possible values for the alignment of the text. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
FreeTextAnnotation(int pageIndex, RectF rect, String contents)
Creates a new FreeText annotation.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
adjustBoundsForRotation()
This adjusts the annotations bounding box to the smallest possible size that will encompass
the rotated annotations at it's default size.
| ||||||||||
List<PointF> |
getCallOutPoints()
Gets the points used to describe the call out line.
| ||||||||||
String |
getContents()
Returns text contents of the annotation.
| ||||||||||
String |
getFontName()
Gets the font name set for usage with this
FreeTextAnnotation . | ||||||||||
FreeTextAnnotation.FreeTextAnnotationIntent |
getIntent()
Returns type (also called intent) of the free text annotation.
| ||||||||||
LineEndType |
getLineEnd()
The line end for the call out line.
| ||||||||||
Size |
getMinimumSize()
Returns the minimum size of the annotation.
| ||||||||||
int |
getRotation()
Returns the clockwise rotation of this free text annotation in degrees.
| ||||||||||
EdgeInsets |
getTextInsets()
Gets the insets that are applied to the text.
| ||||||||||
FreeTextAnnotation.FreeTextTextJustification |
getTextJustification()
Returns the text justification used by this free text annotation.
| ||||||||||
float |
getTextSize()
Returns the text size set to this annotation.
| ||||||||||
int |
getTextStrokeColor()
Returns text stroke color of this annotation.
| ||||||||||
AnnotationType |
getType()
Gets the annotation type of the annotation.
| ||||||||||
VerticalTextAlignment |
getVerticalTextAlignment()
Returns the vertical text alignment used by this free text annotation.
| ||||||||||
boolean |
isResizable()
Check if the annotation is resizable, or if this is a non-resizable annotation.
| ||||||||||
void |
setCallOutPoints(List<PointF> points)
Sets the call out points for this free text annotation.
| ||||||||||
void |
setContents(String contents)
Sets text contents of the annotation.
| ||||||||||
void |
setFontName(String fontName)
Sets the font name to be used by this
FreeTextAnnotation . | ||||||||||
void |
setIntent(FreeTextAnnotation.FreeTextAnnotationIntent intent)
Sets the type (also called intent) of the free text annotations.
| ||||||||||
void |
setLineEnd(LineEndType lineEnd)
Sets the line end for the call out line.
| ||||||||||
void |
setRotation(int rotation, boolean adjustBounds)
Sets the rotation of this free text annotation.
| ||||||||||
void |
setRotation(int rotation, Size contentSize)
Sets the rotation of this free text annotation.
| ||||||||||
void |
setRotation(int rotation, Size contentSize, boolean adjustBounds)
Sets the rotation of this free text annotation.
| ||||||||||
void |
setRotation(int rotation)
Sets the rotation of this free text annotation.
| ||||||||||
void |
setTextInsets(EdgeInsets edgeInsets)
Sets the insets that are applied to the text.
| ||||||||||
void |
setTextJustification(FreeTextAnnotation.FreeTextTextJustification justification)
Sets the text justification to use.
| ||||||||||
void |
setTextSize(float textSize)
Sets the text size of this annotation.
| ||||||||||
void |
setTextStrokeColor(int color)
Sets the color of annotations text stroke.
| ||||||||||
void |
setVerticalTextAlignment(VerticalTextAlignment verticalAlignment)
Sets the vertical text alignment to use.
| ||||||||||
void |
updateTransformationProperties(RectF newBoundingBox, RectF oldBoundingBox)
Annotations may override this method to transform their properties (i.e.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Creates a new FreeText annotation.
pageIndex | Page to which this annotation will be attached to. |
---|---|
rect | Bounding rectangle for this annotation's text. |
contents | Text of the annotation. |
This adjusts the annotations bounding box to the smallest possible size that will encompass the rotated annotations at it's default size.
Gets the points used to describe the call out line.
Returns text contents of the annotation. This is usually the displayed text for annotations that display text or accessibility label for annotations that don't.
null
if it's not set.
Gets the font name set for usage with this FreeTextAnnotation
.
FreeTextAnnotation
or null if no
custom font is set.
Returns type (also called intent) of the free text annotation.
FreeTextAnnotation.FreeTextAnnotationIntent
.
The line end for the call out line.
Returns the minimum size of the annotation.
Returns the clockwise rotation of this free text annotation in degrees.
Gets the insets that are applied to the text. This describes the offset of the inner rect containing the text, to the bounding box.
Returns the text justification used by this free text annotation.
Returns the text size set to this annotation.
Returns text stroke color of this annotation. For the main text color use getColor()
.
0
if no color was set.
Gets the annotation type of the annotation.
Returns the vertical text alignment used by this free text annotation.
VerticalTextAlignment
.
Check if the annotation is resizable, or if this is a non-resizable annotation.
true
if the annotation can be resized (e.g. ink annotation) or false
if it is a non-resizable one (e.g. note annotation).
Sets the call out points for this free text annotation. This needs to be either 2 or 3 points, with the first point also having a line end.
points | The points for the call out line. |
---|
Sets text contents of the annotation. This is usually the displayed text for annotations that display text or accessibility label for annotations that don't.
contents | Contents string or null to clear the field.
|
---|
Sets the font name to be used by this FreeTextAnnotation
.
fontName | The name of the font family to use, shouldn't include font weight e.g. 'Roboto' not 'Roboto-Thin'. |
---|
Sets the type (also called intent) of the free text annotations.
intent | One of FreeTextAnnotation.FreeTextAnnotationIntent .
|
---|
Sets the line end for the call out line.
lineEnd | One of LineEndType .
|
---|
Sets the rotation of this free text annotation.
See also adjustBoundsForRotation()
rotation | The clockwise rotation in degrees. |
---|---|
adjustBounds | If true will also adjust the bounding box to match the new
rotation.
|
Sets the rotation of this free text annotation. This will adjust the bounding box so rotating the annotation will cause the bounds to change.
See also setRotation(int)
. See also setRotation(int, Size, boolean)
.
rotation | The clockwise rotation in degrees. |
---|---|
contentSize | The size of the annotation content, it will be rotated and scaled to fit inside the actual bounding box. |
Sets the rotation of this free text annotation.
See also adjustBoundsForRotation()
.
rotation | The clockwise rotation in degrees. |
---|---|
contentSize | The size of the annotation content, it will be rotated and scaled to fit inside the actual bounding box. |
adjustBounds | If true will also adjust the bounding box to match the new
rotation.
|
Sets the rotation of this free text annotation. This will adjust the bounding box so rotating the annotation will cause the bounds to change.
See also setRotation(int, Size)
. See also setRotation(int, boolean)
.
rotation | The clockwise rotation in degrees. |
---|
Sets the insets that are applied to the text.
edgeInsets | The amount to inset the text in the bounding box. |
---|
Sets the text justification to use. One of FreeTextAnnotation.FreeTextTextJustification
.
justification | The justification to use for text of this annotation. |
---|
Sets the text size of this annotation.
textSize | Text size to be set (in PDF points). |
---|
Sets the color of annotations text stroke. For the main text color use setColor(int)
.
color | Text stroke color of this annotation or 0 to clear the value.
|
---|
Sets the vertical text alignment to use. One of VerticalTextAlignment
.
verticalAlignment | The vertical alignment to use for the text of this annotation. |
---|
Annotations may override this method to transform their properties (i.e. points, rects, sizes) whenever the bounding box of the annotation changed.
newBoundingBox | New bounding box of the annotation (in PDF points). |
---|---|
oldBoundingBox | Old bounding box of the annotation (in PDF points). |