Aspose.OCR FOSS for .NET — Troubleshooting

Aspose.OCR FOSS for .NET — Troubleshooting

This page lists the errors and limitations most likely to surface while integrating Aspose.OCR FOSS for .NET, with the real cause behind each one.

Exceptions Thrown by Recognize()

AsposeOcr.Recognize() validates its input before any model runs. Each check below fails in this order:

ExceptionCauseFix
ArgumentNullExceptionThe OcrInput passed to Recognize() is nullAlways construct an OcrInput before calling Recognize()
NotSupportedExceptionOcrInput was constructed with an InputType other than SingleImage or PDFOnly InputType.SingleImage and InputType.PDF are valid
FileNotFoundExceptionA path added via OcrInput.Add() does not exist on diskValidate every path before calling Add() — a missing file fails the entire call, not just that file

Recognition Returns No Text

If RecognitionResult.RecognitionText is empty and RecognitionLinesResult has no entries, the detector found no text-line region in the image. This is expected — not a bug — for:

  • Images with no legible text, or text that is too small, rotated, or low-contrast for the detector to register as a region
  • Non-Latin scripts: the embedded recognition model only covers Latin-script text and its diacritical characters
  • Images where the detected regions were filtered out during post-processing (very low text-probability scores)

There is no confidence score exposed to distinguish “nothing detected” from “detected but uncertain” — see Scope and Limitations.

Recognition Runs But Results Look Wrong

  • Rotated or skewed text. There is no automatic deskewing or rotation correction. Pre-rotate the source image before calling Recognize().
  • Table or form layouts look jumbled. The detector returns axis-aligned line rectangles only — it has no concept of columns, tables, or reading order beyond line position. Reconstructing layout is the caller’s responsibility.
  • PDF text position looks offset. PDF pages are always rendered at 150 DPI internally; rectangle coordinates in RecognitionResult.LinesResult.Line are in that rendered image’s pixel space, not the PDF’s point space.

Platform and Build Issues

  • PlatformNotSupportedException or similar at runtime on Linux/macOS. Image processing depends on System.Drawing.Common, which is Windows-only on .NET 6 and later. This library’s image-processing path only runs on Windows.
  • Build fails targeting net9.0/net10.0. Building those targets requires the .NET 10 SDK — see How to Build from Source.
  • Mixing InputType.SingleImage and InputType.PDF in one OcrInput. Not supported — see How to Batch-Process Multiple Images.

See Also