Browse our Products

Aspose.OCR for Java 25.4.0 - Release Notes

What was changed

KeySummaryCategory
OCRJAVA‑423Added universal recognition of Arabic, Persian and English alphabets.New feature
OCRJAVA‑422Automatic analysis of image content and detection of layout blocks.New feature
OCRJAVA‑421Add markdown output format with document layout.New feature
OCRJAVA‑418Automatic language detection during recognition.New feature
OCRJAVA‑420Docx output format improvements.Enhancement

Public API changes and backwards compatibility

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

Added public APIs:

The following public APIs have been introduced in this release:

com.aspose.ocr.models.ContentArea class

This class stores a layout block detected in an image.

PropertyTypeDescription
indexIntegerThe sequential index of the content area, unique within the entire image.
imageBufferedImageImage region with the content.
rectanglejava.awt.RectangleThe bounding rectangle of the content area.

com.aspose.ocr.models.LayoutOutput

This class stores a layout block detected in an image.

PropertyTypeDescription
sourceStringThe full path to the file or URL, if applicable. Empty for images provided as a stream, byte array, or Base64.
pageIntegerPage number for multi-page images.
paragraphsArrayList<com.aspose.ocr.models.ContentArea>Detected paragraphs.
imagesArrayList<com.aspose.ocr.models.ContentArea>Detected illustrations.
headersArrayList<com.aspose.ocr.models.ContentArea>Detected headers.
tablesArrayList<com.aspose.ocr.models.ContentArea>Detected tables.
listsArrayList<com.aspose.ocr.models.ContentArea>Detected lists.
captionsArrayList<com.aspose.ocr.models.ContentArea>Detected captions.
equationsArrayList<com.aspose.ocr.models.ContentArea>Detected equations.

DetectDocumentLayout method

Analyzes images and identifies the different types of layout blocks within it. This method supports PDF, GIF, PNG, JPEG, BMP, or single-page TIFF from files, streams, and can bulk process folders and archives.

Detected layout blocks are returned as com.aspose.ocr.models.LayoutOutput object.

com.aspose.ocr.models.LanguageDetectionLevel enumeration

Defines the level of language detection for text recognition in an image:

LevelValueDescription
BY_PAGEcom.aspose.ocr.models.LanguageDetectionLevel.BY_PAGEDetects a single language for the entire image.
BY_PARAGRAPHcom.aspose.ocr.models.LanguageDetectionLevel.BY_PARAGRAPHDetects the language separately for each paragraph.
BY_WORDcom.aspose.ocr.models.LanguageDetectionLevel.BY_WORDDetects the language separately for each word.

Updated public APIs:

The following public APIs have been updated in Aspose.OCR for .NET 25.4.0 release:

com.aspose.ocr.models.Language

Aspose.OCR for Java can now extract mixed-language texts in Persian, Arabic and English alphabets.Use the following language identifier in recognition settings:

  • com.aspose.ocr.models.Language.PersoArabic
  • com.aspose.ocr.models.Language.Islamic

com.aspose.ocr.models.Language

Aspose.OCR for Java can now Automatically detects the language in the input document or image. Use the following language identifier in recognition settings:

  • com.aspose.ocr.models.Language.Multilanguage
  • com.aspose.ocr.models.Language.Auto
  • com.aspose.ocr.models.Language.Universal

com.aspose.ocr.models.Format

Aspose.OCR for Java can now save the document as a Markdown (.md) file. If com.aspose.ocr.models.DetectAreasMode.MULTICOLUMN is used, images will also be extracted.

  • com.aspose.ocr.models.Format.Md

Deprecated APIs

The following public APIs have been marked as deprecated and will be removed in 25.10.0 (October 2025) release:

RecognitionResult.recognitionAreasText

RecognitionResult.recognitionAreasRectangles

Removed public APIs:

No changes.

Examples

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

Detect and recognize tables in an image

AsposeOCR recognitionEngine = new AsposeOCR();
// Add an image to OcrInput object
OcrInput input = new OcrInput(com.aspose.ocr.InputType.SingleImage);
input.add("source.png");
// Detect layout
com.aspose.ocr.models.LayoutOutput layout = recognitionEngine.DetectDocumentLayout(input).get(0);
ArrayList<com.aspose.ocr.models.ContentArea> tables = layout.tables;
// Recognize tables
com.aspose.ocr.OcrInput tableAreas = new OcrInput(com.aspose.ocr.InputType.SingleImage);
for(com.aspose.ocr.models.ContentArea table : tables)
{
    tableAreas.add(table.image);
}

com.aspose.ocr.OcrOutput recognResult = api.Recognize(tableAreas);

Recognize the image with auto detection languages:


AsposeOCR recognitionEngine = new AsposeOCR();
// Add an image to OcrInput object
OcrInput input = new OcrInput(InputType.SingleImage);
input.add("source.png");
// Set language detection and it is level.
RecognitionSettings settings = new RecognitionSettings();
settings.setLanguage(com.aspose.ocr.models.Language.Auto);
settings.setLanguageDetectionLevel(LanguageDetectionLevel.BY_PARAGRAPH);
		
// Recognize with detect languages
List<RecognitionResult> result = recognitionEngine.Recognize(input, );
for (RecognitionResult item : result)
{
    System.out.println("Text: "+item.recognitionText);
}