General information
The MobileDevice class represents a mobile device. It contains methods for connecting and disconnecting a device and for starting and controlling the signature process. Furthermore, it offers a range of properties and events.
It is not possibly to directly create instances of this class. Corresponding instances for mobile devices are provided via the MobileDeviceFound event of the MobileCaptureclass.
Name property
This property makes the name of the mobile device available.
string Name;
|
In |
Out |
Possible values |
Description |
|---|---|---|---|
|
|
✔️ |
String, length > 0 |
Name of the mobile device |
DeviceMaker property
This property provides the name of the mobile device manufacturer.
Available from version 1.6.0.0 onwards
string DeviceMaker;
|
In |
Out |
Possible values |
Description |
|---|---|---|---|
|
|
✔️ |
String, length > 0 |
Name of the manufacturer of the mobile device |
DeviceVersion property
This property provides the operating system version of the mobile device.
Available from version 1.6.0.0 onwards
string DeviceVersion;
|
In |
Out |
Possible values |
Description |
|---|---|---|---|
|
|
✔️ |
String, length > 0 |
Operating system version of the mobile device |
DeviceModel property
This property provides the model name of the mobile device.
Available from version 1.6.0.0 onwards
string DeviceModel;
|
In |
Out |
Possible values |
Description |
|---|---|---|---|
|
|
✔️ |
String, length > 0 |
Model name of the mobile device |
Width property
This property provides the width of the mobile device’s display.
This property is only available if the device has been successfully connected. If this property is requested without a connection to the device, an exception is thrown.
int Width;
|
In |
Out |
Possible values |
Description |
|---|---|---|---|
|
|
✔️ |
>0 |
Display width of the mobile device in pixels |
Height property
This property provides the height of the mobile device’s display.
This property is only available if the device has been successfully connected. If this property is requested without a connection to the device, an exception is thrown.
int Height
|
In |
Out |
Possible values |
Description |
|---|---|---|---|
|
|
✔️ |
>0 |
Display height of the mobile device in pixels |
SignatureResolution property
This property contains the resolution of the signature image.
The signature image is provided by the event SignatureConfirmed.
double SignatureResolution;
|
In |
Out |
Possible values |
Description |
|
|---|---|---|---|---|
|
✔️ |
✔️ |
>0 |
Resolution of the signature image in dpi |
|
|
|
96 |
Default value |
||
SignatureWidth property
This property contains the width of the signature image.
The signature image is provided by the event SignatureConfirmed.
int SignatureWidth;
|
In |
Out |
Possible values |
Description |
|
|---|---|---|---|---|
|
✔️ |
✔️ |
>0 |
Width of signature image in pixels |
|
|
|
200 |
Default value |
||
SignatureHeight property
This property makes it possible to read and set the desired height of the signature image.
The signature image is provided by the event SignatureConfirmed.
int SignatureHeight;
|
In |
Out |
Possible values |
Description |
|
|---|---|---|---|---|
|
✔️ |
✔️ |
>0 |
Height of signature image in pixels |
|
|
|
50 |
Default value |
||
SignaturePenColor property
This property contains the colour of the signature.
The colour selected here is taken into account by the real-time view of the apps (Android and iOS from version 2.2.0), as well as the control and the rendered signature image.
The property must be set before calling the CaptureSignature method, as this call exchanges colour information with the app.
Available from version 1.2.6.0 onwards
System.Drawing.Color SignaturePenColor;
|
In |
Out |
Possible values |
Description |
|
|---|---|---|---|---|
|
✔️ |
✔️ |
|
Colour value |
|
|
|
Blue |
Default value |
||
Application example:
SignaturePenColor = Color.FromKnownColor(KnownColor.Blue);
VariablePenWidth property
This property controls whether the signature is displayed with variable line thickness in the rendered image.
The property must be set before calling the CaptureSignature method.
Available from version 1.6.0.0 onwards.
bool VariablePenWidth;
|
In |
Out |
Possible values |
Description |
|---|---|---|---|
|
✔️ |
✔️ |
true |
Signature is displayed with variable line thickness |
|
false |
Signature is not displayed with variable line thickness |
SignatureTransparency property
This property determines whether the background of the rendered signature image should be transparent or white.
The property must be set before calling the CaptureSignature method, as this call renders the signature image and passes it as an event argument.
Available from version 1.2.6.0 onwards.
bool SignatureTransparency;
|
In |
Out |
Possible values |
Description |
|---|---|---|---|
|
✔️ |
✔️ |
true |
Image is rendered with a transparent background |
|
false |
Image is rendered with a white background |
Connected property
This property indicates whether a device is currently connected.
Available from version 1.5.0.0 onwards.
bool Connected;
|
In |
Out |
Possible values |
Description |
|---|---|---|---|
|
|
✔️ |
true |
The device is currently connected. |
|
false |
No device is currently connected. |
SignaturePenWidth property
This property contains the stroke weight of the signature when rendered.
The value must be set before calling the ConfirmSignature method.
Available from version 1.5.0.0 onwards.
int SignaturePenWidth;
|
In |
Out |
Possible values |
Description |
|
|---|---|---|---|---|
|
✔️ |
✔️ |
>0 |
Stroke weight of the signature during rendering |
|
|
|
3 |
Default value |
||
SignatureMustBeConfirmed property
This property determines whether a signature must be confirmed via the API. If so, for confirmation via the mobile app, the SignatureConfirmed event only sends the number of signature points.
The value must be set before calling the ConfirmSignature method.
Available from version 1.5.0.0 onwards.
Bool SignatureMustBeConfirmed
|
In |
Out |
Possible values |
Description |
|---|---|---|---|
|
✔️ |
✔️ |
true |
Signature must be confirmed via the API |
|
false |
Default Signature is only confirmed via the mobile app |
Dispose method
The Dispose method should be called as soon as the instance is no longer required. As a result, any connection to the device (if still in place) is terminated and various cleanup operations are performed.
void Dispose();
Connect method
The Connect method establishes a connection to a mobile device and performs the handshake. Since these processes are asynchronous, this method does not send a return value and does not block the program run (or the thread). After this, the DeviceConnected event can be used to check if and when a connection was successfully made.
void Connect(string pairingCode);
|
Parameter |
Description |
|---|---|
|
pairingCode |
The pairing code displayed on the mobile device via the app |
Disconnect method
The Disconnect method ends the connection to the mobile device.
void Disconnect();
captureSignature method
This method starts the signature process on the mobile device. If a confirmation text is passed, this is then displayed on the mobile device. In such cases, the signature process itself only starts once the text has been accepted.
When the signing process begins on the mobile device, the SigningStarted event is called. If a confirmation text has been added upstream, this happens exactly when the confirmation text has been accepted (and only then). It may therefore be advisable to implement any further program steps in the corresponding event handler and not immediately after this method is called.
If this method is called without a connection to the device being in place, an exception is thrown.
void CaptureSignature();
void CaptureSignature(string confirmationText);
|
Parameter |
Description |
|---|---|
|
confirmationText |
Optional Confirmation text to be displayed on the mobile device |
RetrySignature method
This method discards all signature data that has been previously captured and removes the signature from the mobile device’s display. The mobile device remains in the signature process, however.
When the signature process is restarted on the mobile device, the SignatureRetry event is called.
If this method is called without a connection to the device being in place, an exception is thrown.
void RetrySignature();
CancelSignature method
The CancelSignature method discards all signature data captured so far. The mobile device quits the signature process.
If the signing process is cancelled on the mobile device, the SigningCanceled event is called.
If this method is called without a connection to the device being in place, an exception is thrown.
The SigningCanceled event is called both after this method and when the “Cancel” button is activated on the mobile device. It is recommended to handle the signature cancellation in the callback of the event, as this allows both cases to be processed simultaneously.
void CancelSignature();
ConfirmSignature method
This method accepts the captured signature data. The mobile device quits the signature process. The captured signature data, along with a rendered image of the signature, are then made available via the SignatureConfirmed event.
If this method is called without a connection to the device being in place, an exception is thrown.
The SignatureConfirmed event is called both after this method and when the “OK” button is activated on the mobile device. It is recommended to handle the signature confirmation in the callback of the event, as this allows both cases to be processed simultaneously.
void ConfirmSignature();
DeviceConnected event
This event is called whenever the attempt to establish a connection with the mobile device has been ended.
The following shows an example implementation in which user-defined names have been replaced by placeholders (%…%).
%MOBILECAPTURE_NAME%.DeviceConnected += new DeviceConnectedHandler(%CALLBACK_FUNCTION%);
private void %CALLBACK_FUNCTION%(object sender, DeviceConnectedEventArgs e);
The DeviceConnectedEventArgs class contains the following member variables:
|
Member variable |
Type |
Description |
|---|---|---|
|
Result |
The result of the attempt to establish a connection with the mobile device |
SigningStarted event
This event is called whenever the signature process is initiated on the mobile device. Thus, in cases where there is an upstream confirmation text (see CaptureSignature), it also provides information about if and when the user accepts the text.
The following shows an example implementation in which user-defined names have been replaced by placeholders (%…%).
%MOBILECAPTURE_NAME%.SigningStarted += new EventHandler(%CALLBACK_FUNCTION%);
private void %CALLBACK_FUNCTION%(object sender, EventArgs e);
SignatureRetry event
This event is called whenever the signature process is repeated on the mobile device.
The following shows an example implementation in which user-defined names have been replaced by placeholders (%…%).
%MOBILECAPTURE_NAME%.SignatureRetry += new EventHandler(%CALLBACK_FUNCTION%);
private void %CALLBACK_FUNCTION%(object sender, EventArgs e);
SigningCanceled event
This event is called whenever the signature process is cancelled on the mobile device, regardless of whether this was triggered by the button on the mobile device or by calling the CancelSignature method.
The following shows an example implementation in which user-defined names have been replaced by placeholders (%…%).
%MOBILECAPTURE_NAME%.SigningCanceled += new EventHandler(%CALLBACK_FUNCTION%);
private void %CALLBACK_FUNCTION%(object sender, EventArgs e);
SignatureConfirmed event
This event is called whenever the signature captured on the mobile device is confirmed, regardless of whether this was triggered via the button on the mobile device or due to the ConfirmSignature method being called.
The following shows an example implementation in which user-defined names have been replaced by placeholders (%…%).
%MOBILECAPTURE_NAME%.SignatureConfirmed += new SignatureConfirmedHandler(%CALLBACK_FUNCTION%);
private void %CALLBACK_FUNCTION%(object sender, SignatureConfirmedEventArgs e);
The SignatureConfirmedEventArgs class contains the following member variables:
|
Member variable |
Type |
Description |
|---|---|---|
|
SignData |
byte[] (SignData) |
Signature data |
|
NumSignaturePoints |
int |
Number of points captured in the signature |
|
Image |
Image |
Rendered image of the signature |
The resolution, height, and width of the rendered signature image can be set before a signature is captured using the properties SignatureResolution, SignatureWidth, and SignatureHeight.
SignatureDataReceived event
This event is called whenever new points are captured using the mobile device and transmitted to the PC during the signature capture process. The newly captured points are delivered as a list in the event parameters. This allows you to respond to events during signing, for example after a certain number of points have been recorded or if signing has been interrupted for a longer period of time.
For security reasons, no time values are assigned to the points provided via this event. This means that it is not possible to reconstruct biometrical data by recording this unencrypted information.
The following shows an example implementation in which user-defined names have been replaced by placeholders (%…%).
%MOBILECAPTURE_NAME%.SignatureDataReceived += new SignatureDataReceivedHandler(%CALLBACK_FUNCTION%);
private void %CALLBACK_FUNCTION%(object sender, SignatureDataReceivedEventArgs e);
The SignatureDataReceivedEventArgs class contains the following member variables:
|
Member variable |
Type |
Description |
|---|---|---|
|
SigPoints |
List<SigPoint> |
List of newly captured signature points |
The SigPoint class contains the following member variables:
|
Member variable |
Type |
Description |
|---|---|---|
|
X |
double |
Horizontal coordinate of the signature point in pixels |
|
Y |
double |
Vertical coordinate of the signature point in pixels |
|
P |
double |
Pressure intensity of the signature point |
BonjourError event
This event is called whenever one of the asynchronous Bonjour methods reports a specific error.
The following shows an example implementation in which user-defined names have been replaced by placeholders (%…%).
%MOBILECAPTURE_NAME%.BonjourError += new BonjourErrorHandler(%CALLBACK_FUNCTION%);
private void %CALLBACK_FUNCTION%(object sender, BonjourErrorEventArgs e);
The BonjourErrorEventArgs class contains the following member variables:
|
Member variable |
Type |
Description |
|---|---|---|
|
ErrorCode |
The error code reported by Bonjour |
MobileCaptureError event
This event is called whenever one of the current service’s asynchronous internal methods throws an exception.
The following shows an example implementation in which user-defined names have been replaced by placeholders (%…%).
%MOBILECAPTURE_NAME%.MobileCaptureError += new MobileCaptureErrorHandler(%CALLBACK_FUNCTION%);
private void %CALLBACK_FUNCTION%(object sender, MobileCaptureErrorEventArgs e);
The MobileCaptureErrorEventArgs class contains the following member variables:
|
Member variable |
Type |
Description |
|---|---|---|
|
Exception |
Exception |
The exception thrown by the internal method |