FoxitPDFSDKforWeb v11.0.1
Foxit PDF SDK for Web
|
Service for handling PDF form filling operations. More...
Public Member Functions | |
appendInteractionEventInterceptor (interceptor:FormInteractionEventInterceptor) | |
Append a FormInteractionEventInterceptor to the end of the existing list. More... | |
getDesignMode () | |
Get the current form design mode. More... | |
getHighlightColor () | |
Get the highlight color for form fields. More... | |
getMouseOverControl () | |
Determines if there is currently a focused form widget control. More... | |
isHighlightFormFields () | |
Check if form fields are highlighted. More... | |
isInteractionEventEnabled () | |
Check if the interaction event is enabled. More... | |
onClickWidget (callback:(widgetId:AnnotId, event:FormMouseEvent)=> void) | |
Registers a callback function for form widget click events. More... | |
onDataChanged (callback:(doc:PDFDoc, widgetId:AnnotId)=> void) | |
Registers a callback function that is called when data changes occur in a form widget. More... | |
onDesignModeChange (callback:(designMode:FormDesignMode)=> void) | |
Subscribe to design mode change events. More... | |
onFocusChange (callback:(current?:AnnotId, origin?:AnnotId)=> void) | |
Callback when the focus is changed. More... | |
onKeyDown (callback:(widgetId:AnnotId|undefined, event:FormKeyboardEvent)=>void) | |
Registers a callback function for key down events. More... | |
onKeyUp (callback:(widgetId:AnnotId|undefined, event:FormKeyboardEvent)=>void) | |
Registers a callback function for key up events. More... | |
onMouseDownWidget (callback:(widgetId:AnnotId, event:FormMouseEvent)=> void) | |
Registers a callback function for form widget mouse down events. More... | |
onMouseLeaveWidget (callback:(widgetId:AnnotId)=> void) | |
Registers a callback function for form widget mouse leave events. More... | |
onMouseOverWidget (callback:(widgetId:AnnotId)=> void) | |
Registers a callback function for form widget mouse over events. More... | |
onMouseUpWidget (callback:(widgetId:AnnotId, event:FormMouseEvent)=> void) | |
Registers a callback function for form widget mouse up events. More... | |
onRightClickWidget (callback:(widgetId:AnnotId, event:FormMouseEvent)=> void) | |
Registers a callback function for form widget right click events. More... | |
removeFocus () | |
Removes focus from the currently focused form widget control. More... | |
async | setDesignMode (designMode:FormDesignMode) |
Set the current form design mode. More... | |
async | setFocus (annotId:AnnotId) |
Sets the focus on the specified form widget control. More... | |
setHighlightColor (color:number) | |
Set the highlight color for form fields. More... | |
async | setHighlightFields (isHighlight:boolean) |
Set the highlight state of form fields in the document and redraw the page immediately. More... | |
toggleInteractionEvent (enabled:boolean) | |
Toggle the form interaction event on or off, and when the interaction event is turned off, it will not be possible to interact with the form widget. More... | |
![]() | |
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... | |
Service for handling PDF form filling operations.
This service provides multiple methods to interact with and manipulate form widgets within a PDF document, including creation, event handling, and design mode management.
|
inline |
Append a FormInteractionEventInterceptor to the end of the existing list.
The interceptor is called after the existing interceptors and before the default behavior of the form widget. The interceptor can call the next interceptor by calling the next function, or settle the event by not calling the next function.
interceptor | FormInteractionEventInterceptor - The interceptor to append. |
|
inline |
|
inline |
Get the highlight color for form fields.
This method returns a promise that resolves to the current highlight color for form fields in the current PDF document as a 24-bit hex color code.
|
inline |
Determines if there is currently a focused form widget control.
Returns the currently mouse-overed form widget control.
|
inline |
Check if form fields are highlighted.
This method returns a promise that resolves to a boolean indicating whether the form fields in the current PDF document are highlighted.
|
inline |
Check if the interaction event is enabled.
This method returns a boolean value indicating whether the interaction event is enabled.
|
inline |
Registers a callback function for form widget click events.
callback | (widgetId:AnnotId,event:FormMouseEvent)=>void - The callback function, which will be called when a click event occurs on a form widget. The callback function will receive the widget id and FormMouseEvent as arguments. |
appendInteractionEventInterceptor
method, which provides a mechanism for pre-processing or modifying event behavior before it reaches the callback.
|
inline |
Registers a callback function that is called when data changes occur in a form widget.
The callback is triggered after the user inputs characters or changes the selection in ListBox, ComboBox, or DateTime Field widgets.
callback | (doc:PDFDoc,widgetId: AnnotId)=>void - The callback function to be registered, which receives the PDF document and the widget id as arguments. |
|
inline |
Subscribe to design mode change events.
callback | (designMode: FormDesignMode)=>void - A callback which accepts one argument, designMode , which is the current design mode. |
|
inline |
Callback when the focus is changed.
callback | (current?:AnnotId,origin?:AnnotId)=>void - A callback with two arguments, current and origin . current is the current focused annot, and origin is the previous focused annot. When the focus is removed, current is undefined, and origin is the last focused annot. |
|
inline |
Registers a callback function for key down events.
callback | (widgetId:AnnotId|undefined,event:FormKeyboardEvent)=>void - The callback function that will be triggered when a key down event occurs. The function receives the widget id (if exists) and the FormKeyboardEvent as arguments. |
|
inline |
Registers a callback function for key up events.
callback | (widgetId:AnnotId|undefined,event:FormKeyboardEvent)=>void - The callback function that will be triggered when a key up event occurs. The function receives the widget id (if exists) and the FormKeyboardEvent as arguments. |
|
inline |
Registers a callback function for form widget mouse down events.
callback | (widgetId:AnnotId,event:FormMouseEvent)=>void - The callback function, which will be called when a mouse down event occurs on a form widget. The callback function will receive the widget id and form mouse event as arguments. |
appendInteractionEventInterceptor
method, which provides a mechanism for pre-processing or modifying event behavior before it reaches the callback.
|
inline |
Registers a callback function for form widget mouse leave events.
callback | (widgetId:AnnotId)=>void - The callback function, which will be called when a mouse leave event occurs on a form widget. The callback function will receive the widget id as an argument. |
appendInteractionEventInterceptor
method, which provides a mechanism for pre-processing or modifying event behavior before it reaches the callback.
|
inline |
Registers a callback function for form widget mouse over events.
callback | (widgetId:AnnotId)=>void - The callback function, which will be called when a mouse over event occurs on a form widget. The callback function will receive the widget id as an argument. |
appendInteractionEventInterceptor
method, which provides a mechanism for pre-processing or modifying event behavior before it reaches the callback.
|
inline |
Registers a callback function for form widget mouse up events.
callback | (widgetId:AnnotId,event:FormMouseEvent)=>void - The callback function, which will be called when a mouse up event occurs on a form widget. The callback function will receive the widget id and form mouse event as arguments. |
appendInteractionEventInterceptor
method, which provides a mechanism for pre-processing or modifying event behavior before it reaches the callback.
|
inline |
Registers a callback function for form widget right click events.
callback | (widgetId:AnnotId,event:FormMouseEvent)=>void - The callback function, which will be called when a right click event occurs on a form widget. The callback function will receive the widget id and FormMouseEvent as arguments. |
appendInteractionEventInterceptor
method, which provides a mechanism for pre-processing or modifying event behavior before it reaches the callback.
|
inline |
Removes focus from the currently focused form widget control.
This method returns a promise that resolves once the focus has been removed. It also ensures that any necessary cleanup is performed by triggering the WidgetAnnot.handleOnLostFocus method if there was a widget control that was previously focused.
|
inline |
Set the current form design mode.
designMode | FormDesignMode - The form design mode to be set. |
|
inline |
Sets the focus on the specified form widget control.
annotId | AnnotId - The form widget control to set the focus on. The annotId should be an object with the properties "pageIndex" and "objNumber". |
Error | - Document not opening! |
Error | - Widget not found: page index <pageIndex>, widget id: <widgetId> |
Error | - Control not exist: page index <pageIndex>, widget id: <widgetId> |
|
inline |
Set the highlight color for form fields.
This method sets the color used to highlight form fields when highlighting is enabled.
color | number - The color to set for form field highlighting. A number representing the 24-bit hex color code (0xRRGGBB). |
|
inline |
Set the highlight state of form fields in the document and redraw the page immediately.
This method toggles the highlighting of form fields within the current PDF document. When highlighting is enabled, the form fields are visually emphasized.
|
inline |
Toggle the form interaction event on or off, and when the interaction event is turned off, it will not be possible to interact with the form widget.
enabled | boolean - Whether to enable the interaction event. |