Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ocr

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ocr

Accusoft OCR Xpress

  • 4.0.26
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
21
decreased by-36.36%
Maintainers
1
Weekly downloads
 
Created
Source

The OCR solution for Node.js developers.

What is OCR Xpress?

OCR Xpress for Node.js enables you to add OCR capabilities to your applications.

  • Text or PDF output - recognize text from BMP files and convert to searchable text or multiple-page PDF files.
  • Structured Results - results are organized in a hierarchical model where every character is tied to a word, text line, text block, region, and page.
  • Languages - recognize text in over 30 different languages.
  • Simple - by providing only a minimal asynchronous API, OCR Xpress is easy to learn. With a few lines of code, recognize text found in images produced by scanners, cameras, or fax machines.

OCR with less than 20 lines of code

  1. Make sure you have the following system requirements:
Linux 64 bit
  • node -v x64 6.8 or greater and npm.
  • gcc --version 4.8.1 or greater.
  • g++ -v 4.8.1 or greater.
  • java -version x64 JRE 1.8
Windows 64 bit
  • node -v x64 6.8 or greater and npm.
  • java -version x64 JRE 1.8
  • python -V 2.7.x
  • Common Tool for C++ from Visual Studio 2015
    • This can be done via the free Community Edition of Visual Studio 2015. Insure you click on the check mark for Common Tools for C++ during the installation process of Visual Studio 2015.

NOTE: Be sure the path you're installing from does not contain a SPACE in the file path. This may cause issues when installing or registering the product.

  1. Set node build tools (Windows only)

npm config set python python2.7 npm config set msvs_version 2015

  1. Register an email address for a free account to get access to our OCR Xpress evaluation version
  2. Run npm install ocr
  3. Run the license utility to install an evaluation license. When prompted enter the email you registered with in step 2:
  • to launch window: cd node_modules/ocr && npm run register
  • to register manually: cd node_modules/ocr && npm run register -- youremail@domain.com
  1. Use the following to get a taste of what OCR Xpress can do:
var ocr = require('ocr');

// Set default values. 
var params = {
    input: './node_modules/ocr/samples/images/color.bmp',
    output: './out.txt',
	format: 'text'
};
    
// OCR the input image and output result to text file given by params.output
ocr.recognize(params, function(err, document){
    if(err)
        console.error(err);
    else{        
        //output the document object: 
        console.log(document); 
    }
});

Accessing Results

The Results Manager is a collection of "get" functions that returns an array of various result objects.

For example, to get the text of the first word recognized in the document:

var textLine = document.getWords()[0].text;

Resulting objects return more than just text. The following provides access to characters, words, and the bounding box of the first line of text, inside the first region of text recognized in the document:

var textLine = document.getRegions()[0].getTextLines()[0];

It is also possible to control the output of the result by adjusting recognition parameters. For example,

var params = {
    output: './out.pdf',
    format: 'pdf'
};

There are many other OCR capabilities such as page rotation, multiple supported languages, recognition confidence, and much more.

More Documentation and Support

OCR Xpress also includes detailed API documentation, a Getting Started guide, and code samples

  • Navigate to the node_modules/ocr/samples/ directory and check out more code samples.
  • Need more documentation? Check out the [User's Guide](http://help.accusoft.com/OCR Xpress/v4.0/nodejs/webframe.html).
  • Need help? Call Accusoft at (813) 875-7575.

Keywords

FAQs

Package last updated on 06 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc