Installation
Installation
This page walks through adding Aspose.OCR FOSS for .NET to a project and confirming it
resolves correctly. The library targets netstandard2.0, net48, and net8.0 or later, and
depends only on Aspose.PDF.FOSS (for PDF page rendering), Microsoft.ML.OnnxRuntime (for
running the embedded recognition models), and System.Drawing.Common (for image decoding —
Windows only).
Prerequisites
| Requirement | Detail |
|---|---|
| Runtime | .NET Standard 2.0, .NET Framework 4.8, or .NET 8.0 or later |
| OS for image processing | Windows (System.Drawing.Common requirement) |
| External services | None — all recognition runs locally |
Add the package
dotnet add package Aspose.OCR.FOSSNamespace imports
After installation, add the following using directive to your source files:
using Aspose.OCR;This single namespace exposes the library’s public surface: AsposeOcr, OcrInput,
OcrOutput, InputType, and RecognitionResult.
Verifying the installation
Build an OcrInput, construct AsposeOcr, and confirm the project compiles and runs without
error:
using Aspose.OCR;
var api = new AsposeOcr();
using var input = new OcrInput(InputType.SingleImage);
Console.WriteLine("Aspose.OCR FOSS loaded.");If the project builds and prints that line without throwing, the package is referenced and resolves correctly.