Sectors: Finance • Information Technoloy • Government • Healthcare • Industries • Education • (show all)
To recognize text only:
string s = ocr.Recognize("C:\img.jpg", -1, -1, -1, -1, -1,
AspriseOCR.RECOGNIZE_TYPE_TEXT, AspriseOCR.OUTPUT_FORMAT_PLAINTEXT);
To recognize barcode only:
string s = ocr.Recognize("C:\img.jpg", -1, -1, -1, -1, -1,
AspriseOCR.RECOGNIZE_TYPE_BARCODE, AspriseOCR.OUTPUT_FORMAT_PLAINTEXT);
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:\img.jpg", -1, 0, 0, 400, 200,
AspriseOCR.RECOGNIZE_TYPE_ALL, AspriseOCR.OUTPUT_FORMAT_PLAINTEXT);
The above code OCR the top left part of the image with width 400 pixels and height 200 pixels.
string s = ocr.Recognize("C:\img1.jpg;C:\img2.png", -1, -1, -1, -1, -1,
AspriseOCR.RECOGNIZE_TYPE_ALL, AspriseOCR.OUTPUT_FORMAT_PLAINTEXT);
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:\img1.tif", 2, -1, -1, -1, -1,
AspriseOCR.RECOGNIZE_TYPE_ALL, AspriseOCR.OUTPUT_FORMAT_PLAINTEXT);
Note 2 means the second page (the page number of the first page is 1).
You use the following method to perform OCR on a PDF input file:
string s = ocr.Recognize("test.pdf", -1, -1, -1, -1, -1,
AspriseOCR.RECOGNIZE_TYPE_TEXT, AspriseOCR.OUTPUT_FORMAT_PLAINTEXT);