Class: kfxEngine

kfxCordova.kfxEngine()

new kfxEngine()

Methods

(static) createBundleCacheProvider(successCallback, errorCallback, filePath)

this method is used to get the instance of bundle cache provider with the specified path
Parameters:
Name Type Description
successCallback function Default Success call back function name
errorCallback function Default Error call back function name
filePath String Path to the folder where cached files should be stored.
See:
  • Check the 'errorCallback' method for any failures in case of unexpected behaviour of the method. Generally the error call back would return a JSON object with ErrorMsg & ErrorDesc' giving the description of the error.
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - KMC_SUCCESS success call back will contain the created bundleCacheProvider. errorCallback - error message would contain the appropriate error description.Possible error objects are Wrong Parameters,KmcRuntimeException,Exception.
Example
function successCallback(provider){

}
function errorCallback(error){
      alert(JSON.stringify(error));
}

var bundleProviderInstance = kfxCordova.kfxEngine.createBundleCacheProvider(successCallback,errorCallback,filePath);

(static) createGlareRemover()

this method is used to get the instance of glare remover
Example
var glareRemoverInstance = kfxCordova.kfxEngine.createGlareRemover();

(static) createImageArray()

this method is used to get the instance of image array
Example
var imageArrayInstance = kfxCordova.kfxEngine.createImageArray();

(static) createImageFromBase64(successCallback, errorCallback, base64String)

Method to convert an image in the form of base64string to a KEDImage. The KEDImage is stored in the ImageArray and the corresponding id is returned in the call back.
Parameters:
Name Type Description
successCallback function Default Success call back function name
errorCallback function Default Error call back function name
base64String String an input image in the form of base64 string to be converted to KEDImage
See:
  • Check the 'errorCallback' method for any failures in case of unexpected behaviour of the method. Generally the error call back would return a JSON object with ErrorMsg & ErrorDesc' giving the description of the error.
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - KMC_SUCCESS success call back will have the image id of the converted KEDImage(from input base64 string). errorCallback - error message would contain the appropriate error description.Possible error objects are Wrong Parameters,KmcRuntimeException,Exception.
Example
function successCallback(response){
      alert(JSON.stringify(response));
}
function errorCallback(error){
      alert(JSON.stringify(error));
}
var imageArray = kfxCordova.kfxEngine.createImageFromBase64(successCallback,errorCallback, 'base64string');

(static) createImageFromFilePath(successCallback, errorCallback, options)

Method to create and store a KEDImage in the ImageArray. The KEDImage is created from the image specified in the input file location.
Parameters:
Name Type Description
successCallback function Default Success call back function name
errorCallback function Default Error call back function name
options Object variable representing a physical location of an image which need to be converted to a KEDImage
Properties
Name Type Attributes Description
filePath String <optional>
This value specifies a physical location of an image.
See:
  • Check the 'errorCallback' method for any failures in case of unexpected behaviour of the method. Generally the error call back would return a JSON object with ErrorMsg & ErrorDesc' giving the description of the error.
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - KMC_SUCCESS success call back will have the image id of the converted KEDImage(from input image mentioned in the file path ) errorCallback - error message would contain the appropriate error description.Possible error objects are Wrong Parameters,KmcRuntimeException,Exception.
Example
function successCallback(response){
      alert(JSON.stringify(response));
}
function errorCallback(error){
      alert(JSON.stringify(error));
}
var externalDirectoryPath = cordova.file.externalRootDirectory;
var imageFilePath = externalDirectoryPath + "Download/myfile.jpg";

var imageArray = kfxCordova.kfxEngine.createImageFromFilePath(successCallback,errorCallback, {"filePath":imageFilePath});

(static) createImageObject()

this method is used to get the instance of image object
Example
var imageObjectInstance = kfxCordova.kfxEngine.createImageObject();

(static) createImageProcessor()

this method is used to get the instance of image processor
Example
var imageProcessorInstance = kfxCordova.kfxEngine.createImageProcessor();

(static) createLocalProjectProvider(successCallback, errorCallback, filePath)

this method is used to get the instance of local project provider
Parameters:
Name Type Description
successCallback function Default Success call back function name
errorCallback function Default Error call back function name
filePath String Path to the folder containing zip files.
See:
  • Check the 'errorCallback' method for any failures in case of unexpected behaviour of the method. Generally the error call back would return a JSON object with ErrorMsg & ErrorDesc' giving the description of the error.
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - KMC_SUCCESS success call back will contain the created localCacheProvider. errorCallback - error message would contain the appropriate error description.Possible error objects are Wrong Parameters,KmcRuntimeException,Exception.
Examples
function successCallback(provider){

}
function errorCallback(error){
      alert(JSON.stringify(error));
}
var localProviderInstance = kfxCordova.kfxEngine.createLocalProjectProvider(successCallback,errorCallback,filePath);

(static) createMRZResult(properties)

this method is used to get the instance of MRZ Result
Parameters:
Name Type Description
properties Object MRZ Result properties. Which are used to create the MRZ Result object.
Properties
Name Type Description
mrz String This value contains mrz raw data which is available on the document.
documentCode String This value contains document code.
issuingStateCode String This value contains issuing state code of the document.
documentNumber String This value contains document number of the document.
personalNumber String This value contains personal number of the document.
gender String This value contains gender information.
givenNames String This value contains given name.
surname String This value contains sur name.
nationalityCode String This value contains nationality code.
dateOfBirth String This value contains the date of birth which is in "YYMMDD" format.
dateOfExpiry String This value contains the date of expiration of the document which is in "YYMMDD" format.
Example
var properties = {
     mrz:"MRZ Data",
     documentCode:"Document Code",
     issuingStateCode: "Issuing State Code",
     documentNumber: "Document Number",
     personalNumber: "Personal Number",
     gender: "Gender",
     givenNames: "Given Names",
     surname: "Surname",
     nationalityCode: "Nationality Code",
     dateOfBirth: "Date of Birth"
};
var mrzResultInstance = kfxCordova.kfxEngine.createMRZResult(properties);

(static) createNFCTagData(properties)

this method is used to get the instance of NFC Tag Data
Parameters:
Name Type Description
properties Object NFC Tag Data properties. Which are used to create NFC Tag Data object.
Properties
Name Type Description
mrzResult MRZResult This mrz result will have information like document code, issuing code, given name and document number etc.
faceImage String It is a base64 string. Which contains the high quality face image which is available in NFC chip.
documentSecurityObject ArrayBuffer This contains document security object data.his will be the documentSecurityObject from the Passport and will be used to do a certificate validation externally.
Example
var properties = {
     mrzResult: kfxCordova.kfxEngine.createMRZResult(),
     faceImage: "Face Image Base64 string",
     documentSecurityObject: "Document Security Array Buffer Object"
};
var nfcTagDataInstance = kfxCordova.kfxEngine.createNFCTagData(properties);

(static) createNFCTagParameters(properties)

this method is used to get the instance of NFC Tag Parameters
Parameters:
Name Type Description
properties Object NFC Tag Parameters properties. Which are used to create NFC Tag Parameters object.
Properties
Name Type Description
idNumber String Document Id Number.
expirationDate String Document Expiration Date. It should be in "YYDDMM" format.
dateOfBirth String Date of Birth in the Document. It should be in "YYDDMM" format.
Example
var properties = {
     idNumber : "Document Id Number",
     expirationDate : "Expiration Date",
     dateOfBirth : "Date Of Birth"
};
var nfcTagParametersInstance = kfxCordova.kfxEngine.createNFCTagParameters(properties);

(static) createNFCTagReader()

this method is used to get the instance of NFC Tag Reader
Example
var nfcTagReaderInstance = kfxCordova.kfxEngine.createNFCTagReader();

(static) createOnDeviceExtraction()

this method is used to get the instance of on device extraction
Example
var onDeviceExtractionInstance = kfxCordova.kfxEngine.createOnDeviceExtraction();

(static) createQuickExtractor()

this method is used to get the instance of Quick Extractor
Example
var quickExtractorInstance = kfxCordova.kfxEngine.createQuickExtractor();

(static) createServerProjectProvider(successCallback, errorCallback, serverUrl-Initializes)

this method is used to get the instance of server project provider
Parameters:
Name Type Description
successCallback function Default Success call back function name
errorCallback function Default Error call back function name
serverUrl-Initializes String the object with server URL.
See:
  • Check the 'errorCallback' method for any failures in case of unexpected behaviour of the method. Generally the error call back would return a JSON object with ErrorMsg & ErrorDesc' giving the description of the error.
Returns:
The return value is captured in the 'successCallback' for a successful operation, and might return in 'errorCallback' for an incomplete/invalid operation. Returns the following values in the corresponding functions successCallback - KMC_SUCCESS success call back will contain the created serverCacheProvider. errorCallback - error message would contain the appropriate error description.Possible error objects are Wrong Parameters,KmcRuntimeException,Exception.
Examples
function successCallback(provider){
}
function errorCallback(error){
      alert(JSON.stringify(error));
}
var serverProviderInstance = kfxCordova.kfxEngine.createServerProjectProvider(successCallback,errorCallback,serverUrl);