Jinal_dani

Getting issue for setting enforceCaptureSignature as true through .NET SDK

0 votes
Hello, I am working with .NET SDK. Currently according to my requirement I need to change my enforceCaptureSignature to true for allowing user for multiple time signing. While searching for solutions I found "https://sandbox.esignlive.com/api/packages/{packageId}". Here through JSON I can modify the value for enforceCaptureSignature value. With the Rest client request I tried for the same while I am getting authorisation error. I tried with "https://sandbox.esignlive.com/api/authenticationTokens/user" for generating token still I am enable to generate token. Can you please provide me any suggestion/solution for my issue? Or can I update enforceCaptureSignature with some other method? Thank you

Reply to: Getting issue for setting enforceCaptureSignature as true through .NET SDK

0 votes
Hi Jinal, From version 11.18, OneSpan Sign supports "enforceCaptureSignature" setting at both package and signature level, To set this at signature level, you can use this snippet when adding a signature:
.WithSignature(SignatureBuilder
                                    .SignatureFor("[email protected]")
                                    .OnPage(0)
                                    .AtPosition(175, 165)
                                    .EnableEnforceCaptureSignature())                       // enforce capture signature at Signature Level
To set thisat package level, you can use this:
.WithSettings(DocumentPackageSettingsBuilder.NewDocumentPackageSettings().WithEnforceCaptureSignature())       // enforce capture siganture at Package Level
Attachment is the complete code and you can also refer to my blog "OneSpan Sign Release 11.18: Enforcing Signature Capture at Signature Level" for more detailed explanation. After you tried this code and if still suffered from the issue, we can discuss more about that. And hope this could help you! Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Attachments

Reply to: Getting issue for setting enforceCaptureSignature as true through .NET SDK

0 votes
Hello , Thanks for your help. I tried this with my code like : private static void testEnforceCapture() { var eslClient = new EslClient(_apiKey, _apiUrl); var fs = File.OpenRead("Test.pdf"); var pack = PackageBuilder.NewPackageNamed("12345") .WithSigner(SignerBuilder.NewSignerWithEmail("[email protected]") .WithFirstName("SSSSS") .WithLastName("ZZZZZZZ") .WithCustomId("signer1")) .WithDocument(DocumentBuilder.NewDocumentNamed("Test").EnableExtraction().WithExtractionType(ExtractionType.TEXT_TAGS) .FromStream(fs, DocumentType.PDF).WithSignature(SignatureBuilder.CaptureFor("[email protected]") .EnableEnforceCaptureSignature())) .Build(); eslClient.CreateAndSendPackage(pack); } And in pdf I have added 2 tags {{esl:signer1:capture:size(150,50)}} {{esl:signer1:capture:size(150,50)}}. Yet if I am filling first sign it's auto setting it to next one. Can you please help me where I am doing wrong.

Reply to: Getting issue for setting enforceCaptureSignature as true through .NET SDK

1 votes
Hi Jinal, When you are applying Text Tag Extraction Feature, you have two approvals in your document(each capture/fullname/initial represents an approval). While you can't assign an Id/name for it, so you are not able to locate your target approval by .WithSignature(SignatureBuilder.CaptureFor(“[email protected]”).EnableEnforceCaptureSignature()). That's why the code doesn't work for you. So in this case, if you still want to use Text Tag Extraction, #1 you can set a package level "enforceCaptureSignature" by
.WithSettings(DocumentPackageSettingsBuilder.NewDocumentPackageSettings().WithEnforceCaptureSignature()) 
#2, if you still want a signature level setting, you can first create the package and leave it DRAFT, then grab your documentPackage object, modify it and update your package then send it. But in this way, you'd make more SDK calls. #3, you can have a try on "Text Anchor Feature" which also allows you to locate your fields by existing text in your pdf. #4, you can try Position Extraction by adding pdf form to your pdf to tell OneSpan Sign your fields' location. Hope this could help you! Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Getting issue for setting enforceCaptureSignature as true through .NET SDK

0 votes
Thank you for the solution, Finally it worked :)

Reply to: Getting issue for setting enforceCaptureSignature as true through .NET SDK

0 votes
Glad to hear that! Just let us know if you have any other issues. :) Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


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