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

RequirementDetail
Runtime.NET Standard 2.0, .NET Framework 4.8, or .NET 8.0 or later
OS for image processingWindows (System.Drawing.Common requirement)
External servicesNone — all recognition runs locally

Add the package

dotnet add package Aspose.OCR.FOSS

Namespace 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.


Next Steps

See Also