Giter VIP home page Giter VIP logo

documentreader-web-java-client's Introduction

Regula Document Reader java client compatible with jvm and android

maven OpenAPI documentation live

Documents recognition as easy as reading two bytes.

If you have any problems with or questions about this client, please contact us through a GitHub issue. You are invited to contribute new features, fixes, or updates, large or small; We are always thrilled to receive pull requests, and do our best to process them as fast as we can. See dev guide

Install package

Add Regula Forensics, Inc. maven repository to repositories section in your build.gradle, and declare client as regular dependency.

repositories {
    maven {
        url = uri("https://maven.regulaforensics.com/RegulaDocumentReaderWebClient")
    }
}

dependencies {
    implementation("com.regula.documentreader:webclient:5.+")
}

Example

Performing request:

byte[] imageBytes = readFile("australia_passport.jpg");
var image = new ProcessRequestImage(imageBytes, Light.WHITE);

var requestParams = new RecognitionParams()
        .withScenario(Scenario.FULL_PROCESS)
        .withResultTypeOutput(Result.STATUS, Result.TEXT, Result.IMAGES);

RecognitionRequest request = new RecognitionRequest(requestParams, List.of(image));

var api = new DocumentReaderApi();
RecognitionResponse response = api.process(request);

Parsing results:

var status = response.status();
var docOverallStatus = status.getComplete() == CheckResult.OK ? "valid" : "not valid";
var docOpticalTextStatus = status.getDetailsOptical().getText();

var docNumberField = response.text().getField(DOCUMENT_NUMBER);
var docNumberMrz = docNumberField.getValue(Source.MRZ);
var docNumberMrzValidity = docNumberField.sourceValidity(Source.MRZ);
var docNumberMrzVisualMatching = docNumberField.crossSourceComparison(Source.MRZ, Source.VISUAL);

You can find a more detailed example in example folder.

documentreader-web-java-client's People

Contributors

actions-user avatar alexsatsukevich avatar alshund avatar andreipaulau avatar dangost avatar gubinalexander avatar hleb-albau avatar kirylkovaliov avatar regula-bot avatar vyakimchik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

documentreader-web-java-client's Issues

Add docreader version to TransactionInfo model in process response

docreader is returning version in TransactionInfo section in JSON (example from sample response below), but TransactionInfo model doesn't contain this information. I know that it is possible to obtain it within DeviceInfo model via ping endpoint, but it would be very useful to have this information for each processing response.

Example from sample response:

"TransactionInfo": {
    "ComputerName": "fc30e309c3b2",
    "DateTime": "2022-04-08T06:20:50.719Z",
    "SystemInfo": "Linux, fc30e309c3b2, 5.4.0-105-generic, #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022, x86_64",
    "TransactionID": "90ad213b-ff3d-415a-984d-fe36b04930df",
    "UserName": "",
    "Version": "6.2.157322.528"
  },

Jürgen Leonhardt observations

Original text

 There must be a bug in the code in updating the model in this project which references to https://github.com/regulaforensics/DocumentReader-web-openapi.git

1.

\DocumentReader-web-java-client\client\generator-templates\modelEnum.mustache must be replaced with the original version from OpenApi (https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/Java/modelEnum.mustache)

2.

\DocumentReader-web-openapi\rt-authenticity.yml (original file: https://github.com/regulaforensics/DocumentReader-web-openapi/blob/master/rt-authenticity.yml)

has wrong mapping, you need to replace the following line:

$ref: './authenticity/e-security-feature-type.yml#/components/schemas/SecurityFeatureType'

with

$ref: './authenticity/e-result-type.yml#/components/schemas/AuthenticityResultType'

3.

Java 11 has problems with threetenbp

You shoul change the file https://github.com/regulaforensics/DocumentReader-web-java-client/blob/master/java-generator-config.json

And add:

"dateLibrary": "java8",

to make use of java native date types

Mismatch of front and back page of document

Dear Team,

We are trying to pass two different images which belongs to different person (say front image id of person1, and then back image id of person2) for Regula "DocumentReaderApi".

After processing we are getting "CheckResult" as not ok. Is there any object/field can i refer that to get the appropriate issue. this would enhance our user experience alot.

artifact: webclient
version: 5.2.0

Thanks and Regards,
Kishore Kumar. K

api.process(request). Internal server error

Dear Support,
We’re trying to write a java client for the Document Reader Docker (regulaforensics/docreader:5.2.103350.2); however; am getting an internal server when calling the “api.process(request);”.
Also, I could see that the server logs is showing an exception on “flask/app.py” line 1950.
By the way, the default web page provided by the docker is working just fine.
Am using the same code found in the example on github: https://github.com/regulaforensics/DocumentReader-web-java-client/blob/master/example/src/main/java/com/regula/documentreader/webclient/example/Main.java (https://github.com/regulaforensics/DocumentReader-web-java-client/blob/master/example/src/main/java/com/regula/documentreader/webclient/example/Main.java)
documentreader-serverlog.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.