regulaforensics / Xamarin-DocumentReader

.NET MAUI (formerly Xamarin) Framework for reading and validation of identification documents
https://regulaforensics.com
11 stars 7 forks source link

Document position Height and Width returns null when multiplepageprocessing enabled #9

Closed Novotnde closed 3 years ago

Novotnde commented 3 years ago

Hello,

I have noticed that when using core Xamarin.DocumentReader.Core.Full.iOS above 5.2.3098... document position - height, width and page index will return null exception when processing both sides of document. I have tried the newest version 5.4.3840 and I still have the same issue.

I have only noticed this because I was package and kept on using 5.2.3098. However we recently purchased license for OCR and MRZ therefore I had to change the nuget in my solution for Xamarin.DocumentReader.Core.OcrAndMRZ.iOS and I am experiencing the same issue as mentioned above.

I am experiencing this issue with images as well as text fields, please see my sample code for returning text fields. Maybe I am doing something completely wrong here :)


if ( scanResult != null )
          {
            foreach ( var textField in scanResult.TextResult.Fields )
            {
              var data = new DocumentData();

              data.FieldDescriptor = textField.FieldName ;
              data.FieldValue =
              scanResult.GetTextFieldValueByType(textField.FieldType, textField.Lcid);
              data.FieldDataType = FieldDataTypes.Unknown;
              data.FieldIndex = (int) scanResult.DocumentPosition.PageIndex;
              var Height = scanResult.DocumentPosition.Size.Height;
              var Width = scanResult.DocumentPosition.Size.Width;
              var Angle = scanResult.DocumentPosition.Angle;
              foreach ( var docType in scanResult.DocumentType )
              {
                data.IdentificationType = docType.Name;
              };
              documentData.Add(data);
            }; 

Thank you

vyakimchik commented 3 years ago

Hello,

Height and width of images can be captured here: results.GraphicResult.Fields.BoundRect.

vyakimchik commented 3 years ago

Have you managed to get them?

Novotnde commented 3 years ago

hello,

yes thank you