<dependency>
    <groupId>com.aspose</groupId>
    <artifactId>aspose-ocr-cloud</artifactId>
    <version>21.6.0</version>
</dependency>
copied!  
compile(group: 'com.aspose', name: 'aspose-ocr-cloud', version: '21.6.0')
copied!  
<dependency org="com.aspose" name="aspose-ocr-cloud" rev="21.6.0">
    <artifact name="aspose-ocr-cloud" ext="jar"/>
</dependency>
copied!  
libraryDependencies += "com.aspose" % "aspose-ocr-cloud" % "21.6.0"
copied!  

Java SDK & REST API to perform OCR in the Cloud

banner

Product Page | Documentation | Live Demo | Swagger UI | Code Samples | Blog | Free Support | Free Trial

Aspose.OCR Cloud SDK for Java helps you perform OCR on various image file formats (JPEG, PNG, GIF, BMP, TIFF) within your cloud-based Java Apps, without installing any 3rd party software. It is a wrapper around Aspose.OCR Cloud REST APIs.

OCR Cloud Processing Features

  • Extract and recognize text from images via OCR
  • Peform character recognition on whole or partial image
  • Specify your desired rectangular area for OCR
  • Detect text from the desired rectangular area
  • Support for font attributes
  • Built-in skew correction module to detect slightly rotated images
  • Detect text (OCR) in English, French, and German (Deutsch)
  • Return the OCR response in the XML or JSON formats.

OCR Cloud Storage Features

  • Upload, download, copy, move and delete files, including versions handling (if you are using Cloud storage that supports this feature - true by default).
  • Create, copy, move and delete folders.
  • Copy and move files and folders accross separate storages in scope of a single operation.
  • Check if certain file, folder or storage exists.

Supported OCR Input File Formats

JPEG
PNG
GIF
BMP
TIFF

Supported OCR Output File Formats

XML
JSON

Requirements

Building the API client library requires:

  1. Java 1.7+
  2. Maven

Prerequisites

To use Aspose.OCR Cloud SDK for Java you need to register an account with Aspose Cloud and lookup/create Client ID and Client Secret at Cloud Dashboard. There is free quota available. For more details, see Aspose Cloud Pricing.

Installation

Install from Maven

Add Aspose Cloud repository to your application pom.xml

<repository>
    <id>aspose-cloud</id>
    <name>Aspose Cloud Repository</name>
    <url>https://releases.aspose.cloud/java/repo/</url>
</repository>

Install from source

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

Add this dependency to your project’s POM:

<dependency>
  <groupId>com.aspose</groupId>
  <artifactId>aspose-ocr-cloud</artifactId>
  <version>21.6.0</version>
  <scope>compile</scope>
</dependency>

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/aspose-ocr-cloud-21.6.0.jar
  • target/lib/*.jar

EXAMPLE

import com.aspose.ocr.api.*;

private static void setUpConfig() throws Exception {
        Configuration.setAPP_SID("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX");
        Configuration.setAPI_KEY("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
    }

public String RecognizeFromUrl(String url) {
    String urlToFile = "https://upload.wikimedia.org/wikipedia/commons/2/2f/Book_of_Abraham_FirstPage.png";
    OCRResponse ocrResponse = RecognizeFromUrl(urlToFile, Language.English);
    return ocrResponse.text;
}

static String RecognizeFromContent(File f) {
    File f = new File(Configuration.getTestSrcDir(), "de_1.jpg");
    OCRResponse ocrResponse = RecognizeFromContent(f, Language.German);
    return ocrResp.text;
}

Licensing

All Aspose.OCR Cloud SDKs, helper scripts and templates are licensed under MIT License.

Authorization & Authentication

Authentication schemes defined for the API is as follows:

JWT

Recommendation

It’s recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Product Page | Documentation | Live Demo | Swagger UI | Code Samples | Blog | Free Support | Free Trial

VersionRelease Date
23.12.0December 21, 2023
23.11.0November 30, 2023
23.6.0July 2, 2023
22.12.0December 27, 2022
21.6.0June 4, 2021
20.7.0July 6, 2020
1.0.0May 12, 2020
1.0.1May 12, 2020
20.5.0May 11, 2020
18.8.0September 18, 2019