Resources Base
Table of contents

Development

Can I OCR multiple zones at the same time

Yes, but only with OCRPro . The code is like

var aryRects = [{
        left: 213,
        top: 105,
        right: 419,
        bottom: 166
    },
    {
        left: 112,
        top: 256,
        right: 303,
        bottom: 325
    }
];
DWObject.Addon.OCRPro.RecognizeRect(
    0, aryRects,
    function(sImageIndex, aryRects, result) {
        if (result == null)
            return null;
        var bRet = "",
            pageCount = result.GetPageCount();
        if (pageCount == 0) {
            alert("OCR result is Null.");
            return;
        } else {
            for (var i = 0; i < pageCount; i++) {
                var page = result.GetPageContent(i);
                var letterCount = page.GetLettersCount();
                for (var n = 0; n < letterCount; n++) {
                    var letter = page.GetLetterContent(n);
                    bRet += letter.GetText();
                }
            }
            console.log(bRet);
        }
    },
    function(errorcode, errorstring, result) {
        if (errorcode != -2600 && errorcode != -2601) {
            //-2600:LicenseChecker cannot be empty.  
            //-2601:Cannot connect to the LicenseChecker, please check and make sure it's set correctly.
            alert(errorstring);
        }
        var strErrorDetail = "";
        var aryErrorDetailList = result.GetErrorDetailList();
        for (var i = 0; i < aryErrorDetailList.length; i++) {
            if (i > 0)
                strErrorDetail += ";";
            strErrorDetail += aryErrorDetailList[i].GetMessage();
        }
        if (strErrorDetail.length > 0 && errorstring != strErrorDetail)
            alert(strErrorDetail);
    }
);

Is this page helpful?

YesYes NoNo

In this article:

latest version

    • Latest Version
    • Version 17.0
    • Version 16.2
    • Version 16.1.1
    Change +
    © 2003–2021 Dynamsoft. All rights reserved.
    Privacy Statement / Site Map / Home / Purchase / Support