ZingPDF.OCR
1.0.60
dotnet add package ZingPDF.OCR --version 1.0.60
NuGet\Install-Package ZingPDF.OCR -Version 1.0.60
<PackageReference Include="ZingPDF.OCR" Version="1.0.60" />
<PackageVersion Include="ZingPDF.OCR" Version="1.0.60" />
<PackageReference Include="ZingPDF.OCR" />
paket add ZingPDF.OCR --version 1.0.60
#r "nuget: ZingPDF.OCR, 1.0.60"
#:package ZingPDF.OCR@1.0.60
#addin nuget:?package=ZingPDF.OCR&version=1.0.60
#tool nuget:?package=ZingPDF.OCR&version=1.0.60
ZingPDF.OCR
ZingPDF.OCR supplies image-candidate OCR and an explicit rendered-page OCR mode for mixed text, scans and tiled images.
.NET compatibility
Targets net8.0, with .NET 8 as the minimum. Runtime validation covers .NET 8,
9, and 10 on Windows. .NET Framework 4.x and applications targeting .NET 6 or 7
are not supported. Native dependencies and deployment requirements remain package-specific. See runtime and platform requirements.
Installation
dotnet add package ZingPDF.OCR
The built-in TesseractOcrEngine also needs Tesseract language data at runtime. See the
official Tesseract documentation for setup details.
Quick start
using ZingPDF;
using ZingPDF.OCR;
using var pdf = Pdf.Load(File.OpenRead("scanned.pdf"));
var engine = new TesseractOcrEngine("./tessdata", "eng");
var text = await pdf.ExtractPlainTextWithOcrAsync(engine);
This preserves the default: return existing nonblank embedded text, otherwise OCR the largest supported image XObject. A digital header can therefore bypass a scanned body, and one candidate can omit other image tiles. Use the rendered-page mode for visible-page input coverage:
var result = await pdf.ExtractTextWithOcrAsync(1, engine, new PdfOcrOptions
{
Mode = PdfOcrMode.RenderedPage,
Dpi = 300,
MaxPixelCount = 50_000_000
}, cancellationToken);
Console.WriteLine(result.Source);
Console.WriteLine(result.InputCoverage);
Rendered-page mode uses PDFium to produce a PNG of the visible crop/media intersection with page rotation and annotations. It ignores PreferEmbeddedText and sends that rendered image to the selected IOcrEngine. InputCoverage describes the supplied image, not recognition accuracy or recovered-text completeness. Source distinguishes embedded text, a single image candidate, a rendered page and no input.
Main workflows
- extract OCR text from scanned or image-based PDF pages
- combine OCR with the main text extraction workflow
- use the built-in
TesseractOcrEngineor a customIOcrEngine
Current limits
- image-candidate mode processes one usable image XObject; it does not cover arbitrary page drawing commands or multiple scan tiles
- JPEG, JPEG 2000 passthrough, and common 8-bit RGB or grayscale streams are supported candidate inputs; rendered-page mode uses PNG output from the page renderer
- rendered-page mode requires the native PDFium rendering dependencies on the deployed platform; install and validate them before disabling runtime network access
- rendering resolution is 72–600 DPI; the default is 300 DPI and the default rendered-image limit is 50 million pixels
- cancellation is checked between operations and passed to the engine; native rendering and in-process OCR are not guaranteed to stop immediately after cancellation, so enforce hard job deadlines in a separately supervised worker
TesseractOcrEnginerequires native Tesseract support and language data files at runtime
Licensing
ZingPDF is proprietary software. Review LICENSE.txt and ensure you have paid license coverage with sufficient seats, or another applicable commercial agreement, before commercial use or commercial bundling. Versions released during a paid subscription remain licensed within the purchased scope after it ends; new versions and support require an active subscription.
Evaluation and other non-commercial use are free.
Support and compatibility
See SUPPORT.md in the package root or docs/project/SUPPORT.md in the repository for the current support stance and release-readiness notes.
Related docs
- docs: zingpdf.dev/docs.html
- guides: zingpdf.dev/guides.html
- repository: github.com/ZingPDF/ZingPDF
| 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. |
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.