Field Injection, FieldBuilder.DropList, and Lists

0 votes

In a previous thread called "General Question on eSign and PDF forms" I recently wrote a reply:

A Form can have some interactive capabilities but only through the Field Validator?  I uploaded an Adobe PDF Form with drop-down lists into my Sandbox instance and notice that all of the Fields are locked down and the drop-downs are disabled.  For instance, in the PDF Form I have a Field called "RoutingType' with 3 choices (BGPDirect or Static).  Anything else is invalid.

Duo Liang replied:

For an OneSpan Sign List field, after signing, OneSpan Sign document engine only stamps the chosen option to the PDF; Unlike Adobe List Box, which lists all the options and highlights the chosen option.

So if you have the control to modify the PDF, you can remove the Adobe List Box and create an OneSpan Sign List Field instead, an example JSON for a list field could look like... and proceed to show json Code.

Here is my question:

I am using .Net Code and only see Field Injection and the FieldBuilder.DropList Method.  I have successfully injected Fields into the PDF using ".WithInjectedField(FieldBuilder.TextField()"

I do not see anything about A "OneSpan Sign List Field."  Either in the Code or anywhere in Forums and Documentation.  I am also at a loss how to build the DropList in the .Net Sdk because of a lack of Documentation.  Can you please assist me?


Reply to: Field Injection, FieldBuilder.DropList, and Lists

0 votes

 Hi gyurko,


Thanks for the post! Use below .NET SDK code to create a list field:                         


Field dropDownList = FieldBuilder.DropList()



From JSON's perspective, the options are hosted as "enums" attributes in Field Validators.



Duo Liang OneSpan Evangelism and Partner Integrations Developer

Reply to: Field Injection, FieldBuilder.DropList, and Lists

0 votes

I figured it out:


                Document = new Document();

                using (var fileStream = new FileStream(Path, FileMode.Open, FileAccess.Read))
                        MemoryStream msInt1 = new MemoryStream();
                        MemoryStream msInt = new MemoryStream(((MemoryStream)msInt1).ToArray());
                        DoctoUpload = GetNewDocumentInternet(PreOrderNumber, PreOrderId, GetFirstName, GetLastName, GetEmail, "Rider", SOF, OrgName, ref msInt, DTGetData);
                    DocName = DoctoUpload.Name;
                    SignatureId RiderId = DoctoUpload.Signatures[0].Id;

                    // Upload Document first

                    eslClient.UploadDocument(DoctoUpload, ESignId);

                    // Build first Droplist
                    Silanis.ESL.SDK.Field IPv4WanBlockSize = FieldBuilder.DropList()
                            .WithOption("Please Select")
                            .WithOption("/30 - (1 usable for Licensee)")
                            .WithOption("/29 - (5 usable for Licensee)")
                        .WithSize(210, 25)
                        .AtPosition(270, 192)

                    // Add Field to Document

                    String IPV4FieldId = eslClient.ApprovalService.AddField(ESignId, DoctoUpload.Id, RiderId, IPv4WanBlockSize);

                     // Build second Droplist

                     Silanis.ESL.SDK.Field IPv4LanBlockSize = FieldBuilder.DropList()
                            .WithOption("Please Select")
                            .WithOption("/29 - 6 usable IPs)")
                            .WithOption("/28 - 14 usable IPs")
                            .WithOption("/27 - 30 usuable IPs")
                            .WithOption("/26 - 62 usable IPs")
                            .WithOption("/25 - 126 usable IPs")
                            .WithOption("/24 - 254 usable IPs")
                        .WithSize(210, 25)
                        .AtPosition(270, 224)

                    // Add second Field to Document
                    String IPV4FieldId2 = eslClient.ApprovalService.AddField(ESignId, DoctoUpload.Id, RiderId, IPv4LanBlockSize);

And so on.  With the Document looking like the attached


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