FoxitPDFSDKforWeb  7.1.1
Foxit PDF SDK for Web
PDFField Class Reference

Public Member Functions

 getAlignment ()
 Get field's alignment. More...
 
 getBorderColor ()
 Get field's border color. More...
 
 getBorderStyle ()
 Get field's border style. More...
 
 getFillColor ()
 Get field's fill color. More...
 
 getFlags ()
 Get field's flags. For more information, refer to Field_Flag. More...
 
 getMaxLength ()
 Get text field's max length. More...
 
 getName ()
 Get form field's name(aka title). More...
 
 getOptions ()
 Set combo box and list box's options. More...
 
 getType ()
 Get form field's type. More...
 
 getValue ()
 Get field value. More...
 
 setAction (type, data)
 Set field's action. More...
 
 setAlignment (alignment)
 Set field's alignment(Not support signature field). More...
 
 setBorderColor (borderColor)
 Set field's border color(Not support signature field). More...
 
 setBorderStyle (strStyle)
 Set field's border style(Not support signature field). More...
 
 setFillColor (fillColor)
 Set field's fillcolor(Not support signature field). More...
 
 setMaxLength (maxLength)
 Set text field's max length. More...
 
 setOptions (options)
 Set options(items) of list box or combo box. More...
 
 setValue (value='', control=null)
 Set field's value. More...
 

Detailed Description

PDF Form Field object

Since
7.1.0

Member Function Documentation

◆ getAlignment()

PDFField::getAlignment ( )
inline

Get field's alignment.

Returns
{number} - The alignment value. one of:
0: left alignment,
1: center alignment,
2: right alignment,

◆ getBorderColor()

PDFField::getBorderColor ( )
inline

Get field's border color.

Note
Load all relative annotations before call this function, or wrong value will return.
Returns
{number} - An interge indecated border color will be returned.

◆ getBorderStyle()

PDFField::getBorderStyle ( )
inline

Get field's border style.

Note
Load all relative annotations before call this function, or wrong value will be returned.
Returns
{string} - Border style, should be one of 'solid','dashed','inset','beveled','underline'. Nothing will be done with invalid string

◆ getFillColor()

PDFField::getFillColor ( )
inline

Get field's fill color.

Note
Load all relative annotations before call this function, or wrong value will return.
Returns
{number} - An interge indecated border color will be returned.

◆ getFlags()

PDFField::getFlags ( )
inline

Get field's flags. For more information, refer to Field_Flag.

Returns
{number} - Field's flags.

◆ getMaxLength()

PDFField::getMaxLength ( )
inline

Get text field's max length.

Returns
{Array[string]} - Field's max length.

◆ getName()

PDFField::getName ( )
inline

Get form field's name(aka title).

Returns
{string} - Form field's name

◆ getOptions()

PDFField::getOptions ( )
inline

Set combo box and list box's options.

Returns
{Array[string]} - Field's options array. Such as:
[
{
lable:"lable0",
value:"value0"
},{
lable:"lable1",
value:"value1"
},
...
]

◆ getType()

PDFField::getType ( )
inline

Get form field's type.

Returns
{number} - Form field's type. Please refer to Field_Type

◆ getValue()

PDFField::getValue ( )
inline

Get field value.

Returns
{string} - Field's value

◆ setAction()

PDFField::setAction (   type,
  data 
)
inline

Set field's action.

Note
Load all relative annotations before call this function, or nothing will be done.
Parameters
type{number} - The type of action. Currently only -1 which represend java script action is valid.
data{string|*} - The type of action. For java script action, it should be a string object.

◆ setAlignment()

PDFField::setAlignment (   alignment)
inline

Set field's alignment(Not support signature field).

Parameters
alignment{number} - Alignment.
0: left alignment,
1: center alignment,
2: right alignment,

◆ setBorderColor()

PDFField::setBorderColor (   borderColor)
inline

Set field's border color(Not support signature field).

Note
Load all relative annotations before call this function, or wrong value will return.
Parameters
borderColor{Array[T]} - Border color for field. Such as:
['RGB',1,0,0],//for red color
['T'],//for transparent
['G',1],//for white
['int',0xffff0000], //for red
['CMYK',1,1,0,0],//for red
Returns
{Promise.<boolean>} - true for success, false for failed

◆ setBorderStyle()

PDFField::setBorderStyle (   strStyle)
inline

Set field's border style(Not support signature field).

Note
Load all relative annotations before call this function, or wrong value will return.
Parameters
style{string} - Border style, should be one of 'solid','dashed','inset','beveled'. Nothing will be done with invalid string
Returns
{Promise.<*>}

◆ setFillColor()

PDFField::setFillColor (   fillColor)
inline

Set field's fillcolor(Not support signature field).

Note
Load all relative annotations before call this function, or wrong value will return.
Parameters
fillColor{Array[T]} - Fill color for field. Such as:
['RGB',1,0,0],//for red color
['T'],//for transparent
['G',1],//for white
['int',0xffff0000], //for red
['CMYK',1,1,0,0],//for red
Returns
{Promise.<*>}

◆ setMaxLength()

PDFField::setMaxLength (   maxLength)
inline

Set text field's max length.

Parameters
maxLength{number} - Max legnth to be setted to field.

◆ setOptions()

PDFField::setOptions (   options)
inline

Set options(items) of list box or combo box.

Applicable for list box and combo box. For field types that are not applicable, this function will do nothing.

Parameters
options{Array[Object]} - An array of options which is to be set to list box or combo box.
[
{
lable:"lable0",
value:"value0"
},{
lable:"lable1",
value:"value1"
},
...
]
Returns
None.

◆ setValue()

PDFField::setValue (   value = '',
  control = null 
)
inline

Set field's value.

Note
Applicable for all fields except push button and signature. For field types that are not applicable, nothing will be done. This function will not trigger calculation action. If application want trigger it, please call PDFForm::calculate()
Parameters
value{string} - Field's value to be setted.
control{Widget} - Widget annot which trigger this event.

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