rtbike | Posts: 38

No Fields or Signatures mapped to form

0 votes
Hi all, I am just getting through a few cycles of testing in the sand box on my way to uploading and populating large form with multiple signers from an external web app. It seems the documentation is not all the clear how to map fields to existing to PDF form fields. Also is there a way to test my code (100 plus fields and values) with out having to actually submit a package and wait for the emails to be sent? It sends the document with out any errors but there are no fields filled in and no signature fields added. I have also attached the form I am trying to map to. Emails get sent out but when the first signer oepn the form it just says "This is a disclosure Document. You must read it and click the Accept button at the end of the Document before you can continue to the next Document." Any here is my test code - Note: when I ran this with just a single signature it did work.
 EslClient eslClient = new EslClient(apiKey, apiUrl);
                string FormPath = Server.MapPath("~/Forms/Adv_Directives_Combined_2008_02.pdf");
                FileStream fs = System.IO.File.OpenRead(FormPath);

                DocumentPackage thisPackage = PackageBuilder
 	                .NewPackageNamed("Advanced Directives Combined Form")
 	                .WithSettings(DocumentPackageSettingsBuilder.NewDocumentPackageSettings())

                    .WithSigner(SignerBuilder.NewSignerWithEmail(model.SignerEmail)
                                      .WithFirstName(model.SignerFirstName)
                                      .WithLastName(model.SignerLastName)
                                      .SigningOrder(1))

                    .WithSigner(SignerBuilder.NewSignerWithEmail("[email protected]")
                                        .WithFirstName("Todd")
                                        .WithLastName("Crisafulli")
                                        .SigningOrder(2))

                    .WithDocument(DocumentBuilder.NewDocumentNamed("MentalHealthCareDeclaration_" + model.SignerFirstName + "_" + model.SignerLastName)
                        .EnableExtraction()
                    	.FromStream(fs, DocumentType.PDF)

                    	.WithSignature(SignatureBuilder.SignatureFor(model.SignerEmail)
                        .WithName("V_MySignature")
                       	.WithPositionExtracted())


                        .WithSignature(SignatureBuilder.SignatureFor("[email protected]")
                        .WithName("IIIA_txtAgentSignature")
                        .WithPositionExtracted())

                        .WithInjectedField(FieldBuilder.TextField()
                        .WithName("IIIA_txtAgentAcceptPrintName")
                        .WithValue("Todd Crisafulli")
                        .WithPositionExtracted())

                        .WithInjectedField(FieldBuilder.CheckBox()
                        .WithName("IIA_cbxPsychiatricFacilityPrefered")
                        .WithValue("checked")
                        .WithPositionExtracted())

                        .WithInjectedField(FieldBuilder.RadioButton("IIA_rdoRecommendedMedication") // this is the radio button group name on the PDF
                        .WithName("IIA_rdoRecommendedMedicationsYes")
                        .WithValue(false)
                        .WithPositionExtracted())

                        .WithInjectedField(FieldBuilder.RadioButton("IIA_rdoRecommendedMedication") // this is the radio button group name on the PDF
                        .WithName("IIA_rdoRecommendedMedicationsNo")
                        .WithValue(true)
                        .WithPositionExtracted())


                   	)
                    .Build();

                PackageId packageId = eslClient.CreatePackage(thisPackage);
                eslClient.SendPackage(packageId);

Approved Answer
harishaidary | Posts: 1812

Reply to: No Fields or Signatures mapped to form

0 votes
Hey Todd,
I would like to confirm how to prepare the PDF fields. All fields should be text fields even check boxes, radio buttons, multi line text fields and signatures and they will be transformed on when the file is uploaded? Is that correct? That seems like a fairly important instruction that I did not find in the documentation. I would suggest adding detailed instructions on how to prepare the PDF Fields.
Yes, that is correct.
Also were did you see the 500 error? It would be helpful to be able to see error messages and or error logs in the sandbox for debugging.
I'm using Visual Studio Community 2015 to debug C# code.

rtbike | Posts: 38

Reply to: No Fields or Signatures mapped to form

0 votes
Also I using this sand box https://sandbox.e-signlive.com

harishaidary | Posts: 1812

Reply to: No Fields or Signatures mapped to form

0 votes
Hi there, You can follow these following guides on how to use the position extraction and field injection feature: https://developer.esignlive.com/guides/feature-guides/position-extraction/ https://developer.esignlive.com/guides/feature-guides/field-injection/ If you want to test more quickly, you can remove the send package call. The package will be sitting in your draft folder and you can simply login to your sandbox account and look in there if the extraction worked. The document that you see when you click on the link in the email you receive is the default consent document that is automatically added each time you create a package. If scroll down and click "Accept", you will be then directed to your document. If you wish to remove this consent document during package creation, you will have to send support a request for this. [email protected]

rtbike | Posts: 38

Reply to: No Fields or Signatures mapped to form

0 votes
Thanks for you reply, I have already reviewed that documentation as that is how I was able to assemble the code snippet above. My document is available in the sandbox UI after you click the accept the consent document, but it there are no signatures or field / value pairs on the document. Code compiles and there are no errors to chase down so I am kind of lost at how to trouble shoot this issue?

redhatva | Posts: 3

Reply to: No Fields or Signatures mapped to form

0 votes
I too am curious about this - see my post regarding PDF form filling and SalesForce app.. I really need some help!

rtbike | Posts: 38

Reply to: No Fields or Signatures mapped to form

0 votes
So if you look at the code above the only item that is mapping to the form is signature(2) which is never executed because the form does not allow singer one to sign. I will double check all field names etc, but I don't think that is the issue. Prior to adding the second signer and the injected fields I tested this form with just the first signature and the same field name V_MySignature so I also don't think that is the issue.

harishaidary | Posts: 1812

Reply to: No Fields or Signatures mapped to form

0 votes
Hey, I apologize for getting back to you this late. I will do some testing shortly and get back to you asap.

harishaidary | Posts: 1812

Reply to: No Fields or Signatures mapped to form

0 votes
Okay. So I copy pasted your code above and used the document you provided without any modifications and I got a 500 error. I'm pretty certain it has something to do with the way you created/named your fields. For example, I wasn't able to find the field "V_MySignature" anywhere in the document you provided. However, when I deleted all the fields from your document using Adobe Acrobat and simply added a few test ones, I didn't get any errors and the signatures/fields were where they were supposed to be. I attached the modified document and the code I used.
DocumentPackage thisPackage = PackageBuilder.NewPackageNamed("Advanced Directives Combined Form")
                .WithSettings(DocumentPackageSettingsBuilder.NewDocumentPackageSettings())
                .WithSigner(SignerBuilder.NewSignerWithEmail("[email protected]")
                                  .WithFirstName("John")
                                  .WithLastName("Smith")
                                  .SigningOrder(1))
                .WithSigner(SignerBuilder.NewSignerWithEmail("[email protected]")
                                    .WithFirstName("Todd")
                                    .WithLastName("Crisafulli")
                                    .SigningOrder(2))
                .WithDocument(DocumentBuilder.NewDocumentNamed("MentalHealthCareDeclaration_" + "John" + "_" + "Smith")
                    .EnableExtraction()
                    .FromStream(fs, DocumentType.PDF)
                    .WithSignature(SignatureBuilder.SignatureFor("[email protected]")
                    .WithName("V_txtMySignature")
                       .WithPositionExtracted())


                    .WithSignature(SignatureBuilder.SignatureFor("[email protected]")
                    .WithName("IIIA_txtAgentSignature")
                    .WithPositionExtracted())

                    .WithInjectedField(FieldBuilder.TextField()
                    .WithName("IIIA_txtAgentAcceptPrintName")
                    .WithValue("Todd Crisafulli")
                    .WithPositionExtracted())

                    .WithInjectedField(FieldBuilder.CheckBox()
                    .WithName("IIA_cbxPsychiatricFacilityPrefered")
                    .WithValue(true)
                    .WithPositionExtracted())

                    .WithInjectedField(FieldBuilder.RadioButton("IIA_rdoRecommendedMedication") // this is the radio button group name on the PDF
                    .WithName("IIA_rdoRecommendedMedicationsYes")
                    .WithValue(false)
                    .WithPositionExtracted())

                    .WithInjectedField(FieldBuilder.RadioButton("IIA_rdoRecommendedMedication") // this is the radio button group name on the PDF
                    .WithName("IIA_rdoRecommendedMedicationsNo")
                    .WithValue(true)
                    .WithPositionExtracted())


                   )
                .Build();

            PackageId packageId = eslClient.CreatePackage(thisPackage); 
Also, note that when creating fields in your PDF document using Adobe Acrobat for example, they all should be textfields. eSignLive will convert them to whatever field you want when you specify it the code. In other words, the field "IIIA_txtAgentSignature" should be a textfield in your PDF document and once you specify "withSignature()" esignlive will convert it to a signature field. Hope this helps :)

rtbike | Posts: 38

Reply to: No Fields or Signatures mapped to form

0 votes
Thanks for the reply, I would like to confirm how to prepare the PDF fields. All fields should be text fields even check boxes, radio buttons, multi line text fields and signatures and they will be transformed on when the file is uploaded? Is that correct? That seems like a fairly important instruction that I did not find in the documentation. I would suggest adding detailed instructions on how to prepare the PDF Fields. Also were did you see the 500 error? It would be helpful to be able to see error messages and or error logs in the sandbox for debugging. I will try changing the field types on the form and see what happens. Thanks, Todd

rtbike | Posts: 38

Reply to: No Fields or Signatures mapped to form

0 votes
So I have run a few more test after converting all the fields on my original form to Text fields as well as testing the form you sent. I am able to get both signers to sign the document but no injected fields in are working for me and I get no errors when debugging? In my original code there was one incorrect field name for the first signature field. But that has been corrected. Getting a bit frustrated and burning a bunch of hours.

harishaidary | Posts: 1812

Reply to: No Fields or Signatures mapped to form

0 votes
Are you injecting the fields in the same manner as I did? For example, in your code you had:
.WithInjectedField(FieldBuilder.CheckBox()
                        .WithName("IIA_cbxPsychiatricFacilityPrefered")
                        .WithValue("checked")
                        .WithPositionExtracted())
Where as it should be:
.WithInjectedField(FieldBuilder.CheckBox()
                    .WithName("IIA_cbxPsychiatricFacilityPrefered")
                    .WithValue(true)
                    .WithPositionExtracted())
Also, you do not need to group the radio buttons in your PDF. Once you declare:
.WithInjectedField(FieldBuilder.RadioButton("IIA_rdoRecommendedMedication")
eSignLive will automatically group them up for you.

rtbike | Posts: 38

Reply to: No Fields or Signatures mapped to form

0 votes
When I remove the radio button group VS complains with red line under the radio button object, also on this example page the groups are included so I am a little confused. http://docs.e-signlive.com/doku.php?id=esl:e-signlive_guide_fields&_ga=1.138729082.855580168.1472843907#unbound_fields
     .WithInjectedField(FieldBuilder.RadioButton()  --  Expects "string group"
                        .WithName("IIA_rdoRecommendedMedicationsNo")
                        .WithValue(true)
                        .WithPositionExtracted())
If one Injectedfield is not formatted correctly do they all fail? I am still not getting any errors in VS when debug. I put break point just after the .Build() call and get no errors. For example this text field is the first one in the list.
  .WithInjectedField(FieldBuilder.TextField()
                        .WithName("IIIA_txtAgentAcceptPrintName")
                        .WithValue("John Doe")
                        .WithPositionExtracted())
It never shows up on the form?

harishaidary | Posts: 1812

Reply to: No Fields or Signatures mapped to form

0 votes
What I meant by my previous reply was to remove grouping in your PDF and not in your code (see first attachment). You should keep the grouping in your code. Although, that shouldn't matter since all fields in your PDF should be textfields. Using the original document you provided with no modifications, I was able to inject the textfield onto the document with the code below (see second attachment):
using System;
using System.IO;
using Silanis.ESL.SDK;
using Silanis.ESL.SDK.Builder;
using System.Collections.Generic;

namespace esl
{
    public class FieldInjection
    {
        //replace api_key placeholder with your own value
        public static string API_KEY = Properties.Settings.Default.key;
        public static string API_URL = "https://sandbox.esignlive.com/api";

        public static void main()
        {
            EslClient eslClient = new EslClient(API_KEY, API_URL);

            FileStream fs = File.OpenRead("C:/Users/hhaidary/Desktop/Adv_Directives_Combined_2008_02.pdf");

            DocumentPackage packageToSend = PackageBuilder.NewPackageNamed("Field Injection Example")
                    .WithSigner(SignerBuilder.NewSignerWithEmail("[email protected]")
                            .WithFirstName("John")
                            .WithLastName("Smith")
                            .WithCustomId("client")
                           )       
                    .WithDocument(DocumentBuilder.NewDocumentNamed("Sample Contract")
                            //.EnableExtraction()
                            .FromStream(fs, DocumentType.PDF)
                            .WithInjectedField(FieldBuilder.TextField()
                                    .WithId("Text1")
                                    .WithName("Text1")
                                    .WithValue("200 E MAIN ST, PHOENIX AZ, 85123 USA"))
                           .WithInjectedField(FieldBuilder.TextField()
                        .WithName("IIIA_txtAgentAcceptPrintName")
                        .WithValue("John Doe")
                        .WithPositionExtracted()))

                    .Build();

            PackageId packageId = eslClient.CreatePackage(packageToSend);

        }
    }
} 
What instance of ESL are you testing (i.e. are you on sandbox.e-signlive.com or sandbox.esignlive.com)? And also what SDK version are you using? And to answer your question:
If one Injectedfield is not formatted correctly do they all fail?
No that shouldn't be the case. As you can see in the code above, the field "Text1" isn't present in your PDF but John Doe was still injected onto the document. Please make sure you have all the correct names in your code and PDF.

harishaidary | Posts: 1812

Reply to: No Fields or Signatures mapped to form

0 votes
Attachments

Attachments
12.png5.71 KB
21.png96.44 KB
rtbike | Posts: 38

Reply to: No Fields or Signatures mapped to form

0 votes
Yes I have converted all fields to text fields. I have attached updated form

harishaidary | Posts: 1812

Reply to: No Fields or Signatures mapped to form

0 votes
Again, works fine for using the updated document and the code I posted earlier. See attachment.

Attachments
Capture16.png228.19 KB
rtbike | Posts: 38

Reply to: No Fields or Signatures mapped to form

0 votes
Sorry I am putting out a few fires this morning I am using sandbox.e-signlive.com I started with an account in sandbox.esignlive.com and was instructed to switch. Todd

rtbike | Posts: 38

Reply to: No Fields or Signatures mapped to form

0 votes
does that work in sandbox.e-signlive.com as well, I noticed your posting to sandbox.esignlive.com?

harishaidary | Posts: 1812

Reply to: No Fields or Signatures mapped to form

0 votes
Yes, it does also work on sandbox.e-signlive.com.

rtbike | Posts: 38

Reply to: No Fields or Signatures mapped to form

0 votes
Wow this is super frustrating, the fields just don't show up for me in the sand box. I have double check field names, opened the form and copy pasted the names directly from the named field to my code. Also you are using the same names and it seems to be working for you? I am running the code and looking in the Draft folder. I click the form and can see both signature fields are marked but no injected fields are populated. Also earlier you asked what version of the SDK I was running it looks like Silanis.ESL.SDK version 11.0 Maybe values are getting dropped in the post?

harishaidary | Posts: 1812

Reply to: No Fields or Signatures mapped to form

0 votes
You do not see "John Doe" injected onto the document? Can you share your code? Did you give the code I shared a go?

rtbike | Posts: 38

Reply to: No Fields or Signatures mapped to form

0 votes
I have simplified the code just trying to see one injected text field. Using the same form I have posted here with all text fields. I am expecting the first text field to be populated "I_txtMyPrintName". I have attached a screen shot of the field name in the actual PDF I am uploading and the view I am looking at in the sandbox. Is it possible I am not looking at this correctly in the sandbox? Are there different views that might show the fields? I am simply clicking on the form under the draft box, but I think it working as it shows the signature fields.
string apiUrl = "https://sandbox.e-signlive.com/api";
            // USE https://apps.esignlive.com/api FOR PRODUCTION
            string apiKey = "api_key";


            try
            {
                EslClient eslClient = new EslClient(apiKey, apiUrl);
                string FormPath = Server.MapPath("~/Forms/Adv_Directives_Combined_2008_02.pdf");
                FileStream fs = System.IO.File.OpenRead(FormPath);

                DocumentPackage thisPackage = PackageBuilder
 	                .NewPackageNamed("Advanced Directives Combined Form")
 	                .WithSettings(DocumentPackageSettingsBuilder.NewDocumentPackageSettings())

                    .WithSigner(SignerBuilder.NewSignerWithEmail(model.SignerEmail)
                                      .WithFirstName(model.SignerFirstName)
                                      .WithLastName(model.SignerLastName)
                                      .SigningOrder(1))

                    .WithSigner(SignerBuilder.NewSignerWithEmail("[email protected]")
                                        .WithFirstName("Todd")
                                        .WithLastName("Crisafulli")
                                        .SigningOrder(2))

                    .WithDocument(DocumentBuilder.NewDocumentNamed("MentalHealthCareDeclaration_" + model.SignerFirstName + "_" + model.SignerLastName)
                        .EnableExtraction()	
                        .FromStream(fs, DocumentType.PDF)

                    	.WithSignature(SignatureBuilder.SignatureFor(model.SignerEmail)
                        .WithName("V_txtMySignature")
                       	.WithPositionExtracted())
                        

                        .WithSignature(SignatureBuilder.SignatureFor("[email protected]")
                        .WithName("IIIA_txtAgentSignature")
                        .WithPositionExtracted())
                        

                        .WithInjectedField(FieldBuilder.TextField()
                        .WithName("I_txtMyPrintName")
                        .WithValue("John Doe")
                        .WithPositionExtracted())

                        //.WithInjectedField(FieldBuilder.CheckBox()
                        //.WithName("IIA_cbxPsychiatricFacilityPrefered")
                        //.WithValue(true)
                        //.WithPositionExtracted())

                        //.WithInjectedField(FieldBuilder.RadioButton("IIA_rdoRecommendedMedication") // this is the radio button group name on the PDF
                        //.WithName("IIA_rdoRecommendedMedicationsYes")
                        //.WithValue(false)
                        //.WithPositionExtracted())

                        //.WithInjectedField(FieldBuilder.RadioButton("IIA_rdoRecommendedMedication") // this is the radio button group name on the PDF
                        //.WithName("IIA_rdoRecommendedMedicationsNo")
                        //.WithValue(true)
                        //.WithPositionExtracted())

                    
                   	)
                    .Build();

                PackageId packageId = eslClient.CreatePackage(thisPackage);
                //eslClient.SendPackage(packageId);

Attachments
harishaidary | Posts: 1812

Reply to: No Fields or Signatures mapped to form

0 votes
Ah I see where you are going wrong. Remove the method "EnableExtraction()". You would only use that method when you are naming your form fields in your PDF document by eSignLive's convention. Since you're using custom names, it is somehow conflicting with "withPositionExtracted()". Let me know if this works for you.

rtbike | Posts: 38

Reply to: No Fields or Signatures mapped to form

0 votes
Oh man! = ) When I remove that line of code the injected fields show up but the signature fields are no longer tagged? Is that by design? Originally I was not able to get the signature fields to show up and that line of code was suggested to make it work which it did.

harishaidary | Posts: 1812

Reply to: No Fields or Signatures mapped to form

0 votes
Yes, you are correct. It seems to be a bug =[ . I will look into this for you. I should have something for you in the morning tomorrow.

rtbike | Posts: 38

Reply to: No Fields or Signatures mapped to form

0 votes
Thanks for sticking with me, I was starting to think I was going crazy.

harishaidary | Posts: 1812

Reply to: No Fields or Signatures mapped to form

1 votes
Okay I think I figured it out. With the code below, it worked as expected:
DocumentPackage packageToSend = PackageBuilder.NewPackageNamed("Field Injection Example")
                    .WithSigner(SignerBuilder.NewSignerWithEmail("[email protected]")
                            .WithFirstName("John")
                            .WithLastName("Smith")
                            .WithCustomId("client")
                           )
                    .WithDocument(DocumentBuilder.NewDocumentNamed("Sample Contract")
                            .EnableExtraction()
                            .FromStream(fs, DocumentType.PDF)
                            .WithInjectedField(FieldBuilder.TextField()
                                    .WithName("I_txtMyPrintName")
                                    .WithValue("John Doe"))
                            .WithSignature(SignatureBuilder.CaptureFor("[email protected]")
                                .WithName("IA_txtEvaluatedByDoctorName")
                                .WithPositionExtracted())
                            )

                    .Build(); 
You should have the following in your code:
  • EnableExtraction()
  • WithPositionExtracted() for each signature
  • remove WithPositionExtracted() for each injected field
Let me know if this works for you =]

Attachments
rtbike | Posts: 38

Reply to: No Fields or Signatures mapped to form

0 votes
That worked! Thanks, Todd

harishaidary | Posts: 1812

Reply to: No Fields or Signatures mapped to form

0 votes
Good to hear :) let me know if you have any other questions.

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