How to enable real document scanner in registration client

Below are detailed instructions on how to configure the default document scanner that comes with the registration client.

  1. In the registration client repository, navigate to the ref-impl directory. Inside there is a ref-document-scanner project that contains a sample scanner implementation using the Morena library. Compile this project into a jar.

  2. Download the license for the Morena library from https://www.gnome.sk/Morena/morena_try&buy.html.

  3. Take the ref-document-scanner and the morena-license.jar and put them into a zipped folder named custom-impl.zip. Take this zip file and add it to the artifactory project in the artifacts/src/impl folder.

  4. Modify the artifactory project’s docker file to include the path of the custom-impl zipped folder. I.e add the following code to the docker file on lines 74 and 166 respectively.

    # environment variable for custom-impl jar path ENV custom_zip_path=${base_path}/libs-release-local/impl COPY /src/impl/* ${custom_zip_path}/
  5. Finally, in the registration client deployment .yml file, add the name and URL of the custom-impl to the environment list.

  6. Build and deploy the artifactory project.

  7. Build and deploy the registration client.

  8. Next in mosip-config repository, in the file registration-default.properties enable real scanner detection by modifying the following property value from No to Yes.

    #Enable or Disable the Scanner Device for Document Scanning. mosip.registration.document_scanner_enabled=Yes
  9. Finally, ensure that the following properties have been added in the same registration-default.properties file. These properties can then be used to configure a scanner’s settings within the registration-client.

    #Document scanner setting mosip.registration.docscanner.id={ "id1" : "MORENA7:HP LJ M282M285 (USB)", "id2" : "STUB-SCANNER"} mosip.registration.docscanner.dpi={ "id1" : 75, "id2" : 1200} mosip.registration.docscanner.width={ "id1" : 600, "id2" : 1200} mosip.registration.docscanner.height={ "id1" : 800, "id2" : 1200}
  10. To confirm that the scanner is getting detected by the registration client, open the registration client, go to device settings, and scan for the document scanner. Simultaneously, go to the registration client log and search for the key phrase “connectedDevices >>>”. You should be able to see your device’s details including its ID listed here.