Smart and powerful OCR tools

OCR in Linux

Nicomsoft OCR SDK for Linux consists of a set of precompiled dynamic libraries (lib*.so) for the x86 and x64 platforms, additional files required for OCR (they are placed in the same directory), and sample projects with source code. We have tested NSOCR on the following Linux-based operating systems:

  • Ubuntu
  • Mint
  • Fedora
  • Mageia
  • OpenSUSE

Nicomsoft OCR SDK files for Linux:

OCR for Linux: Files

  • ocrbin – Binary library files.
  • Sample Projects – Samples with source codes.
  • nsocr.h nsocr.cpp - C++ wrapper class for the API of the NSOCR library.
  • sample – C++ sample project.
  • Java – Files and sample project for using the NSOCR library in Java. Includes the JNSOCR JNI proxy library with source code.


How to use Nicomsoft OCR in Linux

You can move NSOCR files to any folder, but all files must be in the same folder. For C++ projects, you should use the TNSOCR class, which is implemented in the NSOCR.cpp file. That class loads the NSOCR library at runtime, so you don't have to manually include NSOCR into your project. You need to specify a full or relative path to the directory with the NSOCR binaries:

// Create OCR engine wrapper class
TNSOCR ocr(L“/usr/lib/ocrbin/”);
// Setup OCR lib directory
res = ocr.Engine_SetDataDirectory(L“/usr/lib/ocrbin”);

All string variables/parameters in the NSOCR library for Linux (paths to files, options values, recognized text, etc.) are in UCS4 form (wchar_t type, four bytes per character). The sample project shows how to use NSOCR.

The "Java" folder contains the JNSOCR JNE proxy library and the "Java Advanced Sample" project. The sample project demonstrates how to use Nicomsoft OCR in Java.

For the NSOCR API documentation please see "Docs" folder, or read the online documentation at


Support for PDF files

NSOCR supports GhostScript, which you need to install if you want to open PDF files. To install GPL GhostScript, download its source code from the official website and compile/install it:


After that, execute the following command with the root rights:

make install

For more information please refer to GhostScript documentation. Note that you don't need GhostScript to save OCR'ed text as PDF files, but only need it to open PDF files. You can also use any other library that can convert PDF files to images.



The current version of NSOCR for Linux does not support any scanning features. None of the Scan_XXXXX functions is available.