java.lang.Object | |||
↳ | com.pspdfkit.annotations.Annotation | ||
↳ | com.pspdfkit.annotations.LinkAnnotation | ||
↳ | com.pspdfkit.annotations.WidgetAnnotation |
Represents the appearance of a field in interactive forms. For form elements with text, the text
color comes from the color property of Annotation
. Use getFormElement()
to
access associated FormElement
.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
float | FONT_SIZE_AUTO | The font size value used by setFontSize(float) and getFontSize() to
represent automatic font sizing of text form elements. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Action |
getAdditionalAction(AnnotationTriggerEvent triggerEvent)
Returns the action that should be executed on annotation trigger event.
| ||||||||||
Map<AnnotationTriggerEvent, Action> |
getAdditionalActions()
Returns a map of additional actions keyed by their trigger events.
| ||||||||||
int |
getBorderColor()
Returns the border color of this annotation or
Color#TRANSPARENT if no color is set. | ||||||||||
float |
getFontSize()
Returns the font size of this widget annotation in PDF points.
| ||||||||||
FormElement |
getFormElement()
Returns a form element for widget annotation.
| ||||||||||
Maybe<FormElement> |
getFormElementAsync()
Returns a form element for widget annotation, asynchronously.
| ||||||||||
AnnotationType |
getType()
Gets the annotation type of the annotation.
| ||||||||||
VerticalTextAlignment |
getVerticalTextAlignment()
Returns the vertical text alignment used by this widget annotation.
| ||||||||||
void |
setAdditionalAction(AnnotationTriggerEvent triggerEvent, Action action)
Sets the action that should be executed for the given annotation trigger event.
| ||||||||||
void |
setBorderColor(int color)
Sets the border color for this annotation.
| ||||||||||
void |
setFontSize(float fontSize)
Sets the font size for this widget annotation in PDF points.
| ||||||||||
void |
setVerticalTextAlignment(VerticalTextAlignment verticalAlignment)
Sets the vertical text alignment to use in this widget annotation.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
The font size value used by setFontSize(float)
and getFontSize()
to
represent automatic font sizing of text form elements. If set, PSPDFKit will automatically
grow and shrink the content of the form element to fit the annotation's bounding box.
Returns the action that should be executed on annotation trigger event.
Returns a map of additional actions keyed by their trigger events.
null
if no additional actions are set.
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.
Color#TRANSPARENT
if no color is set.
Returns the font size of this widget annotation in PDF points. If set to FONT_SIZE_AUTO
, PSPDFKit will automatically adjust the font size of the annotation, so that
the content fills the bounding box.
FONT_SIZE_AUTO
if auto-sizing of
the annotation's content is enabled.Returns a form element for widget annotation.
Note: this call may block for a while and should not be invoked on the main thread.
Note: This call requires forms feature in your license.
null
if it doesn't exist.
Returns a form element for widget annotation, asynchronously.
Note: This call requires forms feature in your license.
FormElement
or just completing in case the form element is
null.
Gets the annotation type of the annotation.
Returns the vertical text alignment used by this widget annotation.
VerticalTextAlignment
.
Sets the action that should be executed for the given annotation trigger event.
triggerEvent | Event for which to set the action. |
---|---|
action | Action to be executed when triggerEvent occurs, null to remove
existing action.
|
Sets the border color for this annotation. Border color usually redirects to color, unless
overridden to have a real backing store (this is the case for WidgetAnnotation
).
Note: The annotation will only store the RGB part and discard the alpha channel
set here. Annotation opacity is set via the setAlpha(float)
property.
color | The border color or Color#TRANSPARENT to clear the field.
|
---|
Sets the font size for this widget annotation in PDF points. If set to FONT_SIZE_AUTO
, PSPDFKit will automatically adjust the font size of the widget annotation
so that its content fills the annotation's bounding box.
// Set a font size of 14 points to a widget annotation.
widgetAnnotation.setFontSize(14.0f);
// Enable auto-sizing of the annotation's content.
widgetAnnotation.setFontSize(WidgetAnnotation.FONT_SIZE_AUTO);
fontSize | The font size to set for this annotation. If set to FONT_SIZE_AUTO ,
PSPDFKit will enable automatic sizing of the content, to fill the bounding box of this
annotation. |
---|
Sets the vertical text alignment to use in this widget annotation. One of VerticalTextAlignment
.
verticalAlignment | The vertical alignment to use for the text of this widget annotation. |
---|