AWSTextract Class Reference

Inherits from AWSService : NSObject
Declared in AWSTextractService.h
AWSTextractService.m

Overview

Amazon Textract detects and analyzes text in documents and converts it into machine-readable text. This is the API reference documentation for Amazon Textract.

Other Methods

+ defaultTextract

Returns the singleton service client. If the singleton object does not exist, the SDK instantiates the default service client with defaultServiceConfiguration from [AWSServiceManager defaultServiceManager]. The reference to this object is maintained by the SDK, and you do not need to retain it manually.

+ (instancetype)defaultTextract

Return Value

The default service client.

Discussion

For example, set the default service configuration in - application:didFinishLaunchingWithOptions:

Swift

 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    let credentialProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: "YourIdentityPoolId")
    let configuration = AWSServiceConfiguration(region: .USEast1, credentialsProvider: credentialProvider)
    AWSServiceManager.default().defaultServiceConfiguration = configuration

    return true
}

Objective-C

 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
      AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1
                                                                                                      identityPoolId:@"YourIdentityPoolId"];
      AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSEast1
                                                                           credentialsProvider:credentialsProvider];
      [AWSServiceManager defaultServiceManager].defaultServiceConfiguration = configuration;

      return YES;
  }

Then call the following to get the default service client:

Swift

 let Textract = AWSTextract.default()

Objective-C

 AWSTextract *Textract = [AWSTextract defaultTextract];

Declared In

AWSTextractService.h

+ registerTextractWithConfiguration:forKey:

Creates a service client with the given service configuration and registers it for the key.

+ (void)registerTextractWithConfiguration:(AWSServiceConfiguration *)configuration forKey:(NSString *)key

Parameters

configuration

A service configuration object.

key

A string to identify the service client.

Discussion

For example, set the default service configuration in - application:didFinishLaunchingWithOptions:

Swift

 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    let credentialProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: "YourIdentityPoolId")
    let configuration = AWSServiceConfiguration(region: .USWest2, credentialsProvider: credentialProvider)
    AWSTextract.register(with: configuration!, forKey: "USWest2Textract")

    return true
}

Objective-C

 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
     AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1
                                                                                                     identityPoolId:@"YourIdentityPoolId"];
     AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSWest2
                                                                          credentialsProvider:credentialsProvider];

     [AWSTextract registerTextractWithConfiguration:configuration forKey:@"USWest2Textract"];

     return YES;
 }

Then call the following to get the service client:

Swift

 let Textract = AWSTextract(forKey: "USWest2Textract")

Objective-C

 AWSTextract *Textract = [AWSTextract TextractForKey:@"USWest2Textract"];

Warning: After calling this method, do not modify the configuration object. It may cause unspecified behaviors.

Declared In

AWSTextractService.h

+ TextractForKey:

Retrieves the service client associated with the key. You need to call + registerTextractWithConfiguration:forKey: before invoking this method.

+ (instancetype)TextractForKey:(NSString *)key

Parameters

key

A string to identify the service client.

Return Value

An instance of the service client.

Discussion

For example, set the default service configuration in - application:didFinishLaunchingWithOptions:

Swift

 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    let credentialProvider = AWSCognitoCredentialsProvider(regionType: .USEast1, identityPoolId: "YourIdentityPoolId")
    let configuration = AWSServiceConfiguration(region: .USWest2, credentialsProvider: credentialProvider)
    AWSTextract.register(with: configuration!, forKey: "USWest2Textract")

    return true
}

Objective-C

 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
     AWSCognitoCredentialsProvider *credentialsProvider = [[AWSCognitoCredentialsProvider alloc] initWithRegionType:AWSRegionUSEast1
                                                                                                     identityPoolId:@"YourIdentityPoolId"];
     AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:AWSRegionUSWest2
                                                                          credentialsProvider:credentialsProvider];

     [AWSTextract registerTextractWithConfiguration:configuration forKey:@"USWest2Textract"];

     return YES;
 }

Then call the following to get the service client:

Swift

 let Textract = AWSTextract(forKey: "USWest2Textract")

Objective-C

 AWSTextract *Textract = [AWSTextract TextractForKey:@"USWest2Textract"];

Declared In

AWSTextractService.h

+ removeTextractForKey:

Removes the service client associated with the key and release it.

+ (void)removeTextractForKey:(NSString *)key

Parameters

key

A string to identify the service client.

Discussion

Warning: Before calling this method, make sure no method is running on this client.

Declared In

AWSTextractService.h

– analyzeDocument:

Analyzes an input document for relationships between detected items.

The types of information returned are as follows:

  • Words and lines that are related to nearby lines and words. The related information is returned in two Block objects each of type KEY_VALUE_SET: a KEY Block object and a VALUE Block object. For example, Name: Ana Silva Carolina contains a key and value. Name: is the key. Ana Silva Carolina is the value.

  • Table and table cell data. A TABLE Block object contains information about a detected table. A CELL Block object is returned for each cell in a table.

  • Selectable elements such as checkboxes and radio buttons. A SELECTION_ELEMENT Block object contains information about a selectable element.

  • Lines and words of text. A LINE Block object contains one or more WORD Block objects.

You can choose which type of analysis to perform by specifying the FeatureTypes list.

The output is returned in a list of BLOCK objects.

AnalyzeDocument is a synchronous operation. To analyze documents asynchronously, use StartDocumentAnalysis.

For more information, see Document Text Analysis.

- (AWSTask<AWSTextractAnalyzeDocumentResponse*> *)analyzeDocument:(AWSTextractAnalyzeDocumentRequest *)request

Parameters

request

A container for the necessary parameters to execute the AnalyzeDocument service method.

Return Value

An instance of AWSTask. On successful execution, task.result will contain an instance of AWSTextractAnalyzeDocumentResponse. On failed execution, task.error may contain an NSError with AWSTextractErrorDomain domain and the following error code: AWSTextractErrorInvalidParameter, AWSTextractErrorInvalidS3Object, AWSTextractErrorUnsupportedDocument, AWSTextractErrorDocumentTooLarge, AWSTextractErrorBadDocument, AWSTextractErrorAccessDenied, AWSTextractErrorProvisionedThroughputExceeded, AWSTextractErrorInternalServer, AWSTextractErrorThrottling.

Declared In

AWSTextractService.h

– analyzeDocument:completionHandler:

Analyzes an input document for relationships between detected items.

The types of information returned are as follows:

  • Words and lines that are related to nearby lines and words. The related information is returned in two Block objects each of type KEY_VALUE_SET: a KEY Block object and a VALUE Block object. For example, Name: Ana Silva Carolina contains a key and value. Name: is the key. Ana Silva Carolina is the value.

  • Table and table cell data. A TABLE Block object contains information about a detected table. A CELL Block object is returned for each cell in a table.

  • Selectable elements such as checkboxes and radio buttons. A SELECTION_ELEMENT Block object contains information about a selectable element.

  • Lines and words of text. A LINE Block object contains one or more WORD Block objects.

You can choose which type of analysis to perform by specifying the FeatureTypes list.

The output is returned in a list of BLOCK objects.

AnalyzeDocument is a synchronous operation. To analyze documents asynchronously, use StartDocumentAnalysis.

For more information, see Document Text Analysis.

- (void)analyzeDocument:(AWSTextractAnalyzeDocumentRequest *)request completionHandler:(void ( ^ ) ( AWSTextractAnalyzeDocumentResponse *response , NSError *error ))completionHandler

Parameters

request

A container for the necessary parameters to execute the AnalyzeDocument service method.

completionHandler

The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSTextractErrorDomain domain and the following error code: AWSTextractErrorInvalidParameter, AWSTextractErrorInvalidS3Object, AWSTextractErrorUnsupportedDocument, AWSTextractErrorDocumentTooLarge, AWSTextractErrorBadDocument, AWSTextractErrorAccessDenied, AWSTextractErrorProvisionedThroughputExceeded, AWSTextractErrorInternalServer, AWSTextractErrorThrottling.

Declared In

AWSTextractService.h

– detectDocumentText:

Detects text in the input document. Amazon Textract can detect lines of text and the words that make up a line of text. The input document must be an image in JPG or PNG format. DetectDocumentText returns the detected text in an array of Block objects.

Each document page has as an associated Block of type PAGE. Each PAGE Block object is the parent of LINE Block objects that represent the lines of detected text on a page. A LINE Block object is a parent for each word that makes up the line. Words are represented by Block objects of type WORD.

DetectDocumentText is a synchronous operation. To analyze documents asynchronously, use StartDocumentTextDetection.

For more information, see Document Text Detection.

- (AWSTask<AWSTextractDetectDocumentTextResponse*> *)detectDocumentText:(AWSTextractDetectDocumentTextRequest *)request

Parameters

request

A container for the necessary parameters to execute the DetectDocumentText service method.

Return Value

An instance of AWSTask. On successful execution, task.result will contain an instance of AWSTextractDetectDocumentTextResponse. On failed execution, task.error may contain an NSError with AWSTextractErrorDomain domain and the following error code: AWSTextractErrorInvalidParameter, AWSTextractErrorInvalidS3Object, AWSTextractErrorUnsupportedDocument, AWSTextractErrorDocumentTooLarge, AWSTextractErrorBadDocument, AWSTextractErrorAccessDenied, AWSTextractErrorProvisionedThroughputExceeded, AWSTextractErrorInternalServer, AWSTextractErrorThrottling.

Declared In

AWSTextractService.h

– detectDocumentText:completionHandler:

Detects text in the input document. Amazon Textract can detect lines of text and the words that make up a line of text. The input document must be an image in JPG or PNG format. DetectDocumentText returns the detected text in an array of Block objects.

Each document page has as an associated Block of type PAGE. Each PAGE Block object is the parent of LINE Block objects that represent the lines of detected text on a page. A LINE Block object is a parent for each word that makes up the line. Words are represented by Block objects of type WORD.

DetectDocumentText is a synchronous operation. To analyze documents asynchronously, use StartDocumentTextDetection.

For more information, see Document Text Detection.

- (void)detectDocumentText:(AWSTextractDetectDocumentTextRequest *)request completionHandler:(void ( ^ ) ( AWSTextractDetectDocumentTextResponse *response , NSError *error ))completionHandler

Parameters

request

A container for the necessary parameters to execute the DetectDocumentText service method.

completionHandler

The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSTextractErrorDomain domain and the following error code: AWSTextractErrorInvalidParameter, AWSTextractErrorInvalidS3Object, AWSTextractErrorUnsupportedDocument, AWSTextractErrorDocumentTooLarge, AWSTextractErrorBadDocument, AWSTextractErrorAccessDenied, AWSTextractErrorProvisionedThroughputExceeded, AWSTextractErrorInternalServer, AWSTextractErrorThrottling.

Declared In

AWSTextractService.h

– getDocumentAnalysis:

Gets the results for an Amazon Textract asynchronous operation that analyzes text in a document.

You start asynchronous text analysis by calling StartDocumentAnalysis, which returns a job identifier (JobId). When the text analysis operation finishes, Amazon Textract publishes a completion status to the Amazon Simple Notification Service (Amazon SNS) topic that's registered in the initial call to StartDocumentAnalysis. To get the results of the text-detection operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED. If so, call GetDocumentAnalysis, and pass the job identifier (JobId) from the initial call to StartDocumentAnalysis.

GetDocumentAnalysis returns an array of Block objects. The following types of information are returned:

  • Words and lines that are related to nearby lines and words. The related information is returned in two Block objects each of type KEY_VALUE_SET: a KEY Block object and a VALUE Block object. For example, Name: Ana Silva Carolina contains a key and value. Name: is the key. Ana Silva Carolina is the value.

  • Table and table cell data. A TABLE Block object contains information about a detected table. A CELL Block object is returned for each cell in a table.

  • Selectable elements such as checkboxes and radio buttons. A SELECTION_ELEMENT Block object contains information about a selectable element.

  • Lines and words of text. A LINE Block object contains one or more WORD Block objects.

Use the MaxResults parameter to limit the number of blocks returned. If there are more results than specified in MaxResults, the value of NextToken in the operation response contains a pagination token for getting the next set of results. To get the next page of results, call GetDocumentAnalysis, and populate the NextToken request parameter with the token value that's returned from the previous call to GetDocumentAnalysis.

For more information, see Document Text Analysis.

- (AWSTask<AWSTextractGetDocumentAnalysisResponse*> *)getDocumentAnalysis:(AWSTextractGetDocumentAnalysisRequest *)request

Parameters

request

A container for the necessary parameters to execute the GetDocumentAnalysis service method.

Return Value

An instance of AWSTask. On successful execution, task.result will contain an instance of AWSTextractGetDocumentAnalysisResponse. On failed execution, task.error may contain an NSError with AWSTextractErrorDomain domain and the following error code: AWSTextractErrorInvalidParameter, AWSTextractErrorAccessDenied, AWSTextractErrorProvisionedThroughputExceeded, AWSTextractErrorInvalidJobId, AWSTextractErrorInternalServer, AWSTextractErrorThrottling.

Declared In

AWSTextractService.h

– getDocumentAnalysis:completionHandler:

Gets the results for an Amazon Textract asynchronous operation that analyzes text in a document.

You start asynchronous text analysis by calling StartDocumentAnalysis, which returns a job identifier (JobId). When the text analysis operation finishes, Amazon Textract publishes a completion status to the Amazon Simple Notification Service (Amazon SNS) topic that's registered in the initial call to StartDocumentAnalysis. To get the results of the text-detection operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED. If so, call GetDocumentAnalysis, and pass the job identifier (JobId) from the initial call to StartDocumentAnalysis.

GetDocumentAnalysis returns an array of Block objects. The following types of information are returned:

  • Words and lines that are related to nearby lines and words. The related information is returned in two Block objects each of type KEY_VALUE_SET: a KEY Block object and a VALUE Block object. For example, Name: Ana Silva Carolina contains a key and value. Name: is the key. Ana Silva Carolina is the value.

  • Table and table cell data. A TABLE Block object contains information about a detected table. A CELL Block object is returned for each cell in a table.

  • Selectable elements such as checkboxes and radio buttons. A SELECTION_ELEMENT Block object contains information about a selectable element.

  • Lines and words of text. A LINE Block object contains one or more WORD Block objects.

Use the MaxResults parameter to limit the number of blocks returned. If there are more results than specified in MaxResults, the value of NextToken in the operation response contains a pagination token for getting the next set of results. To get the next page of results, call GetDocumentAnalysis, and populate the NextToken request parameter with the token value that's returned from the previous call to GetDocumentAnalysis.

For more information, see Document Text Analysis.

- (void)getDocumentAnalysis:(AWSTextractGetDocumentAnalysisRequest *)request completionHandler:(void ( ^ ) ( AWSTextractGetDocumentAnalysisResponse *response , NSError *error ))completionHandler

Parameters

request

A container for the necessary parameters to execute the GetDocumentAnalysis service method.

completionHandler

The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSTextractErrorDomain domain and the following error code: AWSTextractErrorInvalidParameter, AWSTextractErrorAccessDenied, AWSTextractErrorProvisionedThroughputExceeded, AWSTextractErrorInvalidJobId, AWSTextractErrorInternalServer, AWSTextractErrorThrottling.

Declared In

AWSTextractService.h

– getDocumentTextDetection:

Gets the results for an Amazon Textract asynchronous operation that detects text in a document. Amazon Textract can detect lines of text and the words that make up a line of text.

You start asynchronous text detection by calling StartDocumentTextDetection, which returns a job identifier (JobId). When the text detection operation finishes, Amazon Textract publishes a completion status to the Amazon Simple Notification Service (Amazon SNS) topic that's registered in the initial call to StartDocumentTextDetection. To get the results of the text-detection operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED. If so, call GetDocumentTextDetection, and pass the job identifier (JobId) from the initial call to StartDocumentTextDetection.

GetDocumentTextDetection returns an array of Block objects.

Each document page has as an associated Block of type PAGE. Each PAGE Block object is the parent of LINE Block objects that represent the lines of detected text on a page. A LINE Block object is a parent for each word that makes up the line. Words are represented by Block objects of type WORD.

Use the MaxResults parameter to limit the number of blocks that are returned. If there are more results than specified in MaxResults, the value of NextToken in the operation response contains a pagination token for getting the next set of results. To get the next page of results, call GetDocumentTextDetection, and populate the NextToken request parameter with the token value that's returned from the previous call to GetDocumentTextDetection.

For more information, see Document Text Detection.

- (AWSTask<AWSTextractGetDocumentTextDetectionResponse*> *)getDocumentTextDetection:(AWSTextractGetDocumentTextDetectionRequest *)request

Parameters

request

A container for the necessary parameters to execute the GetDocumentTextDetection service method.

Return Value

An instance of AWSTask. On successful execution, task.result will contain an instance of AWSTextractGetDocumentTextDetectionResponse. On failed execution, task.error may contain an NSError with AWSTextractErrorDomain domain and the following error code: AWSTextractErrorInvalidParameter, AWSTextractErrorAccessDenied, AWSTextractErrorProvisionedThroughputExceeded, AWSTextractErrorInvalidJobId, AWSTextractErrorInternalServer, AWSTextractErrorThrottling.

Declared In

AWSTextractService.h

– getDocumentTextDetection:completionHandler:

Gets the results for an Amazon Textract asynchronous operation that detects text in a document. Amazon Textract can detect lines of text and the words that make up a line of text.

You start asynchronous text detection by calling StartDocumentTextDetection, which returns a job identifier (JobId). When the text detection operation finishes, Amazon Textract publishes a completion status to the Amazon Simple Notification Service (Amazon SNS) topic that's registered in the initial call to StartDocumentTextDetection. To get the results of the text-detection operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED. If so, call GetDocumentTextDetection, and pass the job identifier (JobId) from the initial call to StartDocumentTextDetection.

GetDocumentTextDetection returns an array of Block objects.

Each document page has as an associated Block of type PAGE. Each PAGE Block object is the parent of LINE Block objects that represent the lines of detected text on a page. A LINE Block object is a parent for each word that makes up the line. Words are represented by Block objects of type WORD.

Use the MaxResults parameter to limit the number of blocks that are returned. If there are more results than specified in MaxResults, the value of NextToken in the operation response contains a pagination token for getting the next set of results. To get the next page of results, call GetDocumentTextDetection, and populate the NextToken request parameter with the token value that's returned from the previous call to GetDocumentTextDetection.

For more information, see Document Text Detection.

- (void)getDocumentTextDetection:(AWSTextractGetDocumentTextDetectionRequest *)request completionHandler:(void ( ^ ) ( AWSTextractGetDocumentTextDetectionResponse *response , NSError *error ))completionHandler

Parameters

request

A container for the necessary parameters to execute the GetDocumentTextDetection service method.

completionHandler

The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSTextractErrorDomain domain and the following error code: AWSTextractErrorInvalidParameter, AWSTextractErrorAccessDenied, AWSTextractErrorProvisionedThroughputExceeded, AWSTextractErrorInvalidJobId, AWSTextractErrorInternalServer, AWSTextractErrorThrottling.

Declared In

AWSTextractService.h

– startDocumentAnalysis:

Starts asynchronous analysis of an input document for relationships between detected items such as key and value pairs, tables, and selection elements.

StartDocumentAnalysis can analyze text in documents that are in JPG, PNG, and PDF format. The documents are stored in an Amazon S3 bucket. Use DocumentLocation to specify the bucket name and file name of the document.

StartDocumentAnalysis returns a job identifier (JobId) that you use to get the results of the operation. When text analysis is finished, Amazon Textract publishes a completion status to the Amazon Simple Notification Service (Amazon SNS) topic that you specify in NotificationChannel. To get the results of the text analysis operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED. If so, call GetDocumentAnalysis, and pass the job identifier (JobId) from the initial call to StartDocumentAnalysis.

For more information, see Document Text Analysis.

- (AWSTask<AWSTextractStartDocumentAnalysisResponse*> *)startDocumentAnalysis:(AWSTextractStartDocumentAnalysisRequest *)request

Parameters

request

A container for the necessary parameters to execute the StartDocumentAnalysis service method.

Return Value

An instance of AWSTask. On successful execution, task.result will contain an instance of AWSTextractStartDocumentAnalysisResponse. On failed execution, task.error may contain an NSError with AWSTextractErrorDomain domain and the following error code: AWSTextractErrorInvalidParameter, AWSTextractErrorInvalidS3Object, AWSTextractErrorUnsupportedDocument, AWSTextractErrorDocumentTooLarge, AWSTextractErrorBadDocument, AWSTextractErrorAccessDenied, AWSTextractErrorProvisionedThroughputExceeded, AWSTextractErrorInternalServer, AWSTextractErrorIdempotentParameterMismatch, AWSTextractErrorThrottling, AWSTextractErrorLimitExceeded.

Declared In

AWSTextractService.h

– startDocumentAnalysis:completionHandler:

Starts asynchronous analysis of an input document for relationships between detected items such as key and value pairs, tables, and selection elements.

StartDocumentAnalysis can analyze text in documents that are in JPG, PNG, and PDF format. The documents are stored in an Amazon S3 bucket. Use DocumentLocation to specify the bucket name and file name of the document.

StartDocumentAnalysis returns a job identifier (JobId) that you use to get the results of the operation. When text analysis is finished, Amazon Textract publishes a completion status to the Amazon Simple Notification Service (Amazon SNS) topic that you specify in NotificationChannel. To get the results of the text analysis operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED. If so, call GetDocumentAnalysis, and pass the job identifier (JobId) from the initial call to StartDocumentAnalysis.

For more information, see Document Text Analysis.

- (void)startDocumentAnalysis:(AWSTextractStartDocumentAnalysisRequest *)request completionHandler:(void ( ^ ) ( AWSTextractStartDocumentAnalysisResponse *response , NSError *error ))completionHandler

Parameters

request

A container for the necessary parameters to execute the StartDocumentAnalysis service method.

completionHandler

The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSTextractErrorDomain domain and the following error code: AWSTextractErrorInvalidParameter, AWSTextractErrorInvalidS3Object, AWSTextractErrorUnsupportedDocument, AWSTextractErrorDocumentTooLarge, AWSTextractErrorBadDocument, AWSTextractErrorAccessDenied, AWSTextractErrorProvisionedThroughputExceeded, AWSTextractErrorInternalServer, AWSTextractErrorIdempotentParameterMismatch, AWSTextractErrorThrottling, AWSTextractErrorLimitExceeded.

Declared In

AWSTextractService.h

– startDocumentTextDetection:

Starts the asynchronous detection of text in a document. Amazon Textract can detect lines of text and the words that make up a line of text.

StartDocumentTextDetection can analyze text in documents that are in JPG, PNG, and PDF format. The documents are stored in an Amazon S3 bucket. Use DocumentLocation to specify the bucket name and file name of the document.

StartTextDetection returns a job identifier (JobId) that you use to get the results of the operation. When text detection is finished, Amazon Textract publishes a completion status to the Amazon Simple Notification Service (Amazon SNS) topic that you specify in NotificationChannel. To get the results of the text detection operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED. If so, call GetDocumentTextDetection, and pass the job identifier (JobId) from the initial call to StartDocumentTextDetection.

For more information, see Document Text Detection.

- (AWSTask<AWSTextractStartDocumentTextDetectionResponse*> *)startDocumentTextDetection:(AWSTextractStartDocumentTextDetectionRequest *)request

Parameters

request

A container for the necessary parameters to execute the StartDocumentTextDetection service method.

Return Value

An instance of AWSTask. On successful execution, task.result will contain an instance of AWSTextractStartDocumentTextDetectionResponse. On failed execution, task.error may contain an NSError with AWSTextractErrorDomain domain and the following error code: AWSTextractErrorInvalidParameter, AWSTextractErrorInvalidS3Object, AWSTextractErrorUnsupportedDocument, AWSTextractErrorDocumentTooLarge, AWSTextractErrorBadDocument, AWSTextractErrorAccessDenied, AWSTextractErrorProvisionedThroughputExceeded, AWSTextractErrorInternalServer, AWSTextractErrorIdempotentParameterMismatch, AWSTextractErrorThrottling, AWSTextractErrorLimitExceeded.

Declared In

AWSTextractService.h

– startDocumentTextDetection:completionHandler:

Starts the asynchronous detection of text in a document. Amazon Textract can detect lines of text and the words that make up a line of text.

StartDocumentTextDetection can analyze text in documents that are in JPG, PNG, and PDF format. The documents are stored in an Amazon S3 bucket. Use DocumentLocation to specify the bucket name and file name of the document.

StartTextDetection returns a job identifier (JobId) that you use to get the results of the operation. When text detection is finished, Amazon Textract publishes a completion status to the Amazon Simple Notification Service (Amazon SNS) topic that you specify in NotificationChannel. To get the results of the text detection operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED. If so, call GetDocumentTextDetection, and pass the job identifier (JobId) from the initial call to StartDocumentTextDetection.

For more information, see Document Text Detection.

- (void)startDocumentTextDetection:(AWSTextractStartDocumentTextDetectionRequest *)request completionHandler:(void ( ^ ) ( AWSTextractStartDocumentTextDetectionResponse *response , NSError *error ))completionHandler

Parameters

request

A container for the necessary parameters to execute the StartDocumentTextDetection service method.

completionHandler

The completion handler to call when the load request is complete. response - A response object, or nil if the request failed. error - An error object that indicates why the request failed, or nil if the request was successful. On failed execution, error may contain an NSError with AWSTextractErrorDomain domain and the following error code: AWSTextractErrorInvalidParameter, AWSTextractErrorInvalidS3Object, AWSTextractErrorUnsupportedDocument, AWSTextractErrorDocumentTooLarge, AWSTextractErrorBadDocument, AWSTextractErrorAccessDenied, AWSTextractErrorProvisionedThroughputExceeded, AWSTextractErrorInternalServer, AWSTextractErrorIdempotentParameterMismatch, AWSTextractErrorThrottling, AWSTextractErrorLimitExceeded.

Declared In

AWSTextractService.h

Other Methods

  configuration

The service configuration used to instantiate this service client.

@property (nonatomic, strong, readonly) AWSServiceConfiguration *configuration

Discussion

Warning: Once the client is instantiated, do not modify the configuration object. It may cause unspecified behaviors.

Declared In

AWSTextractService.h