dennisolano | Posts: 7

InjectedField

0 votes
Hi, would you be able to give me some scenarios where we use InjectedField. I'm trying this in my code following the API documentation but I don't see it on the document during signing. Below is my code snippet.

DocumentPackage superDuperPackage = PackageBuilder.NewPackageNamed(packageName)
                .WithSettings(DocumentPackageSettingsBuilder.NewDocumentPackageSettings().WithoutWatermark()
                                 .WithCeremonyLayoutSettings(CeremonyLayoutSettingsBuilder.NewCeremonyLayoutSettings().WithoutIFrame()))
                    .WithSigner(SignerBuilder.NewSignerWithEmail("[email protected]")
                                .WithFirstName("HR")
                                .WithLastName("Signer")
                                .WithCustomId("Signer2")
                    )
                    .WithSigner(SignerBuilder.NewSignerWithEmail("[email protected]")
                                .WithFirstName("Manager")
                                .WithLastName("Signer")
                                .WithCustomId("Signer1")
                                .WithAttachmentRequirement(AttachmentRequirementBuilder
                                .NewAttachmentRequirementWithName("Government Issued ID").WithDescription("Driver's License, Passport"))
                    )
                    .WithDocument(DocumentBuilder.NewDocumentNamed("Time Away From Work Form")
                                  .FromStream(pdfStream, DocumentType.PDF)
                                  .EnableExtraction()
                                  .WithInjectedField(FieldBuilder.CustomField("FormData")
                                  .WithId("FormData")
                                  .WithPositionExtracted()
                                  //.WithName("FormData")
                                  .WithValue("DennisDennis Manager")
                                  )
                    )
                    .WithEmailMessage("Email Message From Code")
                    .WithoutAutomaticCompletion()
                    .Build(); 
Thanks.

mwilliams | Posts: 957

Reply to: InjectedField

0 votes
Do you have a form field, in your PDF, named "Form Data"? Let me know. I don't see anything wrong with the code, at first glance. I've used this feature with the Java SDK, but not the .NET SDK, yet. Let me know on the question above, along with what version of the SDK you're using, and I'll try it out with .NET/C#.

dennisolano | Posts: 7

Reply to: InjectedField

0 votes
Hi Michael, Yes, I do have the FormData field on the PDF form. I'm using 10.9.0.0. I tried removing .WithPositionExtracted() and it is now showing as expected. Please correct me if I'm wrong with my understanding with InjectedField. We use InjectedField to populate fields on the PDF with the actual values. Can we retrieve this field values using the FieldSummaryService later if we want to? What is the benefit of using InjectedField vs having the fields populated using iTextSharp? Thanks, Dennis

dennisolano | Posts: 7

Reply to: InjectedField

0 votes
I updated to the latest SDK 10.10.1.0

mwilliams | Posts: 957

Reply to: InjectedField

0 votes
So, removing .WithPositionExtracted() made it work? I'll have to set it up and test. Is this the same with the latest version of the SDK? You can access this field, directly from the document, even if it's not available from the FieldSummaryService. As for the question about the benefit, I guess it would probably be the ability to access the value from the e-SignLive document using the API/SDK (along with not having to use another API, if you're not already using it). If you populated the form with iTextSharp prior to loading it into e-SignLive, I don't know if this form field would be flattened, if not extracted with e-SignLive. I'd have to look into this, as well. I'll set this up to test, right now.

dennisolano | Posts: 7

Reply to: InjectedField

0 votes
Yes, when the field are populated by iTextSharp and uploaded to eSignLive, it gets flattened, so there's no way to retrieve the values what is actually on the document after the signing process. I'm now using the latest SDK. You said "You can access this field, directly from the document, even if it’s not available from the FieldSummaryService.", can you whip me a code-snippet to do this please. By looking at the API documentation, I'm not seeing how to access the field other than using the FieldSummaryService. Thanks, Dennis

mwilliams | Posts: 957

Reply to: InjectedField

0 votes
That was a quick check from the Java SDK where I had done this before. I don't see the same, from the .NET SDK. I'm testing it out, right now!

mwilliams | Posts: 957

Reply to: InjectedField

0 votes
There doesn't seem to be a way to do this with the .NET SDK. I'll work on getting it added as an enhancement request. I'll also look into other avenues of getting these fields (REST or external library). I'll post back if I find another way. FYI - For the above, it appears that WithPositionExtracted and EnableExtraction conflict somewhere. One or the other seems to work.

dennisolano | Posts: 7

Reply to: InjectedField

0 votes
Thanks Michael.

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