| FoxitPDFSDKforWeb v11.0.6 Archives Foxit PDF SDK for Web

Public Member Functions | List of all members
PDFFormPropertiesService Class Reference
UIExtension » addons » form_designer_addon

Service for retrieving various PDFFormProperty instances for fields/widgets, facilitating UI interactions such as property dialogs. More...

Inheritance diagram for PDFFormPropertiesService:

## Public Member Functions
| appendAdditionalAction (widget:Widget, {trigger, actionData }:{ trigger:WidgetActionTriggerEvents, actionData:ActionSpecification})
| Appends an additional action to the widget. This method appends the action specified by `actionData` to the widget's additional actions for the given `trigger`, different from the AdditionalAction.addAction method, this method supports the undo/redo operation. More...
| getActions ()
| Retrieves the actions of the widget. More...
| getAlignment ()
| Retrieves the text alignment property of the text field. More...
| getAllActions ()
| Gets the property for manipulation all action data (including action data and additional action data) of the widget. More...
| getAlternateName ()
| Retrieves the alternate name property. More...
| getCheckedByDefualtProperty ()
| Retrieves the checked by default property for the checkbox or radio-button. More...
| getChoiceOptionsProperty ()
| Retrieves the property for the options of the field. More...
| getDefaultValue ()
| Retrieves the default value property of the text field. More...
| getDirectionRTL ()
| Retrieves the text direction property of the widget. More...
| getExportValueProperty ()
| Retrieves the normal caption string property for the checkbox or radio-button. More...
| getFieldFlagOptions ()
| Retrieves the flags property of the field. More...
| getFieldName ()
| Retrieves the field name property. More...
| getFieldReadonlyProperty ()
| Retrieves the 'readonly' property, extracted from the field's flags. Indicates whether the field is read-only and cannot be modified by the user. More...
| getFieldRequiredProperty ()
| Retrieves the 'required' property , extracted from the field's flags. Indicates whether the field must have a value at the time it is exported by a submit-form action. More...
| getHighlightingMode ()
| Retrieves the highlighting mode property for the push-button widget. More...
| getIconCaptionRelation ()
| Retrieves the relation of the icon and caption of the form widget. More...
| getMaxLengthProperty ()
| Retrieves the maximum length property of the text field. More...
| getMKCaptionOptions ()
| Retrieves the caption options of the form widget. More...
| getMKIconProperty ()
| Retrieves the MKIcon property of the image button widget based on the user-selected gesture state. More...
| getNormalCaptionProperty ()
| Retrieves the normal caption string property for the checkbox or radio-button. More...
| getRect ()
| Retrieves the rect property of the widget. More...
| getSelectedFields ()
| Gets the currently selected fields. More...
| getSelectedWidgets ()
| Gets the currently selected widgets. More...
| getVisibleType ()
| Retrieves the visible type information property, extracted from the widget's flags. This property indicates the visibility state of the widget, including whether it is hidden, not viewable, or has print permissions. More...
| getWidgetBorderColor ()
| Retrieves the border-color property of the widget. More...
| getWidgetBorderStyle ()
| Retrieves the border style property of the widget. More...
| getWidgetBorderWidth ()
| Retrieves the border width property of the widget. More...
| getWidgetFillColor ()
| Retrieves the widget's fill-color property. More...
| getWidgetFont ()
| Retrieves the font object property of the widget. More...
| getWidgetOrientation ()
| Retrieves the orientation property of the widget. The rotation is returned in degrees (0, 90, 180, or 270). More...
| getWidgetTextColor ()
| Retrieves the text color property of the widget. More...
| getWidgetTextSize ()
| Retrieves the text size property of the widget. More...
async | removeAction (widget:Widget, { trigger, actionObjNumber }:RemoveActionOptions)
| Removes actions from the specified widget. More...
| updateAction (widget:Widget, actionObjNumber:number, oldActionData:ActionData, newActionData:ActionData)
| Updates a action of the widget. More...
| updateAdditionalAction (widget:Widget, actionData:{ trigger:AnnotActionTriggerEvents, actionObjNumber:number, oldActionData:ActionData, newActionData:ActionData })
| Updates an additional action of the widget. More...
Public Member Functions inherited from Disposable
| addDestroyHook (...hooks)
| Add a function to destroyHooks list, which will be called during destroy. More...
| destroy ()
| ownsTo (owner)
| Establishes an ownership relationship where this instance will be destroyed when the owner is destroyed. Additionally, the owner will be automatically removed from the destroyHooks list when this instance is destroyed. More...

## Detailed Description

Service for retrieving various PDFFormProperty instances for fields/widgets, facilitating UI interactions such as property dialogs.

(async () => {
const formDesigner = await pdfui.getAddonInstance('FormDesigner')
const service = formDesigner.getPDFFormPropertiesService();
const property = service.getFieldName();
property.ownsTo(someUIXComponentOrDisposableInstance); // property will be destroyed when the component is destroyed
property.onChange((hasValue, value) => {
if(!hasValue) {
console.log('no form widget activated!');
return;
}
console.log(property.available, property.visible, property.hasValue, property.value);
console.log('Current activated field name is: ' + value)
})
})()

Since
  11.0.0

See also
  Disposable
  Disposable.ownsTo
  FormDesignerAddon.getPDFFormPropertiesService
  PDFFormProperty<T>
  Component

## Member Function Documentation

## ◆ appendAdditionalAction()

PDFFormPropertiesService::appendAdditionalAction | ( |  | widget:Widget,
|  |  | {trigger, actionData }:{ trigger:WidgetActionTriggerEvents, actionData:ActionSpecification}
| ) |  |
| inline

Appends an additional action to the widget. This method appends the action specified by `actionData` to the widget's additional actions for the given `trigger`, different from the AdditionalAction.addAction method, this method supports the undo/redo operation.

Parameters

  widget | Widget - The widget to which the additional action is to be appended.
  data | ActionSpecWithTrigger - The specification of the action to be appended.

Returns
  Promise<void> - Resolves when the action is successfully appended.

Since
  11.0.0

## ◆ getActions()

PDFFormPropertiesService::getActions | ( |  | ) |
| inline

Retrieves the actions of the widget.

This method fetches the action data associated with the widget and updates the list of normal action object numbers for tracking purposes. It listens for updates related to action data changes.

Returns
  Promise<ActionHierarchy|undefined> - A promise that resolves to the action hierarchy containing the actions, or undefined if no actions are present.

Since
  11.0.0

## ◆ getAlignment()

PDFFormPropertiesService::getAlignment | ( |  | ) |
| inline

Retrieves the text alignment property of the text field.

Returns
  PDFFormProperty<TextWidgetAlignment> - The text alignment property encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  TextWidgetAlignment
  Widget.getAlignment
  Widget.setAlignment

## ◆ getAllActions()

PDFFormPropertiesService::getAllActions | ( |  | ) |
| inline

Gets the property for manipulation all action data (including action data and additional action data) of the widget.

Returns
  PDFFormProperty<{trigger:AnnotActionTriggerEvents;data:ActionHierarchy;}[]> - The PDFFormProperty containing all action data.

Since
  11.0.0

## ◆ getAlternateName()

PDFFormPropertiesService::getAlternateName | ( |  | ) |
| inline

Retrieves the alternate name property.

Returns
  PDFFormProperty<string> - The alternate name property encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  PDFFormField.getAlternateName
  PDFFormField.setAlternateName

## ◆ getCheckedByDefualtProperty()

PDFFormPropertiesService::getCheckedByDefualtProperty | ( |  | ) |
| inline

Retrieves the checked by default property for the checkbox or radio-button.

Returns
  PDFFormProperty<boolean> - The field's checked by default property encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  PDFFormField.isCheckedByDefault
  PDFFormField.setCheckedByDefault

## ◆ getChoiceOptionsProperty()

PDFFormPropertiesService::getChoiceOptionsProperty | ( |  | ) |
| inline

Retrieves the property for the options of the field.

Returns
  PDFFormProperty<ChoiceOptionItem[]> - The field's options property encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  PDFFormField.getOptions
  PDFFormField.setOptions

## ◆ getDefaultValue()

PDFFormPropertiesService::getDefaultValue | ( |  | ) |
| inline

Retrieves the default value property of the text field.

Returns
  PDFFormProperty<string> - The default value property encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  PDFFormField.getDefaultValue
  PDFFormField.setDefaultValue

## ◆ getDirectionRTL()

PDFFormPropertiesService::getDirectionRTL | ( |  | ) |
| inline

Retrieves the text direction property of the widget.

Returns
  PDFFormProperty<number> - The text direction property encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  Widget.getDirectionRTL
  Widget.setDirectionRTL

## ◆ getExportValueProperty()

PDFFormPropertiesService::getExportValueProperty | ( |  | ) |
| inline

Retrieves the normal caption string property for the checkbox or radio-button.

Returns
  PDFFormProperty<string> - The widget(checkbox/radio-button) export value property encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  Widget.getExportValue
  Widget.setExportValue

## ◆ getFieldFlagOptions()

PDFFormPropertiesService::getFieldFlagOptions | ( |  | ) |
| inline

Retrieves the flags property of the field.

Returns
  PDFFormProperty<FieldFlagOptions> - The field flags property encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  PDFFormField.describeFieldFlags
  PDFFormField.updateFlagByOptions

## ◆ getFieldName()

getFieldName | ( |  | ) |
| inline

Retrieves the field name property.

Returns
  PDFFormProperty<string> - The field name property encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  PDFFormField.getName

## ◆ getFieldReadonlyProperty()

PDFFormPropertiesService::getFieldReadonlyProperty | ( |  | ) |
| inline

Retrieves the 'readonly' property, extracted from the field's flags. Indicates whether the field is read-only and cannot be modified by the user.

Returns
  PDFFormProperty<boolean> - The 'readonly' status property encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  PDFFormField.describeFieldFlags
  PDFFormField.updateFlagByOptions

## ◆ getFieldRequiredProperty()

PDFFormPropertiesService::getFieldRequiredProperty | ( |  | ) |
| inline

Retrieves the 'required' property , extracted from the field's flags. Indicates whether the field must have a value at the time it is exported by a submit-form action.

Returns
  PDFFormProperty<boolean> - The required status property encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  PDFFormField.describeFieldFlags
  PDFFormField.updateFlagByOptions

## ◆ getHighlightingMode()

PDFFormPropertiesService::getHighlightingMode | ( |  | ) |
| inline

Retrieves the highlighting mode property for the push-button widget.

Returns
  PDFFormProperty<HighlightingMode> - The push-button widget's highlighting mode property encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  Widget.getHighlightingMode
  Widget.setHighlightingMode

## ◆ getIconCaptionRelation()

PDFFormPropertiesService::getIconCaptionRelation | ( |  | ) |
| inline

Retrieves the relation of the icon and caption of the form widget.

Returns
  PDFFormProperty<WidgetIconCaptionRelation> - The relation of the icon and caption of the form widget encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  Widget.getIconCaptionRelation
  Widget.setIconCaptionRelation

## ◆ getMaxLengthProperty()

PDFFormPropertiesService::getMaxLengthProperty | ( |  | ) |
| inline

Retrieves the maximum length property of the text field.

Returns
  PDFFormProperty<number> - The maximum length property encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  PDFFormField.getMaxLength
  PDFFormField.setMaxLength

## ◆ getMKCaptionOptions()

PDFFormPropertiesService::getMKCaptionOptions | ( |  | ) |
| inline

Retrieves the caption options of the form widget.

Returns
  PDFFormProperty<MKCaptionOptions> - The caption options of the form widget encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  Widget.getMKCaptionOptions

## ◆ getMKIconProperty()

PDFFormPropertiesService::getMKIconProperty | ( |  | ) |
| inline

Retrieves the MKIcon property of the image button widget based on the user-selected gesture state.

Returns
  PDFFormProperty<MKIconBitmap|undefined> - The MKIcon property of the form widget encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  Widget.getMKIcon
  Widget.setMKIcon
  Widget.setIconFitOptions

## ◆ getNormalCaptionProperty()

PDFFormPropertiesService::getNormalCaptionProperty | ( |  | ) |
| inline

Retrieves the normal caption string property for the checkbox or radio-button.

Returns
  PDFFormProperty<string> - The widget(checkbox/radio-button) normal caption property encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  Widget.getNormalCaption
  Widget.setNormalCaption

## ◆ getRect()

PDFFormPropertiesService::getRect | ( |  | ) |
| inline

Retrieves the rect property of the widget.

Returns
  PDFFormProperty<PDFRect> - The rect property encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  Widget.getRect
  Widget.setRect

## ◆ getSelectedFields()

PDFFormPropertiesService::getSelectedFields | ( |  | ) |
| inline

Gets the currently selected fields.

This method first gets the currently selected widgets, and then maps them to their corresponding fields. Any duplicate fields are removed by converting the list to a Set and back to an array.

Returns
  PDFFormField[] - The currently selected fields.

Since
  11.0.0

## ◆ getSelectedWidgets()

PDFFormPropertiesService::getSelectedWidgets | ( |  | ) |
| inline

Gets the currently selected widgets.

Returns
  Widget[] - The currently selected widgets.

Since
  11.0.0

## ◆ getVisibleType()

PDFFormPropertiesService::getVisibleType | ( |  | ) |
| inline

Retrieves the visible type information property, extracted from the widget's flags. This property indicates the visibility state of the widget, including whether it is hidden, not viewable, or has print permissions.

Returns
  PDFFormProperty<VisibleType> - The visible type property encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  Widget.getFlags
  Widget.setFlags

## ◆ getWidgetBorderColor()

PDFFormPropertiesService::getWidgetBorderColor | ( |  | ) |
| inline

Retrieves the border-color property of the widget.

Returns
  PDFFormProperty<number> - The 'border-color' property encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  Widget.getMKBorderColor
  Widget.setMKBorderColor

## ◆ getWidgetBorderStyle()

PDFFormPropertiesService::getWidgetBorderStyle | ( |  | ) |
| inline

Retrieves the border style property of the widget.

Returns
  PDFFormProperty<Border_Style> - The border style property encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  Widget.getBorderStyle
  Widget.setBorderStyle

## ◆ getWidgetBorderWidth()

PDFFormPropertiesService::getWidgetBorderWidth | ( |  | ) |
| inline

Retrieves the border width property of the widget.

Returns
  PDFFormProperty<number> - The border width property encapsulated in a PDFFormProperty instance. Widget.getBorderWidth Widget.setBorderWidth

Since
  11.0.0

## ◆ getWidgetFillColor()

PDFFormPropertiesService::getWidgetFillColor | ( |  | ) |
| inline

Retrieves the widget's fill-color property.

Returns
  PDFFormProperty<number> - The 'border-color' property encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  Widget.getMKFillColor
  Widget.setMKFillColor

## ◆ getWidgetFont()

PDFFormPropertiesService::getWidgetFont | ( |  | ) |
| inline

Retrieves the font object property of the widget.

Returns
  PDFFormProperty<DefaultAppearanceFontInfo|undefined> - The font object property encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  Widget.getFont
  Widget.setDefaultAppearance

## ◆ getWidgetOrientation()

PDFFormPropertiesService::getWidgetOrientation | ( |  | ) |
| inline

Retrieves the orientation property of the widget. The rotation is returned in degrees (0, 90, 180, or 270).

Returns
  PDFFormProperty<number> - The orientation property encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  Widget.getRotation
  Widget.setRotation

## ◆ getWidgetTextColor()

PDFFormPropertiesService::getWidgetTextColor | ( |  | ) |
| inline

Retrieves the text color property of the widget.

Returns
  PDFFormProperty<number> - The text color property encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  Widget.getTextColor
  Widget.setTextColor
  Widget.setDefaultAppearance

## ◆ getWidgetTextSize()

PDFFormPropertiesService::getWidgetTextSize | ( |  | ) |
| inline

Retrieves the text size property of the widget.

Returns
  PDFFormProperty<number> - The text size property encapsulated in a PDFFormProperty instance.

Since
  11.0.0

See also
  Widget.getTextSize
  Widget.setTextSize
  Widget.setDefaultAppearance

## ◆ removeAction()

async PDFFormPropertiesService::removeAction | ( |  | widget:Widget,
|  |  | { trigger, actionObjNumber }:RemoveActionOptions
| ) |  |
| inline

Removes actions from the specified widget.

This method determines whether to remove a action or an additional action based on the presence of an `actionObjNumber` and whether it corresponds to a action. If `actionObjNumber` is provided and is a action, it removes the action. Otherwise, if `actionObjNumber` is provided but not a action, it removes the additional action. If `actionObjNumber` is not provided, it removes all additional actions associated with the given `trigger`.

Parameters

  widget | Widget - The widget from which the action is to be removed.
  options | object - The options containing the trigger and the action object number.
  [options.trigger] | AnnotActionTriggerEvents - The event trigger of the action to be removed.
  [options.actionObjNumber] | number - The object number of the action to be removed; if not specified, all actions for the trigger are removed.

Returns
  Promise<boolean> - A promise that resolves to a boolean indicating the success of the removal operation.

Since
  11.0.0

## ◆ updateAction()

PDFFormPropertiesService::updateAction | ( |  | widget:Widget,
|  |  | actionObjNumber:number,
|  |  | oldActionData:ActionData,
|  |  | newActionData:ActionData
| ) |  |
| inline

Updates a action of the widget.

This method updates the specified action associated with the widget using the given action object number and new action data. It also records the undo/redo action for this update operation.

Parameters

  widget | Widget - The widget whose action is to be updated.
  actionObjNumber | number - The object number of the action to update.
  oldActionData | ActionData - The previous action data before the update.
  newActionData | ActionData - The new action data to apply.

Returns
  Promise<void> - Resolves when the action is successfully updated and the undo/redo action is recorded.

Since
  11.0.0

## ◆ updateAdditionalAction()

PDFFormPropertiesService::updateAdditionalAction | ( |  | widget:Widget,
|  |  | actionData:{ trigger:AnnotActionTriggerEvents, actionObjNumber:number, oldActionData:ActionData, newActionData:ActionData }
| ) |  |
| inline

Updates an additional action of the widget.

This method updates the specified additional action associated with the widget using the given trigger, action object number, and new action data. It also records the undo/redo action for this update operation.

Parameters

  widget | Widget - The widget whose additional action is to be updated.
  actionData | object - The data specifying the update.
  actionData.trigger | AnnotActionTriggerEvents - The event trigger for the action.
  actionData.actionObjNumber | number - The object number of the action to update.
  actionData.oldActionData | ActionData - The previous action data before the update.
  actionData.newActionData | ActionData - The new action data to apply.

Returns
  Promise<void> - Resolves when the action is successfully updated and the undo/redo action is recorded.

Since
  11.0.0

@2025 Foxit Software Incorporated. All rights reserved.