Browse our Products

Latest release

What was changed

KeySummaryCategory
OCRJAVA‑456Add RecognizeTables method in the API.New feature

Public API changes and backwards compatibility

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

Added public APIs:

The following public APIs have been introduced in this release:

Aspose.OCR.AsposeOCR.RecognizeTables - a new method

Detect all tables in the image, identify their structure, recognize text within each cell, and return a list of OCRTablePage objects.

New Methods

MethodDescription
RecognizeTables(OcrInput images, Language language)Detect tables and structure and recognizes text cells.

Updated public APIs:

The following public APIs have been updated in this release:

Aspose.OCR.OcrOutput.getTableData()

Return a list of OCRTablePage objects.

Removed public APIs:

No changes.

Examples

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

Detect and recognize tables

import com.aspose.ocr.models.*;

// Initialize recognition API
AsposeOCR api = new AsposeOCR();

// Add an image to OcrInput object
com.aspose.ocr.OcrInput input = new OcrInput(InputType.SingleImage);
input.Add("source.png");


// Get tables result
ArrayList<com.aspose.ocr.models.OCRTablePage> tables =  api.RecognizeTables(input, Language.ExtLatin);

// Print recognized table data in rows and cols
for(com.aspose.ocr.models.OCRTable page : tables.get(0).getTables()) {
    System.out.println("page index: "+page.getTableIndex());
    for(OCRTableRow row : page.getRows()) {
        System.out.println("row index: "+row.getRowIndex());
        for(OCRTableCell cell : row.getCells()) {
            System.out.print("cell index: "+cell.getColumnIndex()+": ");
            System.out.println(cell.getText());
        }
    }
}