npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ocr

v4.0.26

Published

Accusoft OCR Xpress

Downloads

115

Readme

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 -- [email protected]
  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.