Beispiel #1
2
    public int prReleaseDocument()
    {
        try
        {
            if (ndoc != null)
            {
                ndoc.Dispose();
                ndoc = null;
            }
        }
        catch (Exception e)
        {
            _errorMessage = e.Message + " --- prReleaseDocument()";
            return 1305;
        }

        return 0;
    }
Beispiel #2
0
    public int prDisconnect()
    {
        /* Closing the device */
        while (_pr != null)
        {
            try
            {
                if (ndoc != null)
                {
                    ndoc.Dispose();
                    ndoc = null;
                }

                _pr.Scanner.CleanUpData();

                _pr.Close();
                _pr.Dispose();
                _pr = null;

                break;
            }
            catch (Exception)
            {
                //if (gxSystem.GetErrorCode() == (int)GX_ERROR_CODES.GX_EBUSY)
                continue;
            }
        }
        return 0;
    }
Beispiel #3
0
    public int prCaptureMRZ()
    {
        try
        {
            /* Capturing images */
            //_pr.Capture();

            /* Getting the MRZ data */
            ndoc = _pr.Engine.Analyze(_pr.Scanner.GetPage(0).Del(Pr22.Imaging.Light.UV),
                new Pr22.Task.EngineTask().Add(Pr22.Processing.FieldSource.Mrz, Pr22.Processing.FieldId.All));

            if (ndoc.GetFields().Count == 0)
                throw new NoDocumentFoundException("No MRZ data found");
        }
        catch (Pr22.Exceptions.General e)
        {
            return _helper.GetErrorMessage(e, out _errorMessage);
        }
        catch (NoDocumentFoundException e)
        {
            _errorMessage = e.Message;
            return 1303;
        }
        catch (Exception e)
        {
            _errorMessage = e.Message + " --- prCaptureMRZ()";
            return 1305;
        }

        return 0;
    }