FreeTextAnnotation

Represents a free text annotation on the page. The annotation’s text color comes from the color property of Annotation.

Constructors

Link copied to clipboard
constructor(@IntRange(from = 0) pageIndex: Int, rect: RectF, contents: String?)

Creates a new FreeText annotation.

Types

Link copied to clipboard
object Companion

Constants for FreeTextAnnotation.

Link copied to clipboard

Possible styles of free text annotation.

Link copied to clipboard

Possible values for the alignment of the text.

Properties

Link copied to clipboard

The points used to describe the call out line.

Link copied to clipboard
open override var contents: String?

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.

Link copied to clipboard
open override var flags: EnumSet<AnnotationFlags>

Sets the annotation flags for this annotation. Since a FreeTextAnnotation with an intent of type FreeTextAnnotationIntent.FREE_TEXT_CALLOUT does not work with the AnnotationFlags.NOZOOM flag, we will remove it if it exists from the provided flags set.

Link copied to clipboard

Type (also called intent) of the free text annotation.

Link copied to clipboard
open override val isResizable: Boolean

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

Link copied to clipboard
open override val isUiRotationSupported: Boolean

Returns true if this Annotation can be rotated in the UI.

Link copied to clipboard

The line end for the call out line.

Link copied to clipboard
open override val minimumSize: Size

Returns the minimum size of the annotation.

Link copied to clipboard

The clockwise rotation of this free text annotation in degrees.

Link copied to clipboard

The insets that are applied to the text. This describes the offset of the inner rect containing the text, to the bounding box.

Link copied to clipboard

Text stroke color of this annotation. For the main text color use Annotation.color.

Link copied to clipboard
open override val type: AnnotationType

Gets the annotation type of the annotation.

Functions

Link copied to clipboard

This adjusts the annotations bounding box to the smallest possible size that will encompass the rotated annotations at it's default size.

Link copied to clipboard
open override fun getCopy(): FreeTextAnnotation

Gets a copy of this annotation with the page index and object number reset.

Link copied to clipboard

Places the callout points in the same way the UI will place them based on user interaction.

Link copied to clipboard
fun FreeTextAnnotation.resizeToFitText(document: PdfDocument, widthScaleMode: ScaleMode, heightScaleMode: ScaleMode)

Resizes this free text annotation so the text fits inside its bounds.

Link copied to clipboard
fun setRotation(rotation: Int, contentSize: Size, adjustBounds: Boolean)

Sets the rotation of this free text annotation.

Link copied to clipboard
open override fun updateTransformationProperties(newBoundingBox: RectF, oldBoundingBox: RectF)

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