Create and Write to Persistent Storage
Creation of a FormDefinition relies on the existence of a FormSetFile object. For more information on creating a FormSetFile object see Store Data and Operations > FormSet. The steps below rely on a FormSet object already existing.
- Set the NewFormFilenamePrefix and NewFormFilenameSuffix of the FormSetFile object.
- Create an instance of the FormDefinitionFile class by calling the CreateNewForm method of the FormSet class
- Lock the FormSetFile using the Lock method.
- Set the Name and UserTag properties.
- Add a TemplateImage to the TemplateImages collection
- Create a new TemplateImage object.
See Store Data and Operations > TemplateImage
- Add it to the TemplateImages collection using the Add method
- Add one or more Fields to the Fields collection
- For each field to be added to the Fields collection
- Create a new Field object.
See Store Data and Operations > Field
- Add the Field object to the Fields collection using the Add method.
- Add processing operations to the Operations collection
These are operations to be performed on a filled image after it has been identified as a specific form. See
Integrating with ScanFix.
- For each operation to be added to the collection
- Create a DataItem to represent the operation to be performed on the field clip.
See Storing Data and Operations > DataItem.
- Add this DataItem to the Operations collection using the Add method.
- Add DataItems to the OtherDataItems collection
- Write all of the information to persistent storage using the Write method
- Unlock the file using the Unlock method.
Edit OtherDataItems and Write to Persistent Storage
This sequence shown below used to store information when an Accusoft component asks you to store information on its behalf during form processing. This is a use case that FormFix takes advantage of; for more information about when FormFix will request storage of data in form processing, see the FormFix help file.
- Lock the FormDefinition object
- Create a new DataItem object
See Storing Data and Operations > DataItem.
- Set the DataItem object’s Type string to “FormFix-Internal/”
- Write the current state of the FormDefinition object to persistent storage using the Write method
- Unlock the FormDefinition object
Load from Persistent Storage
- Load the FormSet object
- Get the FormDefinition object from the FormDefinitions collection of the FormSet object
- Call the Read method of the FormDefinition object
See Also