Browse our Products

Aspose.OCR for Java 22.9 - Release Notes

What was changed

KeySummaryCategory
OCRJAVA-272Extracting text from receipts.New feature
OCRJAVA-273Added a recognition setting that improves the recognition of small fonts and detection of dense lines.New feature
OCRJAVA-275Improved handling of images rotated by 90 degrees.Enhancement
OCRJAVA-278The original font size is preserved in OCR results saved in PDF and DOCX formats.New feature

Public API changes and backwards compatibility

This section lists all public API changes introduced in Aspose.OCR for Java 22.9 that may affect the code of existing applications.

Added public APIs:

The following public APIs have been introduced in this release:

Receipt recognition.

Added a method RecognizeReceipt that is specifically tailored for extracting text from printed receipts.

This method uses a special recognition settings object, ReceiptRecognitionSettings, which is a subset of the existing image recognition settings.

Recognition of small fonts

Added a method setUpscaleSmallFont to image recognition setting:

CallBehavior
setUpscaleSmallFont(false)Use standard recognition flow (default). Very small fonts and dense lines may not be recognized.
setUpscaleSmallFont(true)Activate a special upscaling algorithm that greatly improves small font recognition and line detection.

Updated public APIs:

No changes.

Removed public APIs:

No changes.

Usage examples

The examples below illustrates the changes introduced in this release:

Receipt recognition.

// Create instance of OCR API
AsposeOCR api = new AsposeOCR();
// Recognize Ukrainian text
ReceiptRecognitionSettings recognitionSettings = new ReceiptRecognitionSettings();
recognitionSettings.setLanguage(Language.Ukr);
// Extract text from receipt
RecognitionResult result = api.RecognizeReceipt("source.png", recognitionSettings);
System.out.println("Recognition result:\n" + result.recognitionText);

Recognition of small fonts

// Create instance of OCR API
AsposeOCR api = new AsposeOCR();
// Activate font upscaling 
RecognitionSettings recognitionSettings = new RecognitionSettings();
recognitionSettings.setUpscaleSmallFont(true);
// Extract text from image
RecognitionResult result = api.RecognizePage("source.png", recognitionSettings);
System.out.println("Recognition result:\n" + result.recognitionText);