Recognizes Text Only Or Barcode Only

To recognize text only:

String s = ocr.recognize(new File[] {new File("test.png")},
Ocr.RECOGNIZETYPETEXT, Ocr.OUTPUTFORMATPLAINTEXT);

To recognize barcode only:

String s = ocr.recognize(new File[] {new File("test.png")},
Ocr.RECOGNIZETYPEBARCODE, Ocr.OUTPUTFORMATPLAINTEXT);

Perform OCR On Part Of The Image

In some cases, you might not want to OCR the whole image. In that case, you can OCR on part of the image to save time:

String s = ocr.recognize("C:/test.png", -1, 0, 0, 400, 200, Ocr.RECOGNIZETYPETEXT, Ocr.OUTPUTFORMATPLAINTEXT);
The above code OCR the top left part of the image with width 400 pixels and height 200 pixels.

Perform OCR On Multiple Input Files In One Shot

String s = ocr.recognize("C:/test.png;C:/test2.jpg", -1, 0, 0, 400, 200, Ocr.RECOGNIZETYPETEXT, Ocr.OUTPUTFORMATPLAINTEXT);

Perform OCR On A Certain Page From The Specified TIFF File

A TIFF file may contain multiple pages. If you need to recognize only a certain page, you can specify the page number as following:

String s = ocr.recognize("C:/test.png", 2, -1, -1, -1, -1, Ocr.RECOGNIZETYPETEXT, Ocr.OUTPUTFORMATPLAINTEXT);
Note 2 means the second page (the page number of the first page is 1).

Perform OCR On A PDF Input File

You use the following method to perform OCR on a PDF input file:

String s = ocr.recognize("C:/test.pdf", -1, 100, 100, 400, 200, Ocr.RECOGNIZETYPETEXT, Ocr.OUTPUTFORMATPLAINTEXT);

More documentation, please visit http://asprise.com/royalty-free-library/c%23-sharp.net-ocr-barcode-reader-sdk-samples-docs.html

Last edited Jul 5, 2014 at 9:02 AM by asprise, version 1