bdicasa | Posts: 2

Possible to Associate Fields to Signers with the Java SDK?

0 votes

Hello,

I'm wondering if it is possible to associate fields with signers using the Java SDK? My use case is that in addition to a signature, users need to be able to fill in additional information in a textbox.

From the examples I've found the fields always appear to be associated directly with a signature.

For example, from https://community.onespan.com/documentation/onespan-sign/guides/feature-guides/developer/using-text-anchors There is this code which adds the fields via the signature builder

.withDocument(newDocumentWithName("Sample Contract")
                      .fromFile("PATH_TO_YOUR_FILE")
                      .enableExtraction()
                      .withSignature(signatureFor("[email protected]")
                           .withPositionAnchor(TextAnchorBuilder.newTextAnchor("Signature of the Client")
                                .atPosition(TextAnchorPosition.TOPLEFT)
                                .withSize(150, 40)
                                .withOffset(0, -50)
                                .withCharacter(0)
                                .withOccurence(0))
                           .withField(FieldBuilder.signerName()
                                 .withPositionAnchor(TextAnchorBuilder.newTextAnchor("(hereafter referred to as")
                                         .atPosition(TextAnchorPosition.TOPRIGHT)
                                         .withSize(150, 20)
                                         .withOffset(-175, -5)
                                         .withCharacter(0)
                                         .withOccurence(0)))
                           .withField(FieldBuilder.signatureDate()
                                    .withPositionAnchor(TextAnchorBuilder.newTextAnchor("Date")
                                         .atPosition(TextAnchorPosition.TOPRIGHT)
                                         .withSize(75, 40)
                                         .withCharacter(4)
                                         .withOffset(10, -30)
                                         .withOccurence(0))))

Another example I've seen uses the eslClient.getApprovalService.addField() method, but it also requires a signatureId.

From looking around the answer on this post seems to indicate that it is possible through the REST api: https://community.onespan.com/forum/how-add-text-field-pdf-while-creating-package but I'm not sure how to communicate this in the Java SDK?

The reason I'd like to assign the fields to signers instead of signatures is because the product I'm working on uses the notation like [signer1.Capture1] directly in the PDF fields and I don't believe it is possible to get the signature ids when using this approach?

Thanks for any help.

Brian

 


bdicasa | Posts: 2

Reply to: Possible to Associate Fields to Signers with the Java SDK?

0 votes

It seems I was mixing up the different features and what I want to be looking at is document extraction: https://community.onespan.com/documentation/onespan-sign/guides/feature-guides/developer/document-extraction

It looks like it isn't possible to associate the fields to signers though, they need to be associated directly with a signature?


Duo_Liang | Posts: 3776

Reply to: Possible to Associate Fields to Signers with the Java SDK?

0 votes

Hi bdicasa,

 

Thanks for your post! It's completely possible to let users fill in text fields in addition to signing signatures.

#1 In terms of SDK/API modelling, one signer contains zero to many signatures, one signature contains zero to many fields:

signers ->(0..*)signature ->(0..*)field

There are many kinds of fields:

- input fields which can be changed during signing: textfield / textarea / checkbox / radio button / list / date picker

- input field which can't be changed during signing: label field

- binding fields like signing date, signer name, signer company, signer title, whose values determined by signer metadata or signing date.

- signature field - the actual type, size, location of a "signature" stores in the signature "field" (But you won't feel it when coding with SDK, or using extraction methods). A signature contains zero fields is an accept-only signature, a signature contains one signature field is a click-to-sign/click-to-capture/etc signature.

As a result, a text field has to be binded to a signature, but not directly to a signer. 

 

#2 If you are trying to achieve the goal using document extraction (which use PDF forms to identify the location and size, use PDF form name to identify the type, attributes of the field and which signature this fields binds to), you can follow the code example in that guide and you will see how the feature works.

 

Duo


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off