Skip to main content

JavaScript Wizard API

Introduction​

The Wizard library provides interactive controls for Wacom STU signature pads. Each screen can contain text, buttons, checkboxes, radio buttons, images, graphics primitives, PIN code input and signature capture. The Wizard control is part of the SDK's WebAssembly component.

A complete example is available in the wizard demo of the Signature JavaScript samples on GitHub.

Methods summary​

Connection​

MethodDescription
WizCtl constructorCreates a Wizard control.
padConnectConnects to an STU pad.
padDisconnectDisconnects the pad.
padModelNameReturns the pad model name.
padWidthReturns the pad screen width.
padHeightReturns the pad screen height.

Screen​

MethodDescription
resetClears the control list and prepares the next screen.
setPropertySets drawing and control properties.
displayShows the current screen on the pad.
fireClickSimulates a tap on an object.

Objects​

MethodDescription
addObjectAdds an object of any type.
addObjectButtonAdds a button.
addObjectCheckBoxAdds a checkbox.
addObjectDisplayAtShutdownKeeps the screen displayed after disconnection.
addObjectImageAdds an image.
addObjectInkingCaptures ink as an image.
addObjectInputAdds PIN code input.
addObjectInputEchoShows the entered input.
addObjectRadioButtonAdds a radio button.
addObjectSignatureCaptures a signature.
addObjectTextAdds text.
addPrimitiveAdds a line, rectangle or ellipse.

Enumerations​

The enumerations are available on the SDK module, for example sigSDK.ObjectType.ObjectButton. To combine option values, use the value property of each value, for example sigSDK.PrimitiveOptions.LineSolid.value | sigSDK.PrimitiveOptions.Fill.value.

ObjectType​

Identifies the object type in addObject.

ValueDescription
ObjectTextText.
ObjectButtonButton.
ObjectCheckboxCheckbox.
ObjectRadioButtonRadio button.
ObjectSignatureSignature capture.
ObjectInputPIN code input.
ObjectInputEchoInput echo.
ObjectImageImage.
ObjectDisplayAtShutdownKeeps the screen displayed after disconnection.
ObjectInkingInk capture.
ObjectPrimitiveGraphics primitive.

ButtonOptions​

Sets the text alignment and appearance of a button.

ValueDescription
BtnAlignCentreCentres the text horizontally. (Default)
BtnAlignMiddleCentres the text vertically. (Default)
BtnAlignLeftAligns the text to the left.
BtnAlignRightAligns the text to the right.
BtnAlignTopAligns the text to the top.
BtnAlignBottomAligns the text to the bottom.
BtnInvertDraws white text on a black background.
BtnGreyedDraws the button greyed out.
BtnHiLiteClickHighlights the button when it is tapped.

CheckboxOptions​

Sets the initial state and check symbol of a checkbox.

ValueDescription
CheckboxUncheckedInitially unchecked. (Default)
CheckboxCheckedInitially checked.
CheckboxDisplayTickShows a tick when checked.
CheckboxDisplayCrossShows a cross when checked.

InputEchoOptions​

Sets how an input echo displays the entered characters.

ValueDescription
EchoNoSpacingNo space between characters.
EchoHalfSpacingHalf a character space between characters.
EchoSingleSpacingOne character space between characters.
EchoDoubleSpacingTwo character spaces between characters.
EchoUnderlineUnderlines the echoed characters.

PrimitiveType​

Identifies the primitive type in addPrimitive.

ValueDescription
LineA line.
RectangleA rectangle.
EllipseAn ellipse.

PrimitiveOptions​

Sets the line style and fill of a primitive.

ValueDescription
LineSolidSolid line. (Default)
LineDashedDashed line.
OutlineDraws the outline only. (Default)
FillFills the shape with the fill colour.
FillXORFills the shape using XOR.

Wizard objects​

The addObject* methods return an object that represents the item on the pad. Depending on the type, the object has some of the following properties:

PropertyObject typesDescription
rectAll displayed objectsThe displayed area, with upperLeftXpixel, upperLeftYpixel, lowerRightXpixel and lowerRightYpixel.
onClickButton, checkbox, radio button, imageCalled when the object is tapped. It receives the object and returns a boolean. Return true to stop capturing pen input, or false to continue.
checkedCheckboxIndicates whether the checkbox is checked.
onInputInputCalled each time an input button is tapped.
onSignatureCapturedSignatureCalled when the signature has been captured and accepted.
onInkingCapturedInkingCalled with the captured ink as a Base64-encoded PNG.