PdfNetStack.Ocr.Tool 1.1.0

dotnet tool install --global PdfNetStack.Ocr.Tool --version 1.1.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local PdfNetStack.Ocr.Tool --version 1.1.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=PdfNetStack.Ocr.Tool&version=1.1.0
                    
nuke :add-package PdfNetStack.Ocr.Tool --version 1.1.0
                    

PdfNetStack.Ocr.Tool

pdfnetstack-ocr: make scanned PDF files searchable from the command line. It finds the scan on each page, reads it with the PP-OCRv5 models on ONNX Runtime, and lays the words over it as invisible text: the page looks the same, and now selects, copies and searches. Latin and Arabic script. Built on PdfNetStack.Ocr by Jamal Abdelkhalek at JADEV. MIT licensed.

dotnet tool install -g PdfNetStack.Ocr.Tool

The models and ONNX Runtime's native libraries come with the tool. It is a package of its own so that PdfNetStack.Tool stays small for everyone who never runs OCR; with both installed, pdfnetstack ocr runs this tool.

Usage

pdfnetstack-ocr scan.pdf searchable.pdf                              # Latin script
pdfnetstack-ocr scan.pdf searchable.pdf --languages latin,arabic     # each line in its best reading
pdfnetstack-ocr scan.pdf searchable.pdf --text scan.txt              # also write the text found
pdfnetstack-ocr scan.pdf searchable.pdf --json                       # per page report
pdfnetstack-ocr scan.pdf searchable.pdf --models ./my-models         # models from a folder of your own
pdfnetstack ocr scan.pdf searchable.pdf                              # the same, through pdfnetstack

Pages that already show text are left as they are. Pages scanned sideways or upside down are found and read turned back (--no-orientation turns that off). Run pdfnetstack-ocr --help for every option. Exit codes: 0 done, 1 written but some pages failed, 2 nothing written.

Requires the .NET 8 or later runtime, on Windows, Linux or macOS, x64 or arm64 (macOS x64 is not built by ONNX Runtime).

Licenses

The tool is MIT. The PP-OCRv5 models are PaddleOCR's, converted to ONNX by RapidOCR, both Apache-2.0 (models/LICENSE.txt and models/NOTICE.txt in the package). ONNX Runtime is MIT (onnxruntime/LICENSE and onnxruntime/ThirdPartyNotices.txt). ONNX Runtime's telemetry is turned off before the first model loads; on Linux and macOS also set ORT_DISABLE_TELEMETRY=1 in the environment for the runtime to send nothing at all.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.1.0 53 11/5/2026