Browse our Products

Aspose.OCR for Java 22.10 - Release Notes

What was changed

KeySummaryCategory
OCRJAVA-287Extracting text from an in-memory (InputStream) TIFF image.New feature
OCRJAVA-287Extracting text from an in-memory (BufferedImage) receipt image.New feature
OCRJAVA-288PDF recognition method can be called from AsposeOCR class.Enhancement

Public API changes and backwards compatibility

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

Added public APIs:

The following public APIs have been introduced in this release:

Recognition of in-memory TIFF image

Added an override method RecognizeTiff that allows to extract text from a TIFF image provided as an InputStream object.

Recognition of in-memory receipt image

Added an override method RecognizeReceipt that allows to extract text from a scanned receipt image provided as a BufferedImage object.

Updated public APIs:

The following public APIs have been updated in this release:

AsposeOCR.RecognizePdf

RecognizePdf can now be called from AsposeOCR class. The original method from AsposeOCRPdf class continues to work as before.

Removed public APIs:

No changes.

Usage examples

The examples below illustrates the changes introduced in this release:

Recognize in-memory TIFF image

AsposeOCR api = new AsposeOCR();
// Customize recognition
DocumentRecognitionSettings recognitionSettings = new DocumentRecognitionSettings();
recognitionSettings.setLanguage(Language.Ukr);
// Extract text from multi-page TIFF
InputStream inputStream = new FileInputStream("source.tiff");
ArrayList<RecognitionResult> results = api.RecognizeTiff(inputStream, recognitionSettings);
results.forEach((page) -> {
	System.out.println(page.recognitionText);
});

Recognize of in-memory receipt image

AsposeOCR api = new AsposeOCR();
BufferedImage source = ImageIO.read(new File("receipt.png"));
// Customize recognition
ReceiptRecognitionSettings recognitionSettings = new ReceiptRecognitionSettings();
recognitionSettings.setLanguage(Language.Ukr);
// Extract text from receipt
RecognitionResult result = api.RecognizeReceipt(source, recognitionSettings);
// Get recognition results as JSON
String resultJson = result.GetJson();

Extract text from PDF

AsposeOCR api = new AsposeOCR();
// Customize recognition
DocumentRecognitionSettings recognitionSettings = new DocumentRecognitionSettings();
recognitionSettings.setLanguage(Language.Ukr);
// Extract text from PDF document
ArrayList<RecognitionResult> results = api.RecognizePdf("source.pdf", recognitionSettings);
results.forEach((page) -> {
	System.out.println(page.recognitionText);
});