FoxitPDFSDKforWeb v10.0.0
Foxit PDF SDK for Web
Widget Class Reference

Widget annot. More...

Inheritance diagram for Widget:
Annot

Public Member Functions

 getAction ()
 Get widget's action. More...
 
 getAdditionalAction (type)
 Get widget's additional action. More...
 
 getControl ()
 Get form control of this widget. More...
 
 getField ()
 Get field object to which current widget belongs. More...
 
 getMKProperty (key)
 Get widget's MK property. More...
 
 setAdditionalAction (trigger, action)
 Set widget's additional action. More...
 
 setMKProperty (key, value)
 Set widget's MK property. More...
 
- Public Member Functions inherited from Annot
 exportToJSON ()
 Export the current annotation to a Json object. [Support in Server] More...
 
 getBorderColor ()
 Get annotation's border color. [Support in Server] More...
 
 getBorderInfo ()
 Get annotation's border information. [Support in Server] More...
 
 getContent ()
 Get annotation's contents. [Support in Server] More...
 
 getDictionaryEntry (key)
 Get the dictionary property of Annot by key. More...
 
 getFlags ()
 Get annotation's flag. [Support in Server] More...
 
 getModifiedDateTime ()
 Get annotation's last modified date time. [Support in Server] More...
 
 getObjectNumber ()
 Get annotation's object number. More...
 
 getPage ()
 Get annotation's page. [Support in Server] More...
 
 getRect ()
 Get annotation's rect. [Support in Server] More...
 
 getTitle ()
 Get annotation's title. [Support in Server] More...
 
 getType ()
 Get annotation's type. [Support in Server] More...
 
 getUniqueID ()
 Get annotation's unique ID. [Support in Server] More...
 
 isEmpty ()
 Check annotation is empty or not. [Support in Server] More...
 
 isMarkup ()
 Check if current annotation is a markup annotation. [Support in Server] More...
 
 setBorderColor (borderColor)
 Set annotation's border color. [Support in Server] More...
 
 setBorderInfo (borderInfo)
 Set annotation's border information. [Support in Server] More...
 
 setContent (content)
 Set contents for the currently gotten annotation. [Support in Server] More...
 
 setCustomAPStream (appearanceType, appearanceStream)
 
 setDictionaryEntry (key, value)
 Add a new entry or replace the existing entry of the annotation dictionary. Caller could use this method to store their private data to the annotation. Do not use any standard key of the annotation dictionary, such as 'Type', 'Subtype', 'Rect' defined in PDF Reference. If any standard key is used, this behaviour will be undefined. More...
 
 setFlags (flag, notTriggerEvent)
 Set annotation's flag. [Support in Server] More...
 
 setModifiedDateTime (date)
 Set annotation's last modified date time. [Support in Server] More...
 
 setRect (rect)
 Set annotation's rect. More...
 

Detailed Description

Widget annot.

Since
7.5.0

Member Function Documentation

◆ getAction()

Widget::getAction ( )
inline

Get widget's action.

Returns
Action - Action of widget.

◆ getAdditionalAction()

Widget::getAdditionalAction (   type)
inline

Get widget's additional action.

Parameters
typenumber - Action type. Please refer to Action_Trigger
Returns
Action - Action object.

◆ getControl()

Widget::getControl ( )
inline

Get form control of this widget.

Returns
PDFControl - Form control.

◆ getField()

Widget::getField ( )
inline

Get field object to which current widget belongs.

Returns
PDFField - PDFField object.

◆ getMKProperty()

Widget::getMKProperty (   key)
inline

Get widget's MK property.

Note
Border color in MK is override Annot::getBorderColor;
Parameters
keystring - Key of MK property. Please refer to MK_Properties.
Returns
number|string - MK property value. Data type of value is dependent on MK property:
number for borderColor;
number for fillColor;
string for normalCaption;
let widget = control.getWidgetAnnot();
let borderColor = widget.getMKProperty('borderColor')
let fillColor = widget.getMKProperty('fillColor')
let normalCaption = widget.getMKProperty('normalCaption')

◆ setAdditionalAction()

Widget::setAdditionalAction (   trigger,
  action 
)
inline

Set widget's additional action.

Parameters
triggernumber - The trigger of action. Please refer to Action_Trigger.
actionAction - Action or string. If it is a string, it must be valid JavaScript..
Returns
Promise<void>

◆ setMKProperty()

Widget::setMKProperty (   key,
  value 
)
inline

Set widget's MK property.

Note
Border color in MK is override Annot::setBorderColor;
Parameters
keystring - Key of MK property. Please refer to MK_Properties.
valuenumber|string - Value of MK property. Data type of value is dependent on MK property: number for borderColor and fillColor,string for normalCaption.
let widget = control.getWidgetAnnot();
widget.setMKProperty('borderColor',0xffff0000)

Foxit Software Corporation Logo
@2024 Foxit Software Incorporated. All rights reserved.