FormRecognizerClient.beginRecognizeContentFromUrl Method

Definition

Overloads

beginRecognizeContentFromUrl(String formUrl)

Recognizes content/layout data from documents using optical character recognition (OCR).

The service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.

Code sample

String formUrl = "{form_url}";
 formRecognizerClient.beginRecognizeContentFromUrl(formUrl)
     .getFinalResult()
     .forEach(formPage -> {
         System.out.printf("Page Angle: %s%n", formPage.getTextAngle());
         System.out.printf("Page Dimension unit: %s%n", formPage.getUnit());
         // Table information
         System.out.println("Recognized Tables: ");
         formPage.getTables()
             .stream()
             .flatMap(formTable -> formTable.getCells().stream())
             .forEach(recognizedTableCell -> System.out.printf("%s ", recognizedTableCell.getText()));
     });
beginRecognizeContentFromUrl(String formUrl, RecognizeContentOptions recognizeContentOptions, Context context)

Recognizes content/layout data using optical character recognition (OCR).

The service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.

Code sample

String formPath = "{file_source_url}";
 formRecognizerClient.beginRecognizeContentFromUrl(formPath,
     new RecognizeContentOptions()
         .setPollInterval(Duration.ofSeconds(5)), Context.NONE)
     .getFinalResult()
     .forEach(formPage -> {
         System.out.printf("Page Angle: %s%n", formPage.getTextAngle());
         System.out.printf("Page Dimension unit: %s%n", formPage.getUnit());
         // Table information
         System.out.println("Recognized Tables: ");
         formPage.getTables()
             .stream()
             .flatMap(formTable -> formTable.getCells().stream())
             .forEach(recognizedTableCell -> System.out.printf("%s ", recognizedTableCell.getText()));
     });

beginRecognizeContentFromUrl(String formUrl)

Recognizes content/layout data from documents using optical character recognition (OCR).

The service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.

Code sample

String formUrl = "{form_url}";
 formRecognizerClient.beginRecognizeContentFromUrl(formUrl)
     .getFinalResult()
     .forEach(formPage -> {
         System.out.printf("Page Angle: %s%n", formPage.getTextAngle());
         System.out.printf("Page Dimension unit: %s%n", formPage.getUnit());
         // Table information
         System.out.println("Recognized Tables: ");
         formPage.getTables()
             .stream()
             .flatMap(formTable -> formTable.getCells().stream())
             .forEach(recognizedTableCell -> System.out.printf("%s ", recognizedTableCell.getText()));
     });
public SyncPoller<FormRecognizerOperationResult,List<FormPage>> beginRecognizeContentFromUrl(String formUrl)

Parameters

formUrl
java.lang.String

The URL of the form to analyze.

Returns

A SyncPoller<T,U> that polls the recognize content form operation until it has completed, has failed, or has been cancelled. The completed operation returns a List of FormPage.

beginRecognizeContentFromUrl(String formUrl, RecognizeContentOptions recognizeContentOptions, Context context)

Recognizes content/layout data using optical character recognition (OCR).

The service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.

Code sample

String formPath = "{file_source_url}";
 formRecognizerClient.beginRecognizeContentFromUrl(formPath,
     new RecognizeContentOptions()
         .setPollInterval(Duration.ofSeconds(5)), Context.NONE)
     .getFinalResult()
     .forEach(formPage -> {
         System.out.printf("Page Angle: %s%n", formPage.getTextAngle());
         System.out.printf("Page Dimension unit: %s%n", formPage.getUnit());
         // Table information
         System.out.println("Recognized Tables: ");
         formPage.getTables()
             .stream()
             .flatMap(formTable -> formTable.getCells().stream())
             .forEach(recognizedTableCell -> System.out.printf("%s ", recognizedTableCell.getText()));
     });
public SyncPoller<FormRecognizerOperationResult,List<FormPage>> beginRecognizeContentFromUrl(String formUrl, RecognizeContentOptions recognizeContentOptions, Context context)

Parameters

formUrl
java.lang.String

The source URL to the input form.

recognizeContentOptions
RecognizeContentOptions

The additional configurable RecognizeContentOptions that may be passed when recognizing content/layout on a form.

context
Context

Additional context that is passed through the HTTP pipeline during the service call.

Returns

A SyncPoller<T,U> that polls the recognize layout operation until it has completed, has failed, or has been cancelled. The completed operation returns a List of FormPage.

Applies to