PdfNetStack.Ocr.Models 1.0.0

dotnet add package PdfNetStack.Ocr.Models --version 1.0.0
                    
NuGet\Install-Package PdfNetStack.Ocr.Models -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PdfNetStack.Ocr.Models" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PdfNetStack.Ocr.Models" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="PdfNetStack.Ocr.Models" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PdfNetStack.Ocr.Models --version 1.0.0
                    
#r "nuget: PdfNetStack.Ocr.Models, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package PdfNetStack.Ocr.Models@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PdfNetStack.Ocr.Models&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=PdfNetStack.Ocr.Models&version=1.0.0
                    
Install as a Cake Tool

PdfNetStack.Ocr.Models

The PP-OCRv5 mobile models that PdfNetStack.Ocr runs to make scanned PDFs searchable: text detection, text line orientation, and Latin and Arabic recognition, in ONNX format. About 21 MB.

dotnet add package PdfNetStack.Ocr
dotnet add package PdfNetStack.Ocr.Models
using PdfNetStack;
using PdfNetStack.Ocr;

using var engine = OnnxOcrEngine.Load(new OnnxOcrEngineOptions { Languages = ["latin", "arabic"] });
PdfDocument doc = PdfDocument.Open("scan.pdf");
new PdfOcr(engine, new PdfOcrOptions { Languages = ["latin", "arabic"] }).MakeSearchable(doc);
doc.Save("scan-searchable.pdf");

How it works

The package holds no code. On build and publish it copies the four model files into a pdfnetstack-ocr-models folder next to the application, and OnnxOcrEngine.Load() reads them from there. The files stay outside a single file bundle. Each one is checked against its pinned SHA-256 before ONNX Runtime loads it, so a damaged or swapped file fails to load instead of giving wrong text.

To keep the models elsewhere, leave this package out and pass a folder: OnnxOcrEngine.Load("path/to/models"). OnnxOcrEngine.ModelHashes lists the files and their hashes.

File Model Size
ch_PP-OCRv5_det_mobile.onnx Text detection (DB) 4.8 MB
ch_PP-LCNet_x0_25_textline_ori_cls_mobile.onnx Text line orientation 1.0 MB
latin_PP-OCRv5_rec_mobile.onnx Latin script recognition 7.9 MB
arabic_PP-OCRv5_rec_mobile.onnx Arabic script recognition (also Persian and Urdu) 8.0 MB

License

The models are PaddleOCR's (https://github.com/PaddlePaddle/PaddleOCR, Copyright (c) 2016 PaddlePaddle Authors), as converted to ONNX by RapidOCR (https://github.com/RapidAI/RapidOCR, Copyright (c) 2021 RapidAI), both under the Apache License 2.0. LICENSE.txt and NOTICE.txt in the package carry the license and notices; keep them with the files if you redistribute them. The small build file that copies the models is part of PdfNetStack, MIT License.

By Jamal Abdelkhalek, JADEV. Models Apache-2.0.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 0 11/5/2026