This topic contains 4 replies, has 2 voices, and was last updated by  Haris 6 days, 23 hours ago.

  • Author
    Posts
  • Participant
    darrunategui
    Newbie
    Member since: 13.11.2017
    Number of posts: 6

    I am seeing a bug where the following occurs:

    1. I create a package with 1 document and 1 signature placed using text anchors.
    2. At a later time, I programmatically add another signature to that same package/document using text anchors.

    Expected Result:
    The signature I want to add is placed according to the text anchor.

    Actual Result:
    The signature is placed at position (0, 0) and the text anchor is completely ignored.

    The code below demonstrates my approach and bug. I’ve also attached the pdf I was using to test this.

    var signer1 = (Email: "test@gmail.com",
                               Id: "signer-1",
                               FirstName: "David",
                               LastName: "NormalGmail",
                               Company: "ABC Company",
                               Title: "Software Developer");
    
                var doc = (Name: "Testing Doc",
                           Id: "DocId1");
    
                var anchor = (Text: "Please Sign",
                              Occurrence: 0,
                              Character: 0,
                              Width: 200,
                              Height: 50);
    
                PackageId packageId = null;
                using (var fs = File.OpenRead(@"test.pdf"))
                {
                    var package = PackageBuilder.NewPackageNamed(doc.Name + " Package")
                                  .WithSettings(DocumentPackageSettingsBuilder.NewDocumentPackageSettings())
                                  .WithSigner(SignerBuilder
                                              .NewSignerWithEmail(signer1.Email)
                                              .WithCustomId(signer1.Id)
                                              .WithFirstName(signer1.FirstName)
                                              .WithLastName(signer1.LastName)
                                              .WithCompany(signer1.Company)
                                              .WithTitle(signer1.Title))
                                  .WithDocument(DocumentBuilder
                                                .NewDocumentNamed(doc.Name)
                                                .FromStream(fs, DocumentType.PDF)
                                                .WithId(doc.Id)
                                                // This signature is placed correctly according to the text anchor
                                                .WithSignature(SignatureBuilder.SignatureFor(signer1.Email)
                                                               .WithPositionAnchor(TextAnchorBuilder.NewTextAnchor(anchor.Text)
                                                                                   .AtPosition(TextAnchorPosition.TOPLEFT)
                                                                                   .WithOccurrence(anchor.Occurrence)
                                                                                   .WithCharacter(anchor.Character)
                                                                                   .WithOffset(0, -anchor.Height)
                                                                                   .WithSize(anchor.Width, anchor.Height)))).Build();
    
                    packageId = eslClient.CreatePackage(package);
                }
    
                // The text anchor here is completely ignored
                var sigBuilder = SignatureBuilder.SignatureFor(signer1.Email)
                                 .WithPositionAnchor(TextAnchorBuilder.NewTextAnchor(anchor.Text)
                                                     .AtPosition(TextAnchorPosition.BOTTOMLEFT)
                                                     .WithOccurrence(anchor.Occurrence)
                                                     .WithCharacter(anchor.Character)
                                                     .WithOffset(0, 0)
                                                     .WithSize(anchor.Width, anchor.Height));
    
                var documentPackage = eslClient.GetPackage(packageId);
                eslClient.ApprovalService.AddApproval(documentPackage, doc.Id, sigBuilder.Build());
    
    Attachments:
    You must be logged in to view attached files.
    Keymaster
    Haris
    Jedi Master
    Member since: 05.11.2015
    Number of posts: 1181
    Approved answer

    Score

    0

    Hi there,

    All extraction features in eSignLive are only available during document upload. It is as designed and not a bug. Please refer to our documentation: https://docs.esignlive.com/content/c_integrator_s_guide/sdk/c_managing_documents/extraction.htm#Text

    Therefore, you will have to add all your anchors during document upload or position subsequent signatures using x-y coordinates.


    Haris Haidary
    eSignLive Technical Evangelist
    Participant
    darrunategui
    Newbie
    Member since: 13.11.2017
    Number of posts: 6

    Score

    0

    Thanks for the clarification. I did not notice this when I was reading through the documentation.
    Is there a reason why this was chosen as a design decision?

    My end goal was to provide a feature to change a signer grammatically. This would include
    1. Removing the original signer
    2. Adding a new signer
    3. Adding all new signatures and fields to replace the original signer.
    4. Give the new signer fields default values based in dynamic data hosted in our back end database

    I suppose I can look at the absolute positioning of the original signature block and fields and then just duplicate those settings to create the new signature block and fields…. but that solution isn’t as clean as using text anchors after document upload. Is this a feature that is planned for the future?

    Keymaster
    Haris
    Jedi Master
    Member since: 05.11.2015
    Number of posts: 1181

    Score

    0

    Are the signatures of the new signer going to be in the same place as the original one? If so, you could simply do an update on the signer information (i.e. update first name, last name, and email address) and the positioning of the signatures will still be kept. As to why extraction only works during document upload, it is only during document upload that we process the document (e.g. search for texts, form fields, etc). Then, the pdf is simply rendered into images. And I don’t believe this feature will be changed any time soon.


    Haris Haidary
    eSignLive Technical Evangelist
    Keymaster
    Haris
    Jedi Master
    Member since: 05.11.2015
    Number of posts: 1181

    Score

    0

    Hi there,

    There is actually a plan to change the extraction feature to be able to reprocess documents upon adding signers. Hence, you’ll be able to add text anchors after the document has been added. However, there is no timetable for this. I’ll post back here for any updates on this.


    Haris Haidary
    eSignLive Technical Evangelist

You must be logged in to reply to this topic.