OfficeIMO.Reader.Ocr
3.3.0
Prefix Reserved
See the version list below for details.
dotnet add package OfficeIMO.Reader.Ocr --version 3.3.0
NuGet\Install-Package OfficeIMO.Reader.Ocr -Version 3.3.0
<PackageReference Include="OfficeIMO.Reader.Ocr" Version="3.3.0" />
<PackageVersion Include="OfficeIMO.Reader.Ocr" Version="3.3.0" />
<PackageReference Include="OfficeIMO.Reader.Ocr" />
paket add OfficeIMO.Reader.Ocr --version 3.3.0
#r "nuget: OfficeIMO.Reader.Ocr, 3.3.0"
#:package OfficeIMO.Reader.Ocr@3.3.0
#addin nuget:?package=OfficeIMO.Reader.Ocr&version=3.3.0
#tool nuget:?package=OfficeIMO.Reader.Ocr&version=3.3.0
OfficeIMO.Reader.Ocr - easy local OCR
OfficeIMO.Reader.Ocr is the one-call facade for local image OCR and searchable PDFs. It uses the engine-neutral Reader contracts, the optional Tesseract CLI provider, and the OfficeIMO.Pdf 3.3 rendering and mutation pipeline.
Runtime prerequisite
Install Tesseract once with the operating-system package manager. The facade discovers common installations and PATH automatically:
Windows: winget install --id UB-Mannheim.TesseractOCR --exact
macOS: brew install tesseract
Ubuntu: apt-get install tesseract-ocr
You can also set OFFICEIMO_TESSERACT_PATH or pass Tesseract.ExecutablePath. OfficeIMO does not silently install a system executable or bundle a community native build.
Searchable PDF in one call
using OfficeIMO.Pdf;
using OfficeIMO.Reader.Ocr;
PdfSearchableOcrResult result = await OfficeOcr.MakePdfSearchableAsync(
"scanned.pdf",
"scanned-searchable.pdf");
Console.WriteLine($"Added {result.AddedWordCount} OCR words.");
English is the default. Language choices are typed and discoverable, so callers do not need to know Tesseract language codes. The curated catalog contains 28 typed languages across Latin, Cyrillic, Arabic, Hebrew, Devanagari, Chinese, Japanese, Korean, Greek, and Vietnamese text. Requested language data is downloaded on demand from an immutable official tessdata_fast commit; orientation data is included automatically when the selected page segmentation mode needs it. Every file is checked against a package-pinned size and SHA-256 digest before it enters the versioned user cache.
var options = new OfficeOcrOptions();
options.Languages = OfficeOcrLanguage.English | OfficeOcrLanguage.Polish | OfficeOcrLanguage.German;
await OfficeOcr.MakePdfSearchableAsync("scan.pdf", "searchable.pdf", options);
Use OfficeOcrLanguages.Supported to populate a UI without maintaining another language list. Callers with their own trained-data files can set CustomLanguageExpression. That advanced escape hatch accepts raw Tesseract identifiers; ordinary use should stay on the typed property. The earlier Tesseract.Language configuration route remains supported for compatibility. Combining multiple non-default language routes is rejected instead of silently choosing one.
Reuse a session
Create a session once for repeated images or PDFs. Session creation verifies the executable version and available languages.
OfficeOcrSession session = await OfficeOcr.CreateSessionAsync(options);
OfficeOcrEngineResult image = await session.RecognizeImageAsync(pngBytes, "image/png");
PdfSearchableOcrResult pdf = await session.MakePdfSearchableAsync(PdfDocument.Load("scan.pdf"));
For other OCR engines, use IOfficeOcrEngine, OfficeOcrEnginePdfProvider, or IPdfOcrProvider directly. This keeps cloud SDKs, native inference runtimes, and experimental providers out of the default package graph.
Boundaries
- Tesseract runs out of process with bounded input, output, time, and descendant-process containment.
- Searchable PDF output is a full rewrite through OfficeIMO.Pdf mutation policy; signatures that forbid rewriting fail closed.
- OCR words overlapping native PDF text are excluded by default.
- The package is MIT. Tesseract and official trained data use Apache 2.0 and remain external runtime assets.
| 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.Reader.Ocr.Tesseract (>= 3.3.0)
- OfficeIMO.Reader.Pdf (>= 3.3.0)
-
.NETStandard 2.0
- OfficeIMO.Reader.Ocr.Tesseract (>= 3.3.0)
- OfficeIMO.Reader.Pdf (>= 3.3.0)
-
net10.0
- OfficeIMO.Reader.Ocr.Tesseract (>= 3.3.0)
- OfficeIMO.Reader.Pdf (>= 3.3.0)
-
net8.0
- OfficeIMO.Reader.Ocr.Tesseract (>= 3.3.0)
- OfficeIMO.Reader.Pdf (>= 3.3.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on OfficeIMO.Reader.Ocr:
| Package | Downloads |
|---|---|
|
OfficeIMO.Workflows
Typed local document workflows that compose first-party OfficeIMO conversion, PDF, and provenance capabilities. |
GitHub repositories
This package is not used by any popular GitHub repositories.