JOSA can be used to implement a signing workflow on the following platforms: Linux, Windows and MacOS. Java Version 1.8 and higher are supported. Document viewing, sign in doc, standard signing with and without hash dialog are supported.
* only for durasign devices
config.setPadmodeAfterSigning( int mode )
sets the pad mode after signing has completed, possible values are SoDeviceConfiguration.PADMODE_MANUFACTURER_LOGO
config.setSigningTimeout( int timeout )
sets the signature time out in milliseonds. If no buttons are shown during signing, the signature is accepted after this time span has passed without signature input.
config.setShowButtonsDuringSignature( boolean showButtons ) *
sets if buttons (accept, repeat, cancel) should be shown during signing
config.setStartSigningCallback( SoDeviceConfiguration.StartSigningCallback callback )
if this callback is set, the start signing button is shown during document viewing and pressing the button calls the callback.
config.setResetDisplayRotation( int rotation ) *
when the device is closed, this rotation is set. Possible values are 0, 90, 180
config.setSignatureReason( String signatureReason )
sets the reason inserted into the adobe signature
config.setDeviceDisconnectCallback( SoDeviceConfiguration.DeviceDisconnectCallback callback )
sets the callback that gets called when a device is diconnected
config.setEmulationMode( boolean state )
sets if the hash dialog should be used, false if it should be used, true otherwise
config.setSignatureFieldSizeInPercent( int percent )
defines the percentage of the display width used for the signature field. This only has an effect if sign in doc is used. On 10 inch pads in landscape mode the percentage is reduced some what internally, 100% width would be too large.
config.setSignatureHashCallback( SoDeviceConfiguration.SignatureHashCallback callback )
this callback is called delivering the hash value displayedin the hash dialog.
start document viewing with:
sign in doc is always used if document viewing is used. To stop document viewing:
Sign in doc
To use sign in doc without document viewing:
This has to be called before signing is started, it loads the document renderer. If no renderer is loaded, the standard sign mode is used.
1. define the signature rectangle
2. create a signer instance
3. define meta information (optional)
SignatureColor( Color color )
defines the color of the signature line on the signature pad
SignatureBackgroundColor( Color color, float alpha )
defines the background color of the signature field, alpha between 0 and 1
SignatureBorder( Color color, int thickness )
defines the signature borders color and thickness in pixels
4. create signature context
input stream is the pdf to sign, for example a FileInputStream: new FileInputStream( new File( "doc-to-sign.pdf" ) )
5. start signing
updateRendering is called during signing delivering the signature image enlarged by the factor 2.
signatureFinished is called when the signature process has finished, result contains the state (done, failed or canceled), the signature data: signature image, encrypted bio data and signed document.
6. close device
this stops all threads.