Aspose.OCR for Java 21.2 - Release Notes

All Features

Key Summary Category
OCRJAVA-105 Implement spell-check feature Enhancement
OCRJAVA-109 Add blacklist for recognition symbols Enhancement
OCRJAVA-104 Find the reason for bad recognition quality in the support issues Bug Fixes


The next opportunities:

  • added spell-checking feature
  • added a list of misspelled words as a result of recognition with suggestions for corrections
  • added ability to set ignored symbols for recognition

Public API and Backwards Incompatible Changes


  • added methods: String getSpellCheckCorrectedText(SpellCheckLanguage language) and String getSpellCheckCorrectedText() to the RecognitionResult class
  • added methods: List getSpellCheckErrorList(SpellCheckLanguage language) and List getSpellCheckErrorList() to the RecognitionResult class
  • added methods: void saveSpellCheckCorrectedText(String fullFileName, Format format, SpellCheckLanguage language) and public void saveSpellCheckCorrectedText(String fullFileName, Format format) to the RecognitionResult class

- added method: void setIgnoredCharacters(String characters) to the RecognitionSettings class

  • added new API method: public string CorrectSpelling(string text, SpellCheckLanguage language = SpellCheckLanguage.En)

Removed APIs

  • public string String RecognizePage(String fullPath, Rectangle box)
  • String RecognizePage(BufferedImage image_, Rectangle box)

Will be deprecated

  • none

Usage Example

import static java.lang.System.out;

import java.awt.Rectangle;

import com.aspose.ocr.AsposeOCR;
import com.aspose.ocr.License;
import com.aspose.ocr.RecognitionResult;
import com.aspose.ocr.RecognitionSettings;
import com.aspose.ocr.SaveFormat.Format;

////  for gpu version

// import com.aspose.ocr.gpu.AsposeOCR;
// import com.aspose.ocr.gpu.License;
// import com.aspose.ocr.gpu.RecognitionResult;
// import com.aspose.ocr.gpu.RecognitionSettings;

public class App {
       public static void main(String[] args) {

        // set license    

        boolean resLicense = License.isValid();
        out.println("License is :" + resLicense);

        // Create api instance
        AsposeOCR api = new AsposeOCR();

        String img= "D:/img.png";

		// Ignored Characters to the RecognitionSettings class
        RecognitionSettings settings = new RecognitionSettings();
		RecognitionResult result = api.RecognizePage(file, settings);
		//spell-checking feature
		String correctedText = result.getSpellCheckCorrectedText();
		for(SpellCheckError error: list) {
				System.out.print(error.word+" length: " +error.length+" startPosition: " + error.startPosition);
				for(SuggestedWord suggested : error.suggestedWords) {
		result.saveSpellCheckCorrectedText("testres.doc", Format.Doc);
		System.out.println(api.CorrectSpelling("satisfa ction",;