Text Anchors don't work after a document has been added to a package
Tuesday, January 9, 2018 at 04:08amI 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: "[email protected]", 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());
Reply to: Text Anchors don't work after a document has been added to a package
Tuesday, January 9, 2018 at 04:24amReply to: Text Anchors don't work after a document has been added to a package
Tuesday, January 9, 2018 at 05:03amReply to: Text Anchors don't work after a document has been added to a package
Tuesday, January 9, 2018 at 06:17amReply to: Text Anchors don't work after a document has been added to a package
Wednesday, January 10, 2018 at 04:15am