fpdf_form_w.h
Go to the documentation of this file.
1 
25 #ifndef _FSPDF_FORM_W_H_
26 #define _FSPDF_FORM_W_H_
27 
77 #ifdef __cplusplus
78 extern "C" {
79 #endif
80 
81 /*******************************************************************************/
82 /* Form */
83 /*******************************************************************************/
110 FS_RESULT FSPDF_Doc_CreateForm(FSCRT_DOCUMENT document, FSPDF_FORM* form);
111 
137 FS_RESULT FSPDF_Form_ExportToFDFDoc(FSPDF_FORM form, FSCRT_DOCUMENT fdfDoc);
138 
164 FS_RESULT FSPDF_Form_ImportFromFDFDoc(FSPDF_FORM form, FSCRT_DOCUMENT fdfDoc);
165 
189 FS_RESULT FSPDF_Form_ExportToXML(FSPDF_FORM form, FSCRT_FILE xmlFile);
190 
214 FS_RESULT FSPDF_Form_ImportFromXML(FSPDF_FORM form, FSCRT_FILE xmlFile);
215 
240 FS_RESULT FSPDF_Form_Reset(FSPDF_FORM form, const FSCRT_BSTR* fieldNames, FS_INT32 count, FS_BOOL bInclude);
241 
263 FS_RESULT FSPDF_Form_SetDefaultAppearance(FSPDF_FORM form, const FSPDF_DEFAULTAPPEARANCE* defAppearance);
264 
295 FS_RESULT FSPDF_Form_SetAlignment(FSPDF_FORM form, FS_INT32 alignment);
296 
317 FS_RESULT FSPDF_Form_SetConstructAppearancesFlag(FSPDF_FORM form, FS_BOOL needConstruct);
318 
345 FS_RESULT FSPDF_Form_RenameField(FSPDF_FORM form, const FSCRT_BSTR* fieldName, const FSCRT_BSTR* newFieldName);
346 
368 FS_RESULT FSPDF_Form_SetFieldsInCalculationOrder(FSPDF_FORM form, const FSCRT_BSTR* fieldNames, FS_DWORD count);
369 
413 FS_RESULT FSPDF_Form_AddField(FSPDF_FORM form, FSCRT_PAGE page, const FSCRT_BSTR* fieldName, FS_INT32 fieldType, FSCRT_RECTF *rect, FSPDF_FORMCONTROL* formControl);
414 
443 FS_RESULT FSPDF_Form_RemoveField(FSPDF_FORM form, const FSCRT_BSTR* fieldName);
444 
445 /*******************************************************************************/
446 /* Form filler */
447 /*******************************************************************************/
448 #ifndef _FSPDF_DEF_HANDLE_FORMFILLER_
449 #define _FSPDF_DEF_HANDLE_FORMFILLER_
450 
452 FSCRT_DEFINEHANDLE(FSPDF_FORMFILLER);
453 
454 #endif /* _FSPDF_DEF_HANDLE_FORMFILLER_ */
455 
456 
457 #ifndef _FS_DEF_FORMINTERACTION_WINDOWLESSEXTENT_
458 #define _FS_DEF_FORMINTERACTION_WINDOWLESSEXTENT_
459 
461 typedef struct _FPDF_FORMINTERACTION_WINDOWLESSEXTENT_
462 {
465 
484  FS_RESULT (*OutputSelectedRect)(FS_LPVOID clientData,FS_INT32 pageIndex, FSCRT_RECTF* pdfRect);
485 
495  FS_RESULT (*SetCursor)(FS_LPVOID clientData, FS_INT32 nCursorType);
496 
512  FS_RESULT (*SetTimer)(FS_LPVOID clientData, FS_INT32 uElapse, FSCRT_CALLBACK_TIMER lpTimerFunc, FS_INT32* timeID);
513 
523  FS_RESULT (*KillTimer)(FS_LPVOID clientData, FS_INT32 timerID);
524 
537  FS_RESULT (*GotFocusOnControl)(FS_LPVOID clientData, FSPDF_FORMCONTROL control, const FSCRT_BSTR* filedValue);
538 
551  FS_RESULT (*LostFocusOnControl)(FS_LPVOID clientData, FSPDF_FORMCONTROL control, const FSCRT_BSTR* filedValue);
552 
554 
555 #endif /* FPDF_FORMINTERACTION_WINDOWLESS */
556 
580 FS_RESULT FSPDF_FormFiller_Begin(FSPDF_FORM form, FSPDF_FORMINTERACTION_WINDOWLESS* windowless, FSPDF_FORMFILLER* filler);
581 
607 FS_RESULT FSPDF_FormFiller_TriggerWindowlessEvent(FSPDF_FORMFILLER filler, FSCRT_PAGE page, FSCRT_MATRIX* page2Device, FS_DWORD eventType, FS_LPVOID eventData);
608 
628 FS_RESULT FSPDF_FormFiller_SetHighlightColor(FSPDF_FORMFILLER filler, FS_INT32 fieldType, FS_ARGB color);
629 
648 FS_RESULT FSPDF_FormFiller_ShowHighlight(FSPDF_FORMFILLER filler, FS_BOOL show);
649 
668 FS_RESULT FSPDF_FormFiller_End(FSPDF_FORMFILLER filler);
669 
670 /*******************************************************************************/
671 /* Form field trigger actions */
672 /*******************************************************************************/
704 FS_RESULT FSPDF_FormField_SetAction(FSPDF_FORM form, const FSCRT_BSTR* fieldName, FS_INT32 trigger, FS_INT32 index, const FSPDF_ACTIONDATA* actionData);
705 
738 FS_RESULT FSPDF_FormField_InsertAction(FSPDF_FORM form, const FSCRT_BSTR* fieldName, FS_INT32 trigger, FS_INT32 index,
739  const FSPDF_ACTIONDATA* actionData);
740 
771 FS_RESULT FSPDF_FormField_RemoveAction(FSPDF_FORM form, const FSCRT_BSTR* fieldName, FS_INT32 trigger, FS_INT32 index);
772 
802 FS_RESULT FSPDF_FormField_RemoveAllActions(FSPDF_FORM form, const FSCRT_BSTR* fieldName, FS_INT32 trigger);
803 
831 FS_RESULT FSPDF_FormField_RemoveControl(FSPDF_FORM form, const FSCRT_BSTR* fieldName, FSPDF_FORMCONTROL formControl);
832 
855 FS_RESULT FSPDF_FormField_ValidateValue(FSPDF_FORM form, const FSCRT_BSTR* fieldName, const FSCRT_BSTR* value, FS_BOOL* isValid);
856 
878 FS_RESULT FSPDF_FormField_ValidateKeyStroke(FSPDF_FORM form, const FSCRT_BSTR* fieldName, const FSCRT_BSTR* value, FS_BOOL* isValid);
879 
880 #ifndef _FSPDF_DEF_STRUCTURE_JAVASCRIPTEVENT_
881 #define _FSPDF_DEF_STRUCTURE_JAVASCRIPTEVENT_
882 
885 typedef struct _FSPDF_JAVASCRIPTEVENT
886 {
900 
901 #endif /* _FSPDF_DEF_STRUCTURE_JAVASCRIPTEVENT_ */
902 
924 FS_RESULT FSPDF_FormField_ValidateKeyStrokeEvent(FSPDF_FORM form, const FSCRT_BSTR* fieldName, FSPDF_JAVASCRIPTEVENT* jsEvent);
925 
945 FS_RESULT FSPDF_FormField_Calculate(FSPDF_FORM form, const FSCRT_BSTR* fieldName);
946 
967 FS_RESULT FSPDF_FormField_Format(FSPDF_FORM form, const FSCRT_BSTR* fieldName, FS_BOOL* isFormated);
968 
969 /*******************************************************************************/
970 /* Form field */
971 /*******************************************************************************/
1003 FS_RESULT FSPDF_FormField_SetAlignment(FSPDF_FORM form, const FSCRT_BSTR* fieldName, FS_INT32 alignment);
1004 
1029 FS_RESULT FSPDF_FormField_SetFlags(FSPDF_FORM form, const FSCRT_BSTR* fieldName, FS_DWORD flags);
1030 
1056 FS_RESULT FSPDF_FormField_SetDefaultValue(FSPDF_FORM form, const FSCRT_BSTR* fieldName, const FSCRT_BSTR* value);
1057 
1083 FS_RESULT FSPDF_FormField_SetValue(FSPDF_FORM form, const FSCRT_BSTR* fieldName, const FSCRT_BSTR* value);
1084 
1111 FS_RESULT FSPDF_FormField_SetDefaultAppearance(FSPDF_FORM form, const FSCRT_BSTR* fieldName, const FSPDF_DEFAULTAPPEARANCE* defAppearance);
1112 
1136 FS_RESULT FSPDF_FormField_SetAlternateName(FSPDF_FORM form, const FSCRT_BSTR* fieldName, const FSCRT_BSTR* alternateName);
1137 
1161 FS_RESULT FSPDF_FormField_SetMappingName(FSPDF_FORM form, const FSCRT_BSTR* fieldName, const FSCRT_BSTR* mappingName);
1162 
1188 FS_RESULT FSPDF_FormField_SetMaxLen(FSPDF_FORM form, const FSCRT_BSTR* fieldName, FS_INT32 maxLen);
1189 
1217 FS_RESULT FSPDF_FormField_SetOptions(FSPDF_FORM form, const FSCRT_BSTR* fieldName, const FSPDF_CHOICEOPTION* options, FS_INT32 count);
1218 
1244 FS_RESULT FSPDF_FormField_SetTopVisibleIndex(FSPDF_FORM form, const FSCRT_BSTR* fieldName, FS_INT32 index);
1245 
1246 /*******************************************************************************/
1247 /* Form control */
1248 /*******************************************************************************/
1272 FS_RESULT FSPDF_FormControl_SetExportValue(FSPDF_FORMCONTROL formControl, const FSCRT_BSTR* exportValue);
1273 
1297 FS_RESULT FSPDF_FormControl_SetChecked(FSPDF_FORMCONTROL formControl, FS_BOOL checked);
1298 
1322 FS_RESULT FSPDF_FormControl_SetDefaultChecked(FSPDF_FORMCONTROL formControl, FS_BOOL checked);
1323 
1345 FS_RESULT FSPDF_FormControl_DoJavaScriptAction(FSPDF_FORMCONTROL control, FS_INT32 trigger);
1346 
1368 FS_RESULT FSPDF_FormField_ValidateValueEvent(FSPDF_FORM form, const FSCRT_BSTR* fieldName, FSPDF_JAVASCRIPTEVENT* jsEvent);
1369 
1390 FS_RESULT FSPDF_FormField_FormatEvent(FSPDF_FORM form, const FSCRT_BSTR* fieldName, FSPDF_JAVASCRIPTEVENT* jsEvent);
1391 
1392 #ifdef __cplusplus
1393 };
1394 #endif
1395  /* group FPDFFORM */
1397 
1398 #endif /* _FSPDF_FORM_W_H_ */
FS_RESULT FSPDF_FormField_RemoveAllActions(FSPDF_FORM form, const FSCRT_BSTR *fieldName, FS_INT32 trigger)
Remove all actions associated with a field (except signature field) and a trigger type in a form...
FS_RESULT FSPDF_FormField_SetOptions(FSPDF_FORM form, const FSCRT_BSTR *fieldName, const FSPDF_CHOICEOPTION *options, FS_INT32 count)
Set list box or combo box options.
Structure for rectangle, in float.
Definition: fs_base_r.h:2078
FS_RESULT FSPDF_Form_AddField(FSPDF_FORM form, FSCRT_PAGE page, const FSCRT_BSTR *fieldName, FS_INT32 fieldType, FSCRT_RECTF *rect, FSPDF_FORMCONTROL *formControl)
Add a form field to arco form, and also create a new form control with the field. ...
FS_RESULT FSPDF_FormField_SetTopVisibleIndex(FSPDF_FORM form, const FSCRT_BSTR *fieldName, FS_INT32 index)
Set top index for scrollable list boxes.
FS_RESULT FSPDF_FormField_SetValue(FSPDF_FORM form, const FSCRT_BSTR *fieldName, const FSCRT_BSTR *value)
Set value of a field (except signature field).
Structure for list box and combo box option only.
Definition: fpdf_form_r.h:638
FS_BOOL bRc
Used for validation. Indicates whether a particular event in the event chain should succeed...
Definition: fpdf_form_w.h:898
FS_RESULT FSPDF_FormField_SetDefaultValue(FSPDF_FORM form, const FSCRT_BSTR *fieldName, const FSCRT_BSTR *value)
Set default value of the field (except signature field).
FS_RESULT FSPDF_FormField_ValidateValueEvent(FSPDF_FORM form, const FSCRT_BSTR *fieldName, FSPDF_JAVASCRIPTEVENT *jsEvent)
Perform the form field javascript to validate whether the user input value is valid.
FS_DWORD lStructSize
The size of the data structure. It must be set to sizeof(FSPDF_FORMINTERACTION_WINDOWLESS).
Definition: fpdf_form_w.h:464
FS_RESULT FSPDF_FormField_SetAlignment(FSPDF_FORM form, const FSCRT_BSTR *fieldName, FS_INT32 alignment)
Set alignment property of the field's text, only useful for text field and list box.
FS_RESULT FSPDF_FormField_Calculate(FSPDF_FORM form, const FSCRT_BSTR *fieldName)
Perform the form field javascript to calculate the values of form fields.
void(* FSCRT_CALLBACK_TIMER)(FS_INT32 timer)
Declares a pointer type for the callback function for the FSPDF_FORMFILL_INFO::SetTimer method...
Definition: fs_app_r.h:289
FS_RESULT FSPDF_FormFiller_SetHighlightColor(FSPDF_FORMFILLER filler, FS_INT32 fieldType, FS_ARGB color)
Set the highlight color for the form field.
FS_INT32 nEnd
Indicate the position of a field's value where the strChange end. [in].
Definition: fpdf_form_w.h:894
FS_RESULT FSPDF_FormFiller_End(FSPDF_FORMFILLER filler)
Finish the form filling.
FS_RESULT FSPDF_Form_SetDefaultAppearance(FSPDF_FORM form, const FSPDF_DEFAULTAPPEARANCE *defAppearance)
Set default appearance of a form.
unsigned int FS_DWORD
32-bit unsigned integer.
Definition: fs_base_r.h:142
FS_RESULT FSPDF_FormField_SetFlags(FSPDF_FORM form, const FSCRT_BSTR *fieldName, FS_DWORD flags)
Set flags specifying various characteristics of the field (except signature field).
FS_RESULT FSPDF_FormControl_SetChecked(FSPDF_FORMCONTROL formControl, FS_BOOL checked)
Set check box or radio button's state.
FSCRT_BSTR strValue
Value has different meanings for different field events such as KeyStroke,Validate,Format...[in/out].
Definition: fpdf_form_w.h:888
FS_RESULT FSPDF_Form_ExportToXML(FSPDF_FORM form, FSCRT_FILE xmlFile)
Export the form data to a XML file.
FS_RESULT FSPDF_FormFiller_Begin(FSPDF_FORM form, FSPDF_FORMINTERACTION_WINDOWLESS *windowless, FSPDF_FORMFILLER *filler)
Begin the form filling.
FS_RESULT FSPDF_FormControl_DoJavaScriptAction(FSPDF_FORMCONTROL control, FS_INT32 trigger)
Perform the form control javascript which is specified by the trigger.
FS_RESULT FSPDF_Doc_CreateForm(FSCRT_DOCUMENT document, FSPDF_FORM *form)
Create an arco form.
FS_RESULT FSPDF_Form_SetFieldsInCalculationOrder(FSPDF_FORM form, const FSCRT_BSTR *fieldNames, FS_DWORD count)
Set calculation order in a form.
int FS_INT32
32-bit signed integer.
Definition: fs_base_r.h:175
FS_BOOL bWillCommit
Verifies the current keystroke event before the data is committed. [in].
Definition: fpdf_form_w.h:896
FS_RESULT FSPDF_FormField_Format(FSPDF_FORM form, const FSCRT_BSTR *fieldName, FS_BOOL *isFormated)
Perform the form field javascript to format the values of form fields.
FS_RESULT FSPDF_FormFiller_ShowHighlight(FSPDF_FORMFILLER filler, FS_BOOL show)
Whether to show the highlight of form field or not.
Structure for javascript event.
Definition: fpdf_form_w.h:885
FS_RESULT FSPDF_FormField_RemoveAction(FSPDF_FORM form, const FSCRT_BSTR *fieldName, FS_INT32 trigger, FS_INT32 index)
Remove an action associated with a field (except signature field) and a trigger type by index in a fo...
Structure for default appearance.
Definition: fpdf_base_r.h:278
Structure for windowless form interaction information.
Definition: fpdf_form_w.h:461
Structure for an action data.
Definition: fpdf_base_r.h:841
int FS_BOOL
Boolean type (This should be TRUE or FALSE).
Definition: fs_base_r.h:133
FS_INT32 nStart
Indicate the position of a field's value where the strChange start. [in].
Definition: fpdf_form_w.h:892
FS_RESULT FSPDF_FormField_InsertAction(FSPDF_FORM form, const FSCRT_BSTR *fieldName, FS_INT32 trigger, FS_INT32 index, const FSPDF_ACTIONDATA *actionData)
Insert an action associated with a field (except signature field) and a trigger type at a specified i...
void * FS_LPVOID
A pointer to any types.
Definition: fs_base_r.h:127
FS_RESULT FSPDF_FormControl_SetDefaultChecked(FSPDF_FORMCONTROL formControl, FS_BOOL checked)
Set check box or radio button's default state.
FS_RESULT FSPDF_Form_SetConstructAppearancesFlag(FSPDF_FORM form, FS_BOOL needConstruct)
Set a flag that specifies whether to construct appearances when loading form controls.
FS_RESULT FSPDF_FormField_RemoveControl(FSPDF_FORM form, const FSCRT_BSTR *fieldName, FSPDF_FORMCONTROL formControl)
Remove a form control from a form field.
unsigned int FS_ARGB
ARGB color type, 32 bits, ((b) | ((g) << 8) | ((r) << 16)) | ((a) << 24)
Definition: fs_base_r.h:145
FS_RESULT FSPDF_FormField_ValidateValue(FSPDF_FORM form, const FSCRT_BSTR *fieldName, const FSCRT_BSTR *value, FS_BOOL *isValid)
Perform the form field javascript to validate whether the user input value is valid.
FS_RESULT FSPDF_Form_ImportFromXML(FSPDF_FORM form, FSCRT_FILE xmlFile)
Import the form data from a XML file.
FS_LPVOID clientData
The user-supplied data.
Definition: fpdf_form_w.h:467
FS_RESULT FSPDF_Form_SetAlignment(FSPDF_FORM form, FS_INT32 alignment)
Set alignment property of a form, as a document-wide default value.
Structure for 2D matrix.
Definition: fs_base_r.h:2130
Structure for byte string.
Definition: fs_base_r.h:611
FS_RESULT FSPDF_Form_RenameField(FSPDF_FORM form, const FSCRT_BSTR *fieldName, const FSCRT_BSTR *newFieldName)
Rename a field to a new name.
FS_RESULT FSPDF_FormField_SetDefaultAppearance(FSPDF_FORM form, const FSCRT_BSTR *fieldName, const FSPDF_DEFAULTAPPEARANCE *defAppearance)
Set default appearance to the specified field (except signature field).
FS_RESULT FSPDF_FormField_SetAction(FSPDF_FORM form, const FSCRT_BSTR *fieldName, FS_INT32 trigger, FS_INT32 index, const FSPDF_ACTIONDATA *actionData)
Update an action associated with a field (except signature field) and a trigger type at a specified i...
FS_RESULT FSPDF_Form_Reset(FSPDF_FORM form, const FSCRT_BSTR *fieldNames, FS_INT32 count, FS_BOOL bInclude)
Reset data in fields to their default value.
FS_RESULT FSPDF_FormField_SetMappingName(FSPDF_FORM form, const FSCRT_BSTR *fieldName, const FSCRT_BSTR *mappingName)
Set mapping name to be used when exporting interactive form field data from the document (except sign...
FSCRT_BSTR strChange
The string which will be part of a field&#39;s value. [in].
Definition: fpdf_form_w.h:890
FS_RESULT FSPDF_Form_ImportFromFDFDoc(FSPDF_FORM form, FSCRT_DOCUMENT fdfDoc)
Import data in FDF document to fill a form.
FS_RESULT FSPDF_FormControl_SetExportValue(FSPDF_FORMCONTROL formControl, const FSCRT_BSTR *exportValue)
Set option&#39;s export value.
FS_RESULT FSPDF_Form_RemoveField(FSPDF_FORM form, const FSCRT_BSTR *fieldName)
Remove a form field from arco form.
FS_RESULT FSPDF_FormField_SetAlternateName(FSPDF_FORM form, const FSCRT_BSTR *fieldName, const FSCRT_BSTR *alternateName)
Set alternate name to be used in place of the actual field (except signature field) name...
FS_RESULT FSPDF_FormField_ValidateKeyStrokeEvent(FSPDF_FORM form, const FSCRT_BSTR *fieldName, FSPDF_JAVASCRIPTEVENT *jsEvent)
Perform the form field javascript to validate whether the input of key stroke is valid.
int FS_RESULT
Result code for functions in Foxit PDF SDK.
Definition: fs_base_r.h:160
FS_RESULT FSPDF_FormFiller_TriggerWindowlessEvent(FSPDF_FORMFILLER filler, FSCRT_PAGE page, FSCRT_MATRIX *page2Device, FS_DWORD eventType, FS_LPVOID eventData)
Trigger the platform event for the windowless form filling.
FS_RESULT FSPDF_FormField_FormatEvent(FSPDF_FORM form, const FSCRT_BSTR *fieldName, FSPDF_JAVASCRIPTEVENT *jsEvent)
Perform the form field javascript to format the values of form fields.
FS_RESULT FSPDF_Form_ExportToFDFDoc(FSPDF_FORM form, FSCRT_DOCUMENT fdfDoc)
Export data in a form to a FDF document.
FS_RESULT FSPDF_FormField_SetMaxLen(FSPDF_FORM form, const FSCRT_BSTR *fieldName, FS_INT32 maxLen)
Set maximum length of the field&#39;s text (except signature field), in characters.
FS_RESULT FSPDF_FormField_ValidateKeyStroke(FSPDF_FORM form, const FSCRT_BSTR *fieldName, const FSCRT_BSTR *value, FS_BOOL *isValid)
Perform the form field javascript to validate whether the input of key stroke is valid.

Foxit Corporation