Usage
General Use
The Signature Library includes examples in a range of languages including:
- HTML
- Java
- JavaScript
- C++
- C#
- VB
A full description of the API can be found in the Signature-Components-API document.
The following examples demonstrate use of the API in Javascript:
Capture a signature:
sigCtl = new ActiveXObject("Florentis.SigCtl");
dynCapt = new ActiveXObject("Florentis.DynamicCapture");
rc = dynCapt.Capture(sigCtl,"Who","Why");
Following successful capture, save the text format of the Signature Object:
SignatureText = sigCtl.Signature.SigText; // save Base64 encoded signature
Create a PNG image of the signature:
rc = sigCtl.Signature.RenderBitmap(filename, 300, 150, "image/png", 0.5, 0xff0000, 0xffffff, 0.0,0.0, flags );
In a Windows Forms application it is not necessary to create an image file to display the signature. The ActiveX component provides automatic rendering of the signature and this is demonstrated in the HTML samples for Internet Explorer:
...
var sigCtl = document.getElementById("sigCtl1");
sigCtl.Signature.SigText=SignatureText;
...
<div>
<object id="sigCtl1" style="width:60mm;height:35mm"
type="application/x-florentis-signature">
</object>
</div>
ActiveX support has been removed from new versions of Internet Explorer and is generally not available in alternative browsers. For this reason SigCaptX is available as an extension of the Signature Library to give web browser applications full access to the Signature Library API.
Release 4.10 of the Signature SDK features configuration options for STU devices, licensing and the CaptureWindow.
4.10's updates can be configured via a CONFIG file. This CONFIG file defines the settings for the signature capture window and is encoded in JSON format.
Creating the config file
In order for users to be able to use these configuration options, a CONFIG file must be created within the File Explorer with the following paths:
%ProgramData%\Wacom\SignatureCapture\.configwill set settings for all users.- Meanwhile,
%AppData%\Wacom\SignatureCapture\.configand%LocalAppData%\Wacom\SignatureCapture\.configwill configure the settings of an individual user. The settings set for individual users override those set for all users.
An example CONFIG file can be viewed below:
"License": "<JWT license string>",
"STU": {
"USB": {
"exclusiveLock": true,
"openRetries": 3,
"openRetrySleepMS": 500
}
},
"CaptureWindow": {
"Language": "en",
"Caption": "Wacom Signature Capture v4.9",
"BackgroundColor": "#7FE3FF",
"Size": {
"Width": "160mm",
"Height": "120mm"
},
"OutsideFont": {
"Facename": "Verdana",
"Weight": "normal",
"Style": "normal",
"Size": 12,
"Color": "#000000"
},
"InsideFont": {
"Facename": "Georgia",
"Weight": "normal",
"Style": "italic",
"Size": 12,
"Color": "#880000"
},
"Buttons": {
"Font": {
"Facename": "Consolas",
"Weight": "bold",
"Size": 12,
"Style": "normal",
"Color": "#CC0000"
},
"Order": [
"OK",
"Clear",
"Cancel"
],
"Labels": {
"OK": "Accept",
"Clear": "Restart",
"Cancel": "Quit"
}
},
"ElementPlacement": {
"Why": "outside",
"Who": "inside",
"When": "inside",
"Buttons": "inside"
},
"DateTimeFormat": "HH:mm dd MMMM yy",
"SignatureArea": {
"GuideType": "line",
"Color": "#F0F0F0",
"Width": "108mm",
"Height": "55mm",
"Ink": {
"Color": "#0000CC",
"Width": "3px"
}
}
}
General notes:
- All fields
WeightandStyleare case-sensitive. Valid options forWeightare: "light", "normal" & "bold", while options forStyleare: "normal" & "italic". - The field
Facenameis also case-sensitive and should match a font that is already installed on the system. - Valid dimensions for
WidthandHeightaremm(millimetres),px(pixels) andin(inches). - Both
ColorandBackgroundColorshould be given a hexadecimal RGB value.
License settings
Licenses are structured in JWT (JSON Web Token) format.
For more information on licensing, click here.
STU settings
"STU": {
"USB": {
"exclusiveLock": true,
"openRetries": 3,
"openRetrySleepMS": 500
},
"Serial": {
"Devices": [
{
"DisplayName": "Serial STU 540",
"Port": "COM1",
"baudRate": 128000
},
]
}
},
Settings for the STU variety of signature capture devices can be configured further here. It is split into two categories
- USB settings
- Serial settings
USB settings
exclusiveLock: boolean that when true, sets exclusive access to the USB device, meaning no other processes can use it simultaneously.openRetries: This defines the number of times that the system will attempt to reopen the USB connection, in the event of failure.openRetrySleepMS: Amount of time in milliseconds that a system waits, in the event of a connection attempt failing.
Serial settings
Devices: An array of serial devices. Each device will have the following values:DisplayName: The name of the connected device (e.g., "Serial STU 540").Port: Value of the assigned serial port.baudRate: The communication speed. By default, values are set in bits per second.
CaptureWindow settings
BackgroundColor
| BackgroundColor | |
|---|---|
| The background color of the capture window. Should be set to hex RGB value with '#', eg "#0000CC" |
| Example value | |
|---|---|
| #C0C0C0 | |
Language
| Language | |
|---|---|
| The language of the capture window. Should be set to a language tag, e.g. "en" |
| Example value | |
|---|---|
| en | |
Caption
| Caption | |
|---|---|
| The caption or title of the capture window. |
| Example value | |
|---|---|
| Wacom Signature Capture | |
Size
Width & Height are both required values, with mm, in and px accepted as valid units of measurement.
If Width and Height are not given a value, the size of the capture window reverts to its default dimensions.
NB: The values set in this category take precedence over the
WidthandHeightvalues withinSignatureArea. For more information click here.
| Size | |
|---|---|
| Defines the size of the capture window. |
| Properties | |
|---|---|
| Width | The capture window's width. |
| Height | The capture window's height. |
| Example values | |
|---|---|
| Width | 800px |
| Height | 75mm |
OutsideFont
Valid options for Weight are: "light", "normal" & "bold", while options for Style are: "normal" & "italic". Size
is set via an int value, while Color is set via an RGB hex value like in BackgroundColor.
| OutsideFont | |
|---|---|
| Defines the font settings for outside text. |
| Properties | |
|---|---|
| Facename | The font's name. |
| Weight | How emboldened the font is. |
| Style | The font's style. |
| Size | The font size. |
| Color | The font's color. |
| Example values | |
|---|---|
| Facename | Verdana |
| Weight | normal |
| Style | normal |
| Size | 12 |
| Color | #0000CC |
InsideFont
As with OutsideFont, InsideFont's valid options for Weight are: "light", "normal" & "bold", options for Style
are: "normal" & "italic". Size is set via an int value, while Color is set via an RGB hex value like in
BackgroundColor.
| InsideFont | |
|---|---|
| Defines the font settings for inside text. |
| Properties | |
|---|---|
| Facename | The font's name. |
| Weight | How emboldened the font is. |
| Style | The font's style. |
| Size | The font size. |
| Color | The font's color. |
| Example values | |
|---|---|
| Facename | Verdana |
| Weight | light |
| Style | italic |
| Size | 10 |
| Color | #000000 |
Buttons
| Buttons | |
|---|---|
| Defines the settings for buttons. |
| Properties | |
|---|---|
| Order | Set in which order the buttons appear on the screen. NB: If used, each of the 3 strings - "OK", "Clear" & "Cancel" - must be used. |
| Labels | Set a label for one of the buttons. |
| Font | Defines the font settings for the button. |
| Facename | The font's name. |
| Weight | How emboldened the font is. |
| Size | The font size. |
| Color | The font's color. |
| Example values | |
|---|---|
| Order | ["Cancel", "OK", "Clear"] |
| Labels | {"OK": "Accept"} |
| Font | |
| Facename | Verdana |
| Weight | bold |
| Size | 10 |
| Color | #CC0000 |
ElementPlacement
Elements able to be placed include Why, Who, When & Buttons. Placement options for these elements include:
- "inside"
- "outside"
- "" (unspecified, will use default location)
As mentioned above, when not specified, these elements are placed in their default locations. By default:
Who&Whenare set as inside.Why&Buttonsare set as inside for signature devices & outside for all other devices.
| ElementPlacement | |
|---|---|
| Defines the placement of "Why" and "When" elements (i.e. the reason for and date of signing). |
| Properties | |
|---|---|
| Why | Reason for signing. |
| When | When the signature is being completed. |
| Who | The identity of the signer. |
| Buttons | The buttons to interact with the capture window. |
| Example values | |
|---|---|
| Why | inside |
| When | "" |
| Who | "" |
| Buttons | "" |
DateTimeFormat
DateTimeFormat uses the default Windows formatting for date/time (HH:mm dd MMMM yy).
| DateTimeFormat | |
|---|---|
| Format for displaying date and time (HH:mm dd MMMM yy). |
| Example values | |
|---|---|
| 13:51 30 July 24 | |
SignatureArea
| SignatureArea | |
|---|---|
| Defines the settings for the signature area. |
| Properties | |
|---|---|
| GuideType | Sets the type of guide for the signature. Accepted values are line, box and none. |
| Color | Sets the background color for the signature area. The value should be set to an RGB hex value. |
| Width | Sets the width of the signature area. |
| Height | Sets the height of the signature area. |
| Ink | Sets the values for the digital ink. |
| Color | Sets the color of the ink stroke. |
| Width | Sets the width of the ink stroke. |
NB: If only Height or Width but not the other is specified, the aspect ratio of the tablet is used to calculate the other. For STU devices, if both are specified, Height is ignored as the aspect ratio is fixed. Additionally, these values are ignored if
CaptureWindow.Sizeis set.
| Example values | |
|---|---|
| GuideType | line |
| Color | #FFFFFF |
| Width | 300px |
| Height | 200px |
| Ink | |
| Color | #0000CC |
| Width | 3px |
Sample Code
Sample code for the Windows Ink SDK for signature is hosted on GitHub:
Windows Samples:
- https://github.com/Wacom-Developer/sdk-for-signature-windows
- https://github.com/Wacom-Developer/sdk-for-signature-sigcaptx-windows
Android Samples: