Browse our Products

Latest release

What was changed

KeySummaryCategory
#OCRNET‑1283Added DOCX generation with preserved page layout, detected fonts, embedded images, and recognized tables.New feature
#OCRNET‑1286Improved Markdown export by using the document layout detection model and adding support for detected images and recognized tables.Enhancement
#OCRNET‑1274Refactored multithreading implementation to improve recognition stability and reliability.Enhancement

Public API changes and backwards compatibility

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

Added public APIs:

The following public APIs have been introduced in this release:

Aspose.OCR.DetectAreasMode.DOCUMENT_LAYOUT - a new enum value

Detects complete document layout, including text blocks, headings, columns, tables, images, charts, and formulas. Use this mode when the recognized document structure must be preserved in DOCX or Markdown output.

Aspose.OCR.BaseRecognitionSettings.RetainImageForExport - a new property

Controls whether the preprocessed source image is retained in the recognition result. The image is stored in a compressed form and decoded only when RecognitionResult.Image is accessed.

New property

PropertyTypeDescription
RetainImageForExportboolWhen true, the preprocessed source image is kept in the recognition result for image-based export operations. When false, the image is not stored in the recognition result, reducing memory usage and serialized result size.

Aspose.OCR.RecognitionResult.ReleaseImage - a new method

Releases the materialized Image array while retaining a compressed, lossless representation that can be decoded again on demand. This helps reduce memory usage after accessing RecognitionResult.Image.

Updated public APIs:

The following public APIs have been updated in this release:

Aspose.OCR.OcrOutput.Save - updated DOCX and Markdown output

OcrOutput.Save() now produces richer DOCX and Markdown files when recognition results contain document layout metadata:

  • DOCX output preserves page layout and uses recognized text positions.
  • DOCX output uses detected font family, style, and size when RecognitionSettings.DetectFonts is enabled.
  • DOCX and Markdown output can include detected images.
  • DOCX and Markdown output can preserve recognized table structure.

Aspose.OCR.SaveFormat.Docx - updated behavior

DOCX export now uses the document layout detection results to preserve the original page structure, place detected images, and render recognized tables.

Aspose.OCR.SaveFormat.Md - updated behavior

Markdown export now uses layout detection data to render recognized tables as Markdown tables and to reference detected images. When saving to a file, extracted images are written to a document-specific images directory next to the generated Markdown pages.

Deprecated APIs

The following public APIs have been marked as deprecated and will be removed in Aspose.OCR for .NET 27.3.0 (March 2027) release:

Aspose.OCR.AsposeOcr.SaveMultipageDocument - all overloads

Use OcrOutput.Save instead.

The following overloads are deprecated and scheduled for removal:

public static void SaveMultipageDocument(string fullFileName, SaveFormat saveFormat, List<RecognitionResult> results, string embeddedFontPath = null, PdfOptimizationMode optimizePdf = PdfOptimizationMode.MAXIMUM_QUALITY)
public static void SaveMultipageDocument(string fullFileName, SaveFormat saveFormat, List<RecognitionResult> results, bool applySpellingCorrection, SpellCheckLanguage language = SpellCheckLanguage.Eng, string dictionaryPath = null, string embeddedFontPath = null, PdfOptimizationMode optimizePdf = PdfOptimizationMode.MAXIMUM_QUALITY)
public static void SaveMultipageDocument(MemoryStream stream, SaveFormat saveFormat, List<RecognitionResult> results, string embeddedFontPath = null, PdfOptimizationMode optimizePdf = PdfOptimizationMode.MAXIMUM_QUALITY)
public static void SaveMultipageDocument(MemoryStream stream, SaveFormat saveFormat, List<RecognitionResult> results, bool applySpellingCorrection, SpellCheckLanguage language = SpellCheckLanguage.Eng, string dictionaryPath = null, string embeddedFontPath = null, PdfOptimizationMode optimizePdf = PdfOptimizationMode.MAXIMUM_QUALITY)

Removed public APIs:

No changes.

Examples

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

Save recognition results as DOCX with preserved layout

using Aspose.OCR;

AsposeOcr recognitionEngine = new AsposeOcr();

OcrInput input = new OcrInput(InputType.SingleImage);
input.Add("document.png");

RecognitionSettings settings = new RecognitionSettings
{
    DetectAreasMode = DetectAreasMode.DOCUMENT_LAYOUT,
    DetectFonts = true,
    RetainImageForExport = true
};

OcrOutput results = recognitionEngine.Recognize(input, settings);

results.Save("document.docx", SaveFormat.Docx);

Save recognition results as Markdown with tables and images

using Aspose.OCR;

AsposeOcr recognitionEngine = new AsposeOcr();

OcrInput input = new OcrInput(InputType.SingleImage);
input.Add("report.png");

RecognitionSettings settings = new RecognitionSettings
{
    DetectAreasMode = DetectAreasMode.DOCUMENT_LAYOUT
};

OcrOutput results = recognitionEngine.Recognize(input, settings);

results.Save("report.md", SaveFormat.Md);

Do not retain source images for text-only workflows

using Aspose.OCR;

AsposeOcr recognitionEngine = new AsposeOcr();

OcrInput input = new OcrInput(InputType.SingleImage);
input.Add("document.png");

RecognitionSettings settings = new RecognitionSettings
{
    RetainImageForExport = false
};

OcrOutput results = recognitionEngine.Recognize(input, settings);

foreach (RecognitionResult result in results)
{
    Console.WriteLine(result.RecognitionText);
}

results.Save("document.txt", SaveFormat.Text);

Replace obsolete SaveMultipageDocument calls

using Aspose.OCR;

AsposeOcr recognitionEngine = new AsposeOcr();

OcrInput input = new OcrInput(InputType.SingleImage);
input.Add("page1.png");
input.Add("page2.png");

OcrOutput results = recognitionEngine.Recognize(input);

results.Save("document.pdf", SaveFormat.Pdf);
results.Save("document.docx", SaveFormat.Docx);