Skip to content

Document Processing on a Web Service

To get the maximum performance and ease the document processing on a mobile side, you can perform the document processing on the Document Reader Web API.

graph LR
  A(Mobile SDK) --->|Request| B(Web API Service);
  B --->|Response| A;

Benefits:

  • Document processing is passed faster. 🚀
  • Size of the mobile application becomes as little as nothing. 🤯
  • There is no need to have your own backend - the document processing can be performed on our public one. Using it, you accept our Privacy Policy. Otherwise, use yours. 🎉

Usage

Set Up

To process the document on the Web API service, it's enough to specify the processing mode to be used by the Mobile SDK, and then pass it to the configuration object:

let config = DocReader.OnlineProcessingConfig(mode: .manual)
DocReader.shared.functionality.onlineProcessingConfig = config

By default, the FullProcess scenario is used to proces the document on the Web API service. You can change it, and/or turn on/off other configuration settings in the processParams property passing it to the configutation object.

The RGLOnlineProcessingModeManual mode of processing means that the document processing has to be performed fully on the Web API service, while Mobile SDK is used only to capture document images, and then pass it to the service.

The RGLOnlineProcessingModeAuto mode of processing means that the document processing has to be performed on the mobile side and then on the Web API service as well. In this case, you need to add the Core framework as a part of the Document Reader SDK, add the database, if applicable, and perform the initialization afterwards.

Start the Processing

Now, you can start the document processing:

DocReader.shared.showScanner(self) { action, results, error in
    if action == .complete || action == .processTimeout {
        print(results ?? "nil")
    }

    if action == .error {
        print(error?.localizedDescription ?? "nil")
    }
}

See other options of the document processing here.

Processing Modes

RGLOnlineProcessingModeManual

  • There is no need to add the Core framework.
  • There is no need to add the database.
  • There is no need to perform the initialization process.
  • The processing is performed fully on the backend.

 

RGLOnlineProcessingModeAuto

  • Add the Core framework.
  • Add the database, if applicable.
  • Perform the initialization process.
  • The processing is performed on both mobile and web sides.

Next Steps