Adding FlexiCapture SDK library to a Java project
ABBYY FlexiCapture SDK includes the com.abbyy.FCEngine.jar file, which contains the Java class library for FlexiCapture SDK. You can find it in the Inc\Java folder. The path to this file can be specified in classpath parameter in the command line and in projects settings in different Java development environments. For example:Loading and unloading FlexiCapture SDK
To load the Engine object, you can use the static Engine class:- Use its Load method to load FlexiCapture SDK, and Unload method – to unload it. This way is identical to the standard way of loading and unloading the Engine object.
- Use its CreateEngineInprocLoader or CreateEngineOutprocLoader methods to load Engine by means of COM. See the description of the IEngineLoader interface for details. If you use the CreateEngineOutprocLoader method for loading, you do not need to call IWorkProcessControl::SetParentProcessId method, because it is done automatically.
Method | Signature | Comment |
|---|---|---|
MarshalInterface | | Calls the CoMarshalInterface COM function to marshal the IEngine interface. This method should be called on the thread where the engine was created, to ensure that the data needed for creating a proxy object on another thread will be available. Returns the handle to the marshaling data. |
UnmarshalInterface | | Calls the CoUnmarshalInterface COM function to unmarshal the IEngine interface, i.e. create a proxy object with which the client process will be able to interact in the same way as with the engine itself. Takes the handle to the marshaling data (returned by the MarshalInterface method) as the input parameter and returns a pointer to the IEngine interface. |
Calling methods with out-parameters
There are several methods in ABBYY FlexiCapture SDK which have out-parameters that receive a new value after the method call and must be passed by reference. These parameters are marked in the type library and in descriptions of methods in this Developer’s Help as [out] or [in, out]. When working with ABBYY FlexiCapture SDK in Java, you have to use a special Ref class to pass a parameter by reference. See examples below. Example in which the out-parameters are passed by reference to the IReadStream::Read method:Sample code for out-parameters
Sample code for out-parameters
