Annotation
Represents a generic annotation in the PDF document.
Inheritors
Types
Companion object containing constants and utility methods for Annotation.
Properties
Returns the annotation's main alpha (or stroke alpha). For annotations that also have a fill colour, such as shapes, this is the border/line alpha.
Returns custom appearance stream generator that overrides appearance stream generation of this annotation.
Returns currently set blend mode. Defaults to BlendMode.NORMAL for all annotations except highlight.
Returns the border color of this annotation or Color.TRANSPARENT if no color is set. Note that alpha channel is not taken into account as per PDF specifications.
Returns currently set dash array or null if no pattern is set.
Returns the current border effect on the annotation or BorderEffect.NO_EFFECT if none is set.
Returns the current border effect intensity. Valid only if the border effect is BorderEffect.CLOUDY. The value is suggested to be between 0 and 2 but other values are valid as well. Default value is 0.
Returns the current border style on the annotation or BorderStyle.NONE if none is set.
Returns the border line width / thickness. For border to appear, color and style should be set via borderColor and borderStyle as well.
Position of this annotation on the page. The returned RectF is a copy, so changing its values won't update the annotation's bounds. Instead call boundingBox providing the altered rect to update the annotation.
Returns a color associated with this annotation or Color.TRANSPARENT if no color is set. Note that alpha channel is not taken into account as per PDF specifications. This is the text color for FreeTextAnnotation and WidgetAnnotation. This is the stroke color for shapes.
Returns the creation date of the annotation.
Sets custom data to the annotation. The contents of this property are saved to the document when saving.
Returns the fill alpha.
Returns a fill color associated with this object or Color.TRANSPARENT if no color is set. Note that alpha channel is not taken into account as per PDF specifications.
Check if the annotation has locked contents - i.e. annotation content can't be modified.
Gets instant record group of the annotation, or null if this annotation is detached.
Tells whether this annotation is attached to a document.
Returns true when the annotation is a measurement annotation. Measurement annotations can be:
Returns whether the annotation is modified or not.
Check if the annotation is resizable, or if this is a non-resizable annotation.
Returns true when the annotation is a signature annotation. Annotations that can be signatures are InkAnnotation and StampAnnotation.
Returns true if this Annotation can be rotated in the UI.
Returns MeasurementInfo when the annotation is a measurement annotation (see isMeasurement), null if not.
Returns the minimum size of the annotation.
Returns the date when this annotation was last modified.
The object number of this annotation inside the PDF document file. This method will only return a valid object number if this annotation is attached to a document (i.e. when isAttached returns true). If the annotation is not attached to any document, this method will return Annotation.OBJECT_NUMBER_NOT_SET.
The page number to which this annotation belongs. If the annotation is not attached to any document, this method will return Annotation.PAGE_NUMBER_NOT_SET.
Returns/sets the text justification used by this free text annotation.
Returns/sets the vertical text alignment used by this free text annotation.
Functions
Attaches a binary instant JSON attachment to the annotation. Can later be fetched using fetchBinaryInstantJsonAttachment.
Creates TextBlock from textual annotation.
If this annotation has a binary instant JSON attachment, this will write it into the provided OutputStream.
Regenerates the annotation's appearance stream if necessary.
Regenerates the annotation's appearance stream if necessary.
Position of this annotation on the page. Changing bounding box does not change annotations bounds. Instead call boundingBox to change annotation bounds.
Creates a copy of this annotation that isn't attached to the document with the page index set to given index. If this type of annotation can't be copied this method will return null.
Retrieves the annotation this annotation replies to, or null it this annotation is not a reply or the license doesn't support replies feature.
Retrieves the annotation this annotation replies to asynchronously. The response is emitted inside the RxJava's Maybe. It will contain the requested annotation if it exists, or be empty otherwise.
Checks if this annotation has a binary instant JSON attachment. For example, a stamp annotation with an image has one.
Checks if this annotation has the same properties as another annotation, excluding identity properties like UUID, modified date, and name. This is useful for comparing annotations based on their visual and semantic content rather than their identity.
Renders the appearance of this annotation into the passed bitmap.
Asynchronously renders the appearance of this annotation into the passed bitmap.
Sets the annotation that this annotation replies to.
Produces Instant JSON representation 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.