Signature Capture in Java

Shows how to use Decoder Signature to capture an area within a document (such as a signature) enclosed by a specific pattern and save it as an image.

Download Source

Product

DataWedge - 11.0

Devices

All supported Zebra Android Nougat (v7.0) or above devices

Overview

Decoder Signature is a special barcode format that captures an area of a document (such as a signature) as an image. It is marked by two identical bar patterns placed on either side of the capture area. The bar pattern extends the full height of that area, for example:


Decoder Signature was first introduced in DataWedge version 7.5. This sample app demonstrates how to use Decoder Signature to capture data using DataWedge Intent APIs. The app captures images in .JPG (default) and .BMP format.

This sample performs the following:

  1. Registers a broadcast receiver to listen for DataWedge intents.
  2. Creates a DataWedge profile named "SignatureCaptureProfile", if it does not exist, and retrieves the result from the broadcast receiver. The profile includes the following configurations:
  3. When scanning a signature from any document, the signature captured is displayed as a separate image.

This sample application is only intended for educational purposes, demonstrating the use of DataWedge intent API(s).

APIs Used

DataWedge API App Functionality
Create Profile Create a profile with specific parameters for Document Capture.
Delete Profile Delete the profile if creating the profile fails.
Get Profiles List Get the list of DataWedge profiles on the device to check if a profile exists.
Set Config Set the appropriate configurations specified.
Soft Scan Trigger Scan or toggle the software scan trigger.

Requirements

  • DataWedge version 8.2 or higher
  • Android API 24 (Nougat) or higher

Using This Sample

  1. Download and build the sample app SignatureCapture2.
  2. Launch the sample app.
    • DataWedge profile "SignatureCaptureProfile" is created if it does not exist.
    • If profile creation fails, the profile is deleted. Tap Re-create profile to attempt to recreate the profile.
  3. Tap Scan to start scanning, or press the trigger button to scan. The sample provided in the Overview section can be used to scan. The label type, signature, image format, size and image of the captured data is displayed:
  4. Tap Clear to clear the data displayed.

Related guides: