Text Capture Listener

Defined under the namespace Scandit.Datacapture.Text

TextCaptureListener
interface TextCaptureListener

Added in version 6.5.0

Listener interface for traditional text capture.

didCaptureText(textCapture, session, getFrameData)
didCaptureText?(textCapture: TextCapture,
        session: TextCaptureSession,
        getFrameData: () => Promise<FrameData>): void

Added in version 6.5.0

Invoked whenever at least one text has been captured. The newly captured texts can be retrieved from TextCaptureSession.newlyCapturedTexts.

This method is invoked from a recognition internal thread. To perform UI work, you must dispatch to the main thread first.

Inside this method, you will typically want to start processing the captured texts somehow, e.g. by validating the text captured. Depending on the application, you will want to pause, or stop recognition, or continue reading texts:

  • To pause the capture session, but keep the camera (frame source) running, just set the text capture’s enabled property to false.

  • To stop the capture session, you will need to both disable the capture mode and stop the frame source. While it is possible to only stop the camera and keep the capture mode enabled, this may lead to additional capture events being delivered, which is typically not desired. The following lines of code show how to disable the capture mode and stop the frame source as well:

Text Capture Advanced Listener

Defined under the namespace Scandit.Datacapture.Text