Browse our Products

Aspose.OCR for Java 24.4.0 - Release Notes

Deprecation warning

What was changed

KeySummaryCategory
OCRJAVA‑362Added recognition of Arabic text.New feature
OCRJAVA‑363Saving multi-page recognition results into OutputStream object.New feature
OCRJAVA‑364
OCRJAVA‑366
Improved saving of recognition results as searchable PDFs.Enhancement

Public API changes and backwards compatibility

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

Added public APIs:

The following public APIs have been introduced in Aspose.OCR for Java 24.1.0 release:

SaveMultipageDocument(stream, format, results) method

This method allows to save multi-page recognition results (searchable PDF, Microsoft Word) recognition results into OutputStream object.

Updated public APIs:

The following public APIs have been changed in Aspose.OCR for Java 24.4.0 release:

Language enumeration

Aspose.OCR for Java can now recognize Arabic texts:

ValueAlphabet
Language.AraArabic

Removed public APIs:

No changes.

Examples

The code samples below illustrate the changes introduced in this release:

Arabic text recognition

// Initialize Aspose.OCR recognition API
AsposeOCR api = new AsposeOCR();
// Add image to the recognition batch
OcrInput source = new OcrInput(InputType.SingleImage);
source.add("image.png");
// Specify recognition language
RecognitionSettings recognitionSettings = new RecognitionSettings();
recognitionSettings.setLanguage(Language.Ara);
// Extract text from image
ArrayList<RecognitionResult> results = api.Recognize(source, recognitionSettings);
System.out.println(result[0].recognition_text);

Saving recognition results into stream

// Initialize Aspose.OCR recognition API
AsposeOCR api = new AsposeOCR();
// Add scanned PDF to the recognition batch
OcrInput source = new OcrInput(InputType.PDF);
source.add("scan.pdf");
// Saving searchable PDF into stream
ArrayList<RecognitionResult> results = api.Recognize(source);
OutputStream stream = new ByteArrayOutputStream();
AsposeOCR.SaveMultipageDocument(stream, Format.Pdf, results);