OfficeIMO.Ocr.Tesseract
3.4.3
Prefix Reserved
dotnet add package OfficeIMO.Ocr.Tesseract --version 3.4.3
NuGet\Install-Package OfficeIMO.Ocr.Tesseract -Version 3.4.3
<PackageReference Include="OfficeIMO.Ocr.Tesseract" Version="3.4.3" />
<PackageVersion Include="OfficeIMO.Ocr.Tesseract" Version="3.4.3" />
<PackageReference Include="OfficeIMO.Ocr.Tesseract" />
paket add OfficeIMO.Ocr.Tesseract --version 3.4.3
#r "nuget: OfficeIMO.Ocr.Tesseract, 3.4.3"
#:package OfficeIMO.Ocr.Tesseract@3.4.3
#addin nuget:?package=OfficeIMO.Ocr.Tesseract&version=3.4.3
#tool nuget:?package=OfficeIMO.Ocr.Tesseract&version=3.4.3
OfficeIMO.Ocr.Tesseract - Tesseract OCR provider
OfficeIMO.Ocr.Tesseract is an optional IOcrEngine backed by an installed Tesseract command-line executable. It does not bundle native binaries or trained language data.
Install
dotnet add package OfficeIMO.Ocr.Tesseract
Install Tesseract separately for the host operating system. TesseractOcrEngine.CreateDefault() discovers an explicit path, OFFICEIMO_TESSERACT_PATH, TESSERACT_PATH, the process PATH, and common platform locations:
TesseractOcrEngine engine = TesseractOcrEngine.CreateDefault();
You can verify the executable and required languages directly:
tesseract --version
tesseract --list-langs
Tesseract 5 is the current stable major line. Its command contract supports image input, language expressions, and TSV output; see the official Tesseract manual.
Recognize an image
using OfficeIMO.Ocr.Tesseract;
using OfficeIMO.Ocr;
TesseractOcrSession session = await TesseractOcr.CreateSessionAsync(new TesseractOcrSessionOptions {
Languages = TesseractOcrLanguage.English | TesseractOcrLanguage.Polish,
Engine = new TesseractOcrEngineOptions {
PageSegmentationMode = 3,
Timeout = TimeSpan.FromMinutes(1)
}
});
OcrResult result = await session.RecognizeAsync(
File.ReadAllBytes("scan.png"),
"image/png",
"scan.png");
foreach (OcrTextSpan span in result.Spans) {
Console.WriteLine($"{span.Level}: {span.Text} ({span.Confidence:P0})");
}
session.Engine is the same neutral IOcrEngine accepted by OfficeIMO.Reader.Ocr, OfficeIMO.Pdf.Ocr, and future format integrations. The Tesseract package itself does not reference those packages.
The provider parses Tesseract TSV into line and word spans with pixel bounding boxes and normalized confidence. Tesseract TSV does not expose character boxes, so SupportsCharacterSpans is false. A process or delegate engine can still return character spans through the shared core contract.
GetVersionAsync() and GetLanguagesAsync() provide explicit installation evidence. TesseractLanguageData.EnsureAsync("eng+pol") can provision any model in the 28-language catalog, plus orientation data, into a versioned user cache. Downloads come from one immutable official tessdata_fast commit and must match package-pinned lengths and SHA-256 digests. Missing executables, unavailable trained data, unsupported input formats, and nonzero process exits surface as engine failures. A consuming format integration decides whether to stop or convert those failures into document diagnostics.
Per-request payload and output files use owner-only Unix directories and permissions. Temporary files are deleted by default; enable KeepTemporaryFiles only for controlled diagnostics.
Detect page orientation
The engine advertises SupportsOrientationDetection. Set OcrRequest.Operation to OcrOperation.DetectOrientation and run it through OcrEngineRunner to share the same timeout and concurrency rules as text recognition. The provider uses Tesseract's page segmentation mode 0 with osd trained data and returns OcrResult.Orientation.
ClockwiseRotationDegrees is the corrective rotation, restricted to 0, 90, 180, or 270 degrees. Confidence is Tesseract's orientation score divided by 15 and capped at 1; it is a provider-specific scale, not a probability. Missing data, insufficient text, or invalid/conflicting output produces a diagnostic and no accepted orientation. Callers choose their confidence threshold and retain the original image when evidence is insufficient. OfficeIMO.Pdf.Ocr exposes this through PdfOcrMergeOptions.DetectOrientation.
Targets and licenses
- Targets:
netstandard2.0,net8.0,net10.0(net472is also included on Windows builds). - OfficeIMO provider license: MIT.
- Tesseract is an external dependency distributed under its own Apache 2.0 license.
Dependency footprint
- External: An installed Tesseract CLI. Language data is not bundled; callers may use their system data or explicitly invoke the checksum-pinned provisioner.
- OfficeIMO:
OfficeIMO.Ocrowns the neutral contracts.OfficeIMO.Ocr.Processsupplies the bounded cross-platform process runner used by this provider.
See the complete OfficeIMO package map for related formats and conversion paths.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.7.2
- OfficeIMO.Ocr (>= 3.4.3)
- OfficeIMO.Ocr.Process (>= 3.4.3)
-
.NETStandard 2.0
- OfficeIMO.Ocr (>= 3.4.3)
- OfficeIMO.Ocr.Process (>= 3.4.3)
-
net10.0
- OfficeIMO.Ocr (>= 3.4.3)
- OfficeIMO.Ocr.Process (>= 3.4.3)
-
net8.0
- OfficeIMO.Ocr (>= 3.4.3)
- OfficeIMO.Ocr.Process (>= 3.4.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.