[]
DsPdfJS API / WidgetAnnotation
Represents a widget annotation used in interactive forms to represent the appearance of fields and to manage user interactions.
new WidgetAnnotation(
om):WidgetAnnotation
Creates a new WidgetAnnotation.
ObjectManager that controls the lifetime of the WidgetAnnotation.
WidgetAnnotation
AnnotationBase.constructor
new WidgetAnnotation():
WidgetAnnotation
Creates a new WidgetAnnotation.
WidgetAnnotation
AnnotationBase.constructor
get activate():
ActionBase|null
Gets or sets an action to be performed when the annotation is activated.
ActionBase | null
set activate(
value):void
Gets or sets an action to be performed when the annotation is activated.
ActionProperties | ActionBase | null
void
get annotationPageClosed():
ActionBase|null
Gets or sets an action to be performed when the page containing the annotation is closed (for example, when the user navigates to the next or previous page, or follows a link annotation or outline item).
ActionBase | null
set annotationPageClosed(
value):void
Gets or sets an action to be performed when the page containing the annotation is closed (for example, when the user navigates to the next or previous page, or follows a link annotation or outline item).
ActionProperties | ActionBase | null
void
get annotationPageHide():
ActionBase|null
Gets or sets an action to be performed when the page containing the annotation is no longer visible in the viewer application's user interface.
ActionBase | null
set annotationPageHide(
value):void
Gets or sets an action to be performed when the page containing the annotation is no longer visible in the viewer application's user interface.
ActionProperties | ActionBase | null
void
get annotationPageOpened():
ActionBase|null
Gets or sets an action to be performed when the page containing the annotation is opened (for example, when the user navigates to it from the next or previous page or by means of a link annotation or outline item).
ActionBase | null
set annotationPageOpened(
value):void
Gets or sets an action to be performed when the page containing the annotation is opened (for example, when the user navigates to it from the next or previous page or by means of a link annotation or outline item).
ActionProperties | ActionBase | null
void
get annotationPageShow():
ActionBase|null
Gets or sets an action to be performed when the page containing the annotation becomes visible in the viewer application's user interface.
ActionBase | null
set annotationPageShow(
value):void
Gets or sets an action to be performed when the page containing the annotation becomes visible in the viewer application's user interface.
ActionProperties | ActionBase | null
void
get backColor():
Color
Gets or sets the annotation's background color.
set backColor(
value):void
Gets or sets the annotation's background color.
void
get border():
Border
Gets or sets the annotation border.
set border(
value):void
Gets or sets the annotation border.
BorderProperties | Border | null
void
get buttonAppearance():
ButtonAppearance
Gets the ButtonAppearance object that specifies the look of the widget if it is linked with a push button field.
get checkStyle():
CheckStyle|null
Gets or sets the style of check mark that is used if this WidgetAnnotation is linked with a CheckBoxField or a RadioButtonField.
Note that this property works over the 'buttonAppearance.Caption' property, for example if 'checkStyle' is "Cross", then 'buttonAppearance.Caption' will be "8".
If the value of this property is null, it indicates that ButtonAppearance.Caption contains an unknown value.
CheckStyle | null
set checkStyle(
value):void
Gets or sets the style of check mark that is used if this WidgetAnnotation is linked with a CheckBoxField or a RadioButtonField.
Note that this property works over the 'buttonAppearance.Caption' property, for example if 'checkStyle' is "Cross", then 'buttonAppearance.Caption' will be "8".
If the value of this property is null, it indicates that ButtonAppearance.Caption contains an unknown value.
void
get contents():
string|null
Gets or sets the text to be displayed for the annotation or, if this type of annotation does not display text, an alternate description of the annotation's contents in human-readable form. In either case, this text is useful when extracting the document's contents in support of accessibility to users with disabilities or for other purposes.
string | null
set contents(
value):void
Gets or sets the text to be displayed for the annotation or, if this type of annotation does not display text, an alternate description of the annotation's contents in human-readable form. In either case, this text is useful when extracting the document's contents in support of accessibility to users with disabilities or for other purposes.
string | null
void
get defaultAppearance():
DefaultAppearance
Gets the DefaultAppearance object that specifies the visual properties (font, font size etc.) used to format the content of this annotation.
get doc():
PdfDocument|null
Gets the PdfDocument owning this annotation.
PdfDocument | null
get enter():
ActionBase|null
Gets or sets an action to be performed when the annotation receives the input focus.
ActionBase | null
set enter(
value):void
Gets or sets an action to be performed when the annotation receives the input focus.
ActionProperties | ActionBase | null
void
get flags():
AnnotationFlags
Gets or sets the flags specifying various characteristics of the annotation.
set flags(
value):void
Gets or sets the flags specifying various characteristics of the annotation.
void
get highlighting():
HighlightingMode
Gets or sets the annotation's highlighting mode.
set highlighting(
value):void
Gets or sets the annotation's highlighting mode.
void
get id():
number
Gets the reference to the object.
number
get justification():
VariableTextJustification|null
Gets or sets the justification to be used in displaying the annotation's text. Note that if this property is not specified (the value is null) then Field#justification is used. See PDF specification for details.
VariableTextJustification | null
set justification(
value):void
Gets or sets the justification to be used in displaying the annotation's text. Note that if this property is not specified (the value is null) then Field#justification is used. See PDF specification for details.
VariableTextJustification | null
void
get leave():
ActionBase|null
Gets or sets an action to be performed when the annotation loses the input focus.
ActionBase | null
set leave(
value):void
Gets or sets an action to be performed when the annotation loses the input focus.
ActionProperties | ActionBase | null
void
get locked():
boolean
Gets or sets a value indicating whether the annotation can be deleted or its properties (including position and size) can be modified by the user. However, this flag does not restrict changes to the annotation's contents, such as the value of a form field.
boolean
set locked(
value):void
Gets or sets a value indicating whether the annotation can be deleted or its properties (including position and size) can be modified by the user. However, this flag does not restrict changes to the annotation's contents, such as the value of a form field.
boolean
void
get lockedContents():
boolean
Gets or sets a value indicating whether the contents of the annotation can be modified by the user. This flag does not restrict deletion of the annotation or changes to other annotation properties, such as position and size.
boolean
set lockedContents(
value):void
Gets or sets a value indicating whether the contents of the annotation can be modified by the user. This flag does not restrict deletion of the annotation or changes to other annotation properties, such as position and size.
boolean
void
get modifiedDate():
PdfDateTime|null
Gets or sets the date and time when the annotation was modified.
PdfDateTime | null
set modifiedDate(
value):void
Gets or sets the date and time when the annotation was modified.
PdfDateTime | null
void
get mouseDown():
ActionBase|null
Gets or sets an action to be performed when the mouse button is pressed inside the field's active area.
ActionBase | null
set mouseDown(
value):void
Gets or sets an action to be performed when the mouse button is pressed inside the field's active area.
ActionProperties | ActionBase | null
void
get mouseEnter():
ActionBase|null
Gets or sets an action to be performed when the mouse enters the field's active area.
ActionBase | null
set mouseEnter(
value):void
Gets or sets an action to be performed when the mouse enters the field's active area.
ActionProperties | ActionBase | null
void
get mouseLeave():
ActionBase|null
Gets or sets an action to be performed when the cursor exits the field's active area.
ActionBase | null
set mouseLeave(
value):void
Gets or sets an action to be performed when the cursor exits the field's active area.
ActionProperties | ActionBase | null
void
get mouseUp():
ActionBase|null
Gets or sets an action to be performed when the mouse button is released inside the field's active area.
ActionBase | null
set mouseUp(
value):void
Gets or sets an action to be performed when the mouse button is released inside the field's active area.
ActionProperties | ActionBase | null
void
get name():
string|null
Gets or sets the name of the annotation. If WidgetAnnotation is used with RadioButtonField then name is used as a value.
string | null
set name(
value):void
Gets or sets the name of the annotation. If WidgetAnnotation is used with RadioButtonField then name is used as a value.
string | null
void
get om():
ObjectManager
Gets the owner ObjectManager instance.
get page():
PdfPage|null
Gets or sets the PdfPage that contains this annotation. Note that an annotation may be referenced by several pages. In that case this property returns the first element in the pages collection. When setting this property, the following applies: If the new value is null, this annotation is removed from all pages. Otherwise, this annotation is assigned exclusively to the specified page.
PdfPage | null
set page(
value):void
Gets or sets the PdfPage that contains this annotation. Note that an annotation may be referenced by several pages. In that case this property returns the first element in the pages collection. When setting this property, the following applies: If the new value is null, this annotation is removed from all pages. Otherwise, this annotation is assigned exclusively to the specified page.
PdfPage | null
void
get pages():
AnnotationPagesCollection
Gets the list of pages that reference this annotation.
get pdfRect():
Rect
Gets or sets the rectangle that defines the location and size of the annotation on a page in PDF user space coordinates. The positive X axis extends horizontally to the right, and the positive Y axis extends vertically upward, with the origin usually in the lower left corner of the page.
set pdfRect(
value):void
Gets or sets the rectangle that defines the location and size of the annotation on a page in PDF user space coordinates. The positive X axis extends horizontally to the right, and the positive Y axis extends vertically upward, with the origin usually in the lower left corner of the page.
void
get rect():
Rect
Gets or sets the rectangle that defines the location and size of the annotation on a page. The coordinates of the rectangle are relative to the upper left corner of the page's media box, with the Y (vertical) coordinates increasing from top to bottom. Note that if the annotation is associated with more than one page, the media box of the first of those pages is used to calculate the rectangle's location.
set rect(
value):void
Gets or sets the rectangle that defines the location and size of the annotation on a page. The coordinates of the rectangle are relative to the upper left corner of the page's media box, with the Y (vertical) coordinates increasing from top to bottom. Note that if the annotation is associated with more than one page, the media box of the first of those pages is used to calculate the rectangle's location.
void
get rotationAngle():
number
Gets or sets the angle, in degrees, by which the widget annotation is rotated counterclockwise relative to the page. The value must be a multiple of 90.
number
set rotationAngle(
value):void
Gets or sets the angle, in degrees, by which the widget annotation is rotated counterclockwise relative to the page. The value must be a multiple of 90.
number
void
free():
void
Detaches the object from the ObjectManager and deallocates its memory, if possible.
void
rebind(
omTo):void
Rebinds the object from the current ObjectManager to the specified one.
The new ObjectManager for the object.
void
removeAppearance():
void
Removes all appearance streams associated with the current annotation, and disables generation of appearance steams for this annotation when the document is saved.
Note that if any property affecting the annotation's appearance 'rect' is then changed, the appearance streams will be regenerated. So this method would usually be called after initializing all annotation's properties.
void
AnnotationBase.removeAppearance
resetAppearance():
void
Forces regeneration of the annotation's appearance streams next time the document is saved.
void