Exis.PdfOcr
1.0.6
dotnet add package Exis.PdfOcr --version 1.0.6
NuGet\Install-Package Exis.PdfOcr -Version 1.0.6
<PackageReference Include="Exis.PdfOcr" Version="1.0.6" />
<PackageVersion Include="Exis.PdfOcr" Version="1.0.6" />
<PackageReference Include="Exis.PdfOcr" />
paket add Exis.PdfOcr --version 1.0.6
#r "nuget: Exis.PdfOcr, 1.0.6"
#:package Exis.PdfOcr@1.0.6
#addin nuget:?package=Exis.PdfOcr&version=1.0.6
#tool nuget:?package=Exis.PdfOcr&version=1.0.6
Exis.PdfOcr
Local, no-cloud OCR for PDFs — turns scanned (image) PDF pages into searchable PDFs by adding an invisible, selectable text layer over the page image. Built on Exis.PdfEditor, so the output round-trips through the same find/replace, redaction, and extraction APIs as any digital PDF.
Designed for workflows like HIPAA medical-document batch processing: 100% on-device, no network calls, and per-page OCR confidence is surfaced so you can flag low-confidence pages for human review.
Packages
| Package | What it is | Target |
|---|---|---|
| Exis.PdfOcr | Cross-platform core: orchestration + IPdfRasterizer/IOcrProvider/IImageRedactor contracts. No native deps. |
netstandard2.0, net8.0 |
| Exis.PdfOcr.Tesseract | Default OCR engine (TesseractOCR). Ships English data. | netstandard2.0, net8.0 |
| Exis.PdfOcr.Windows | Default page rasterizer (image-extract fast path + Windows.Data.Pdf) and image redactor (System.Drawing). |
net8.0-windows |
| Exis.PdfOcr.Apple | All three Apple-platform seams: page rasterizer (PDFKit), OCR engine (Vision), and image redactor (CoreGraphics + Core Text). No native binaries to redistribute — every framework ships with the OS. | net8.0-ios, net8.0-maccatalyst |
Install for Windows (Tesseract OCR):
dotnet add package Exis.PdfOcr
dotnet add package Exis.PdfOcr.Tesseract
dotnet add package Exis.PdfOcr.Windows
Install for macOS / iOS / Mac Catalyst (on-device Vision OCR, nothing extra to ship):
dotnet add package Exis.PdfOcr
dotnet add package Exis.PdfOcr.Apple
The core targets the same netstandard2.0;net8.0 surface as Exis.PdfEditor, so the same WPF
(.NET), MAUI, and .NET Framework projects can consume it. On Apple platforms the OS-provided
Vision text recognizer is used in place of Tesseract, so no tessdata is deployed and there
is nothing to code-sign or notarize.
Usage
using Exis.PdfEditor; // licensing
using Exis.PdfOcr;
// Exis.PdfOcr builds on the licensed Exis.PdfEditor — initialise it once at startup.
ExisLicense.Initialize(); // or ExisLicense.Initialize("XXXX-XXXX-XXXX-XXXX");
var result = await PdfOcr.MakeSearchableAsync(
"input.pdf", "output.pdf", new OcrOptions { Languages = ["eng"] });
Console.WriteLine($"OCR'd {result.PagesProcessed}, skipped {result.PagesSkipped}, " +
$"avg confidence {result.AverageConfidence:P0}");
// Flag low-confidence pages for human review — confidence is never swallowed.
foreach (var page in result.Pages)
if (page.WasOcrd && page.Confidence < 0.80)
Console.WriteLine($" Page {page.PageNumber} needs review (conf {page.Confidence:P0})");
- Digital and already-OCR'd pages pass through untouched — only true scans are rasterized and recognized, which protects quality and is fast on mixed documents.
- The output's text layer is invisible (PDF render mode 3) and positioned over the page image, so the page looks identical but text is now selectable and findable.
Progress reporting
var progress = new Progress<OcrProgress>(p =>
Console.WriteLine($"[{p.Phase}] page {p.PageNumber}/{p.TotalPages}"));
await PdfOcr.MakeSearchableAsync("in.pdf", "out.pdf", new OcrOptions(), progress);
Languages
OcrOptions.Languages are Tesseract language codes ("eng", "spa", "vie", …). The
Exis.PdfOcr.Tesseract package ships English (eng.traineddata). To add languages, drop the
extra xxx.traineddata files into the package's tessdata folder (next to eng.traineddata in
your app's output) and list them:
new OcrOptions { Languages = ["eng", "spa", "vie"] }
The invisible text layer embeds a Unicode font (DejaVu Sans), so accented and non-Latin names (e.g. Nguyễn, Peña) survive find/replace intact rather than being mangled.
MAUI / packaged apps
Where trained data isn't on disk as a plain file, ship it as a MauiAsset, extract it to a
readable folder on first run, and point the provider at it:
var provider = new TesseractOcrProvider(tessdataPath: extractedTessdataDir);
await PdfOcr.MakeSearchableAsync("in.pdf", "out.pdf", new OcrOptions(), provider: provider);
Custom rasterizer / OCR engine / image redactor
All three seams are pluggable. Implement IPdfRasterizer, IOcrProvider, or IImageRedactor
and pass it to MakeSearchableAsync / RedactScannedAsync. If you omit them on Windows, the
core discovers the Windows rasterizer + redactor and Tesseract provider by reflection — so the
core itself never references Windows.* or any native OCR binaries.
On macOS / iOS / Mac Catalyst the reflection-based defaults don't apply; pass the Apple implementations explicitly:
using Exis.PdfOcr.Apple;
await PdfOcr.MakeSearchableAsync("in.pdf", "out.pdf", new OcrOptions(), progress,
provider: new VisionOcrProvider(),
rasterizer: new ApplePdfRasterizer());
await PdfRedactor.RedactScannedAsync("in.pdf", "safe.pdf",
new RedactionOptions { Terms = new[] { "John Smith" } },
progress,
redactor: new AppleImageRedactor());
Note on scanned-page de-identification
Replacing text in the OCR layer changes the selectable text, not the underlying scanned
pixels: the visible image still shows the original characters. To remove a name from the
visible scan as well, follow OCR with a pixel-redaction pass over the matched word boxes
(Exis.PdfEditor's PdfRedactor). The OCR layer is what makes those words findable.
| 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 was computed. 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 was computed. 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. |
-
.NETStandard 2.0
- Exis.PdfEditor (>= 3.8.10)
-
net8.0
- Exis.PdfEditor (>= 3.8.10)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Exis.PdfOcr:
| Package | Downloads |
|---|---|
|
Exis.PdfOcr.Tesseract
Default local OCR engine for Exis.PdfOcr, wrapping the TesseractOCR engine (Tesseract 5). Ships English (eng) trained data; add more languages by dropping their .traineddata files next to it. No cloud calls. Made in USA. |
|
|
Exis.PdfOcr.Windows
Windows page rasterizer for Exis.PdfOcr. Implements IPdfRasterizer using a fast path that extracts full-page scan images directly, falling back to the built-in Windows.Data.Pdf renderer for other pages. No native binary to redistribute — Windows.Data.Pdf ships with Windows. Made in USA. |
|
|
Exis.PdfOcr.Apple
Apple (macOS / iOS / Mac Catalyst) page rasterizer and OCR engine for Exis.PdfOcr. Implements IPdfRasterizer using PDFKit/CoreGraphics and IOcrProvider using the on-device Vision text recognizer (VNRecognizeTextRequest). Fully local, no cloud, and no native binaries to redistribute — Vision and PDFKit ship with the OS. Made in USA. |
GitHub repositories
This package is not used by any popular GitHub repositories.