https://github.com/regulaforensics/documentreader-web-csharp-client
Regula Document Reader web API c# client compatible with .NET & .NET Core
https://github.com/regulaforensics/documentreader-web-csharp-client
barcode barcode-scanner document-reader document-recognition idcard-check idcard-ocr mrz mrz-codes nuget ocr passport regula regulaforensics
Last synced: about 2 months ago
JSON representation
Regula Document Reader web API c# client compatible with .NET & .NET Core
- Host: GitHub
- URL: https://github.com/regulaforensics/documentreader-web-csharp-client
- Owner: regulaforensics
- Created: 2020-07-13T09:05:33.000Z (about 5 years ago)
- Default Branch: develop
- Last Pushed: 2025-07-07T10:23:27.000Z (3 months ago)
- Last Synced: 2025-07-07T10:26:18.250Z (3 months ago)
- Topics: barcode, barcode-scanner, document-reader, document-recognition, idcard-check, idcard-ocr, mrz, mrz-codes, nuget, ocr, passport, regula, regulaforensics
- Language: C#
- Homepage: https://regulaforensics.com
- Size: 7.53 MB
- Stars: 9
- Watchers: 5
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Regula.DocumentReader.WebClient - the C# library for the Regula Document Reader Web API
[](https://www.nuget.org/packages/Regula.DocumentReader.WebClient/)
[](https://github.com/regulaforensics/DocumentReader-web-openapi)
[](https://support.regulaforensics.com/hc/en-us/articles/115000916306-Documentation)
[](https://api.regulaforensics.com/)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](https://github.com/regulaforensics/DocumentReader-web-csharp-client/issues).
You are invited to contribute [new features, fixes, or updates](https://github.com/regulaforensics/DocumentReader-web-csharp-client/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22), large or small.
We are always thrilled to receive pull requests, and do our best to process them as fast as we can.## Frameworks supported
- .NET Standard 2.0
- .NET Framework 4.6.1 or later
- .Net Core 2.0 or later## Install package
`Regula.DocumentReader.WebClient` is on the NuGet Package Index:```bash
PM> Install-Package Regula.DocumentReader.WebClient -Version 5.2.0
```## Example
Performing request:
```csharp
var imageBytes = File.ReadAllBytes("australia_passport.jpg");
var image = new ProcessRequestImage(new ImageData(imageBytes), Light.WHITE);var requestParams = new RecognitionParams()
.WithScenario(Scenario.FULL_PROCESS)
.WithResultTypeOutput(new List { Result.STATUS, Result.TEXT, Result.IMAGES, Result.DOCUMENT_TYPE });
var request = new RecognitionRequest(requestParams, image);var api = licenseFromEnv != null
? new DocumentReaderApi(apiBaseUrl).WithLicense(licenseFromEnv)
: new DocumentReaderApi(apiBaseUrl).WithLicense(licenseFromFile);var response = api.Process(request);
```Parsing results:
```csharp
var response = api.Process(request);// status examples
var status = response.Status();
string docOverallStatus = status.OverallStatus == CheckResult.OK ? "valid" : "not valid";
string docOpticalTextStatus = status.DetailsOptical.Text == CheckResult.OK ? "valid" : "not valid";// text fields examples
var docNumberField = response.Text().GetField(TextFieldType.DOCUMENT_NUMBER);
string docNumberVisual = docNumberField.GetValue(Source.VISUAL);
string docNumberMrz = docNumberField.GetValue(Source.MRZ);
int docNumberVisualValidity = docNumberField.SourceValidity(Source.VISUAL);
int docNumberMrzValidity = docNumberField.SourceValidity(Source.MRZ);
int docNumberMrzVisualMatching = docNumberField.CrossSourceComparison(Source.MRZ, Source.VISUAL);// images fields examples
var documentImage = response.Images().GetField(GraphicFieldType.DOCUMENT_FRONT).GetValue();
var portraitField = response.Images().GetField(GraphicFieldType.PORTRAIT);
var portraitFromVisual = portraitField.GetValue(Source.VISUAL);
```
You can find this sample in [the example](https://github.com/regulaforensics/DocumentReader-web-csharp-client/tree/master/src/Regula.DocumentReader.NetCoreExample).