FoxitPDFSDKforWeb  7.1.1
Foxit PDF SDK for Web
PDFForm Class Reference

Public Member Functions

 addControl (pageIndex, fieldName, fieldType, rect)
 Add a new form control to a specified form field. If the form field does not exist, this function will add a form field as well. (Not support signature field) More...
 
 calculate (field)
 Calculate form fields' value. More...
 
 getField (title, wildcast=false)
 Get PDFField specified by title(a.k.a name). More...
 
 getFieldByIndex (index)
 Get PDFField specified by index. More...
 
 getFieldCount ()
 Get the count of form fields including unsupported signature. More...
 
 removeField (fieldName)
 Remove a form field. (Not support signature field) More...
 
 resetForm (fieldNames=[], flags=0, source)
 Reset form fields value to default value. More...
 

Detailed Description

PDF Form object

The PDF form module is a tree structure with the PDFForm as the root node, PDFField as the intermediate node and the Widget annotation (which called Form Control) as the leaf node.

Since
7.1.0

Member Function Documentation

◆ addControl()

PDFForm::addControl (   pageIndex,
  fieldName,
  fieldType,
  rect 
)
inline

Add a new form control to a specified form field. If the form field does not exist, this function will add a form field as well. (Not support signature field)

Parameters
pageIndex{number} - An interge indecate page's index.
fieldName{string} - Field name.
fieldType{number} - Field type. Please refer to Field_Type except #Field_Type.Unknown and #Field_Type.Sign.
rect{PDFRect} - Rectangle of the new form control which specifies the position in PDF page. It should be in [PDF coordinate system].
Returns
{Promise.<bool>} true means success, while false means failure.

◆ calculate()

PDFForm::calculate (   field)
inline

Calculate form fields' value.

Parameters
field{PDFField} - Target field which to be setted.

◆ getField()

PDFForm::getField (   title,
  wildcast = false 
)
inline

Get PDFField specified by title(a.k.a name).

Parameters
title{string} - The title of field.
Returns
{PDFField} - Target field if existed.

◆ getFieldByIndex()

PDFForm::getFieldByIndex (   index)
inline

Get PDFField specified by index.

Parameters
index{number} - Specifies field index.
Returns
{PDFField} - Target field if existed.

◆ getFieldCount()

PDFForm::getFieldCount ( )
inline

Get the count of form fields including unsupported signature.

Returns
{number} - The count of fields.

◆ removeField()

PDFForm::removeField (   fieldName)
inline

Remove a form field. (Not support signature field)

Note
Using this function to remove may cause PDFFiels' indices changing.

If the form field appears on more than one PDF page, all representations will be removed.

Parameters
fieldName{string} - A string value. It should not be an empty string.
Returns
{Promise.<bool>} true means success, while false means failure.

◆ resetForm()

PDFForm::resetForm (   fieldNames = [],
  flags = 0,
  source 
)
inline

Reset form fields value to default value.

Parameters
fieldNames{Array[string]} - Specifies target fields, could be empty.
flags{number} - Specifies reseting flags.Please refer to reference 1.7 Table 8.88.
source{PDFField} - Specifies source field which trigger this action. If pass Null to this, calulation will not be performed.

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