E-Sign
1. E-Sign SDK Description
1.1 Introduction
In the field of Internet finance, PDF is generally used as the contract format standard. E-Sign electronic signature can provide customers with the service of signing contract documents online; at the same time, it provides supporting interface services such as selecting the page number of the signature document, adjusting the signature coordinate position, and downloading the document after signing. Go to server API document
1.2 The Current Version
The latest version is v1.0.0 Updated on Jan 11 2021
SDK dual architecture compilation increments is 227K
2. E-Sign SDK Integration Guide
2.1 SDK Directory Structure
2.2 Quick Integration
Before you use the SDK, you need to integrate it into your development environment first.
- Import DFESignDemo's DFESign module to your project by File->New->importModule->Select the DFESign in DFESignDemo folder->Continuously click Next to complete the import.
- Add the following code to the build.gradle in your application
repositories {
flatDir {
dirs project(':DFESign').file('libs')
}
}
Add following code in the dependencies{} section of build.gradle
compile project(':DFESign')
For example:
allprojects {
repositories {
google()
jcenter()
flatDir {
dirs project(':DFESign').file('libs')
}
}
}
dependencies {
compile project('DFESign')
}
2.3 Start Detection
Jump signature activity
DFESign eSign = new DFESign();
eSign.setApiId(API_ID) //required, api id
.setApiSecret(API_SECRET) //required, api secret
.setDocumentId("1234678") //required, document id
.setAadhaarNumber("123456789012") //required, aadhaar number of signatory
.setName(name) //required, name of signatory
.setLocation("location") //optional,Address of signatory
.setReason("reason") //optional,Reason for signing
.setSignaturePageNumber(1) //optional, the page number which user sign to
.setXCoordinate(10) //optional, x offset distance of signature area
.setYCoordinate(10) //optional, y offset distance of signature area
.setSignatureWidth(200) //optional, width of signature area
.setSignatureHeight(64) //optional, height of signature area
.setTickImageFile(BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher)) //optional, signature image, if null, a signature image is automatically generated based on the name
.startESign(this, 100);
Use onActivityResult to get result
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
if (requestCode == REQUEST_START_E_SIGN) {
if (resultCode == RESULT_OK) {
//Get the successful signing result
DFESignResult eSignResult = DFESign.obtainESignResult(data);
Intent intent = new Intent(this, DFResultActivity.class);
intent.putExtra(DFResultActivity.KEY_RESULT_DATA, eSignResult);
startActivity(intent);
} else {
//Get the reason why the signature failed
DFErrorResult errorResult = DFESign.obtainErrorResult(data);
DFAppUtils.logI(TAG, "dealESignResult", "errorResult", errorResult);
}
}
}
DFESignResult for successful result.
DFErrorResult for failure result.