Linux OCR quick start guide
For an application with OCR functionality which will be run under Linux operating system, the recognition engine provided by ABBYY Cloud OCR SDK can be especially convenient. It does not depend on operating system or programming language: the only requirement is that you should be able to send HTTP POST and GET requests to access the Web API.
- If you do not have Java Development Kit, please download and install the latest version from Oracle.
- If you have not yet created an account with Cloud OCR SDK, please register. Registration takes only a little time, and you can use your Google or Facebook account. After registration you will be able to create an Application ID and receive the Application Password, required for every connection to the processing server. See details in Authentication.
- Download the Java sample and unzip it.
- Customize the URL for HTML requests. To do this, open the Abbyy.Ocrsdk.client/src/com/abbyy/ocrsdk/Client.java file and set the value tag of the ServerAddress setting according to the location center. For example, for processing data in Europe, set the value as following:
public String serverUrl = "https://cloud-eu.ocrsdk.com";
- Edit the Abbyy.Ocrsdk.client/src/ClientSettings.java file to specify the Application ID and Password:
// Name of application you created public static final String APPLICATION_ID = ""; // Password should be sent to your e-mail after application was created public static final String PASSWORD = "";
- Build the sample application and run it to recognize an image and save the result as a plain text file:
javac *.java java TestApp recognize image.jpg result.txt
- Many other processing options are available. Run java TestApp without any arguments to display the full list:
- Please note also that the sample is pre-configured to recognize texts in English. If your documents are written in other languages, use the --lang=<comma-separated list of languages> command-line option.
- Modify the sample to fit the requirements for your application. In addition to TestApp.java which we saw above, there is also ProcessManyFiles.java, designed to recognize all images in a folder or all images located at URLs listed in a text file.