Browse our Products
Aspose.OCR for Java 24.4.0 - Release Notes
This article contains a summary of recent changes, enhancements and bug fixes in Aspose.OCR for Java 24.4.0 (April 2024) release.
GPU version: 24.2.0
Deprecation warning
The release 24.3.0 updates the codes of some recognition languages to align with ISO 639-2 standard.
To make it easier to upgrade your code, we have kept all legacy values, but marked them as deprecated. All of your existing code will continue to work and you can even make minor updates to it, but be aware that all deprecated language codes are scheduled to be removed in release 25.1.0 (January 2025).
Time to deprecation: 8 months left.
What was changed
Key | Summary | Category |
---|---|---|
OCRJAVA‑362 | Added recognition of Arabic text. | New feature |
OCRJAVA‑363 | Saving 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:
Value | Alphabet |
---|---|
Language.Ara | Arabic |
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);