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:
| Exception | Cause | Fix |
|---|---|---|
ArgumentNullException | The OcrInput passed to Recognize() is null | Always construct an OcrInput before calling Recognize() |
NotSupportedException | OcrInput was constructed with an InputType other than SingleImage or PDF | Only InputType.SingleImage and InputType.PDF are valid |
FileNotFoundException | A path added via OcrInput.Add() does not exist on disk | Validate 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.Lineare in that rendered image’s pixel space, not the PDF’s point space.
Platform and Build Issues
PlatformNotSupportedExceptionor similar at runtime on Linux/macOS. Image processing depends onSystem.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.SingleImageandInputType.PDFin oneOcrInput. Not supported — see How to Batch-Process Multiple Images.