OneSpan Sign Developer: 2022 SDK Updates

Duo Liang, April 20, 2022

OneSpan Sign SDKs provide a comprehensive collection of tools to help developers add e-signing capabilities to their website, mobile app, and core systems in a quick and more standardized way. 

As OneSpan Sign rolls out new releases, we’ve added exciting new features. Let’s walk through recent SDK updates in this blog so you can use these tools to keep your code in the latest fashion. Without further delay, let’s get started!

Checkbox Groups

As a transaction sender, it’s a common requirement to design a multiple choice question and allow signers to select certain number of answers during the signing process. In order to accommodate this requirement, OneSpan Sign enhanced the checkbox validation rules in these two aspects:

  • Sender can associate multiple checkboxes to a group
  • Within a checkbox group, sender can specify minimal and maximal required options 

4-20-1

Take the screenshot above for example. There are four checkboxes in a group, and the signer is required to select 2 or 3 options. In order to create such a transaction using the SDK code, ensure your SDK version is later than 11.44 and you meet the requirement with the code snippet below: 

DocumentPackage pkg = PackageBuilder.newPackageNamed("Test Checkbox Group Rules")
        .withSigner(SignerBuilder.newSignerWithEmail("[email protected]")
                .withFirstName("John")
                .withLastName("Smith"))
        .withDocument(DocumentBuilder.newDocumentWithName("Document1")
                .fromFile("path_to_document") 
        .withSignature(SignatureBuilder.signatureFor("[email protected]")
                .onPage(0)
                .atPosition(500,100)
                .withField(FieldBuilder.checkBox()
                        .withId(new FieldId("languagePreference_fr"))
                        .atPosition(500, 800)
                        .withSize(25, 25)
                        .onPage(0)
                        .withValidation(FieldValidatorBuilder.basic()
                            .setGroup("languagePreference")
                            .setMinimumRequired(2)
                            .setMaximumRequired(3)
                        ))
                ))
        .build();

Upload Image as a Signature

4-20-2

On top of applying font-based and hand-drawn signatures, uploading an image as a signature is standard in many e-signature use cases. As of SDK version 11.46, integrators can easily enable the feature to capture a signature and allow signers to apply their signatures by uploading an image during the signing ceremony. When adding capture signature to a document, simply specifying “.setFromFile(true)” will turn on the flag. See the sample code below:

DocumentPackage superDuperPackage = PackageBuilder.newPackageNamed("Upload an image to a signature")
        .withSigner(SignerBuilder.newSignerWithEmail("[email protected]")
                .withFirstName("John")
                .withLastName("Smith"))
        .withDocument(DocumentBuilder.newDocumentWithName("First Document")
                .fromFile("path_to_document") 
                .withSignature(SignatureBuilder.captureFor("[email protected]")
                        .onPage(0)
                        .atPosition(100, 100)
                        .setFromFile(true)))
        .build(); 

Show Logo In iFrame

The OneSpan Sign New Signer Experience features flexible customization options to help you tailor the best signing experience for your signers. This includes whether to display the signing logo when a signing ceremony is presented in an iFrame. 

4-20-3

This feature is determined by a transaction level setting:

“settings” > “ceremony” > “showNseLogoInIframe” : true/false

An equivalent SDK code will look like this:

DocumentPackage superDuperPackage = PackageBuilder.newPackageNamed("Show Nse Logo in iFrame")
		.withSettings(DocumentPackageSettingsBuilder.newDocumentPackageSettings()
		                .withShowNseLogoInIframe()
		)
		……
		.build();

Note that in order to leverage this feature, your SDK version should be later than 11.44.

There it is. By now, we have walked you through three recent product upgrades and their corresponding SDK changes. If you have any questions regarding this blog or anything else concerning integrating OneSpan Sign into your application, visit the Developer Community Forums. Your feedback matters to us!

Duo Liang is a Technical Evangelist and Partner Integrations Developer at OneSpan where he creates and maintains integration guides and code shares, helps customers and partners integrate OneSpan products into their applications, and builds integrations within third party platforms.