FieldCure.DocumentParsers.Pdf.Ocr
1.0.1
FieldCure.DocumentParsers.Ocr 1.0.0
Additional DetailsRenamed to FieldCure.DocumentParsers.Ocr 1.0. Same functionality, new namespace FieldCure.DocumentParsers.Ocr.*; AddPdfOcrSupport() → AddOcrSupport(). Windows only.
dotnet add package FieldCure.DocumentParsers.Pdf.Ocr --version 1.0.1
NuGet\Install-Package FieldCure.DocumentParsers.Pdf.Ocr -Version 1.0.1
<PackageReference Include="FieldCure.DocumentParsers.Pdf.Ocr" Version="1.0.1" />
<PackageVersion Include="FieldCure.DocumentParsers.Pdf.Ocr" Version="1.0.1" />
<PackageReference Include="FieldCure.DocumentParsers.Pdf.Ocr" />
paket add FieldCure.DocumentParsers.Pdf.Ocr --version 1.0.1
#r "nuget: FieldCure.DocumentParsers.Pdf.Ocr, 1.0.1"
#:package FieldCure.DocumentParsers.Pdf.Ocr@1.0.1
#addin nuget:?package=FieldCure.DocumentParsers.Pdf.Ocr&version=1.0.1
#tool nuget:?package=FieldCure.DocumentParsers.Pdf.Ocr&version=1.0.1
FieldCure.DocumentParsers.Pdf.Ocr
Tesseract OCR fallback for scanned PDFs in FieldCure.DocumentParsers.Pdf.
Quick Start
using FieldCure.DocumentParsers.Pdf.Ocr;
// Register PDF parser with OCR fallback (call once at startup)
using var ocrEngine = DocumentParserFactoryOcrExtensions.AddPdfOcrSupport();
// Use as usual — scanned pages are automatically OCR'd
var parser = DocumentParserFactory.GetParser(".pdf")!;
var text = parser.ExtractText(File.ReadAllBytes("scanned.pdf"));
How It Works
- Text extraction is attempted via PdfPig (same as the base PDF package).
- If a page yields no meaningful text (< 5% non-whitespace or < 10 chars), it is rendered at 300 DPI.
- The rendered image is processed by Tesseract OCR.
- Korean text is post-processed to remove spurious inter-character spaces.
Included Languages
- English (
eng.traineddata) - Korean (
kor.traineddata)
Languages are auto-discovered from embedded traineddata files.
Thread Safety
Uses an engine pool (default size: min(ProcessorCount, 4)) for concurrent OCR processing.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net8.0
- FieldCure.DocumentParsers.Pdf (>= 1.1.0)
- Tesseract (>= 5.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
# Release Notes — FieldCure.DocumentParsers.Pdf.Ocr
## [1.0.1] - 2026-04-08
### Fixed
- Tesseract native DLLs (`leptonica-1.82.0.dll`, `tesseract50.dll`) now included in NuGet package with `build/` and `buildTransitive/` targets, fixing `DllNotFoundException` in `PackAsTool` consumers (e.g., MCP servers)
## [1.0.0] - 2026-04-08
### Added
- `TesseractOcrEngine` — Tesseract OCR fallback for scanned PDFs with no text layer
- Embedded traineddata (tessdata_fast): English + Korean
- Automatic language discovery from tessdata directory
- Korean post-processing: removes spurious inter-character spaces from Tesseract output
- Engine pool via `ConcurrentBag` + `SemaphoreSlim` for concurrent OCR (default: `min(ProcessorCount, 4)`)
- `DocumentParserFactoryOcrExtensions.AddPdfOcrSupport()` — one-line factory registration with OCR