public async Task StartRecognizeIdentityDocumentsIncludeFieldElements() { var client = CreateFormRecognizerClient(); var options = new RecognizeIdentityDocumentsOptions() { IncludeFieldElements = true }; RecognizeIdentityDocumentsOperation operation; using var stream = FormRecognizerTestEnvironment.CreateStream(TestFile.DriverLicenseJpg); using (Recording.DisableRequestBodyRecording()) { operation = await client.StartRecognizeIdentityDocumentsAsync(stream, options); } RecognizedFormCollection recognizedForms = await operation.WaitForCompletionAsync(); var form = recognizedForms.Single(); ValidatePrebuiltForm( form, includeFieldElements: true, expectedFirstPageNumber: 1, expectedLastPageNumber: 1); }
public async Task ScanLocalCardId(string filePath) { using var stream = new FileStream(filePath, FileMode.Open); var options = new RecognizeIdentityDocumentsOptions() { ContentType = FormContentType.Jpeg }; RecognizeIdentityDocumentsOperation operation = await _client.StartRecognizeIdentityDocumentsAsync(stream, options); Response <RecognizedFormCollection> operationResponse = await operation.WaitForCompletionAsync(); RecognizedFormCollection identityDocuments = operationResponse.Value; RecognizedForm identityDocument = identityDocuments.Single(); }