bbs_jack | Posts: 8

Validation Error: "This document has the "NeedAppearances" flag set"

0 votes
Hi, I'm trying to implement Field Injection, but when I post to the payload to
/api/packages
, I get the following error.
"messageKey" => "error.validation.verifyDocument.hasNeedAppearancesFlag"
"message" => "This document has the "NeedAppearances" flag set. This has negative implications concerning the security of the signatures, and cannot be accepted."
"code" => 400
"name" => "Validation Error"
My client provided the PDF, is there a way to remove the "NeedAppearances" flag? Google search has not turned up anything useful that I can act on. Is this something I need to fix on my end, or do I need to contact eSignLive support? Thank you.

Duo_Liang | Posts: 3776

Reply to: Validation Error: "This document has the "NeedAppearances" flag set"

1 votes
Hi there, With a quick test, if I opened a "NeedAppearances set to true" PDF in Adobe Acrobat and then resave it, the PDF can be uploaded to OneSpan Sign system. In your case, you want a programmatical solution to remove the flag or you just need to fix this specific PDF? You can also send your PDF to [email protected] (without sensitive information) so that I can test on my side for you. Duo

bbs_jack | Posts: 8

Reply to: Validation Error: "This document has the "NeedAppearances" flag set"

0 votes
Thanks Duo! Just opening the PDF in Adobe Acrobat and hitting the Save button fixed that issue. New error:
"messageKey" => "error.validation.sendPackage.noApprovals"
 "message" => "Cannot send package without approvals."
 "code" => 400
 "name" => "Validation Error"
What is this for, and where do I set this? Thank you.

Duo_Liang | Posts: 3776

Reply to: Validation Error: "This document has the "NeedAppearances" flag set"

0 votes
Hi bbs_jack, It looks like you haven't yet added any signature to your document. May I have a look at your JSON payload without personal info? Duo

bbs_jack | Posts: 8

Reply to: Validation Error: "This document has the "NeedAppearances" flag set"

0 votes
Here's the JSON:
{
   "documents":[
      {
         "id":"sample-contract",
         "name":"Application Document",
         "extract":true,
         "data":{
            "esl_doc_extract_type":1
         },
         "fields":[
            {
               "value":"Test Company",
               "name":"company"
            },
            {
               "value":"Joe Smith",
               "name":"full_name"
            },
            {
               "value":"123 Test Street",
               "name":"street_address"
            }
         ]
      }
   ],
   "status":"SENT",
   "type":"PACKAGE",
   "roles":[
      {
         "id":"signer1",
         "type":"SIGNER",
         "signers":[
            {
               "email":"[email protected]",
               "firstName":"Joe",
               "lastName":"Smith",
               "id":"signer1"
            }
         ],
         "name":"signer1"
      }
   ],
   "name":"Application Package"
}

Duo_Liang | Posts: 3776

Reply to: Validation Error: "This document has the "NeedAppearances" flag set"

0 votes
Hi there, You just want to check the result of Field Injection Feature? Or you have signatures and fields added by other extraction methods? For the former, simply set "status" attribute to "DRAFT" instead of "SENT" and you will see the result in your web portal that all values will be flattened into the PDF. Duo

bbs_jack | Posts: 8

Reply to: Validation Error: "This document has the "NeedAppearances" flag set"

0 votes
Okay, I just tested the DRAFT, it does create the package, however, it doesn't populate the fields that I passed it. I'll follow up with an email with my actual PDF attached.

bbs_jack | Posts: 8

Reply to: Validation Error: "This document has the "NeedAppearances" flag set"

0 votes
I have sent the follow up email with my PDF and JSON payload. Also, I have successfully added the signature following the payload from: https://developer.esignlive.com/guides/quick-start/creating-and-sending-a-package-rest/

Duo_Liang | Posts: 3776

Reply to: Validation Error: "This document has the "NeedAppearances" flag set"

1 votes
Hi there, Through our discussion, in private thread, it looks like that "text doesn't get populated in uploaded PDF" was caused by the complex name of PDF forms. I will check with our support team to see whether it's designed in this way or it should be fixed, and come back to you soon. Duo

Duo_Liang | Posts: 3776

Reply to: Validation Error: "This document has the "NeedAppearances" flag set"

0 votes
Hi bbs_jack, After more test, I found out that it's because of the dot in the form name that makes it unrecognized. For example, changed the insurance company form name to "HabitationalInsuranceApplication[0]Page1[0]General[0]Company[0]" and change the code as well, the value will be populated. If it's possible for your PDF provider to regenerate the PDF and remove all the dots in the names, it would work the issue around. But still, I will create a support ticket on your behalf and CC you to have this issue reported. Because with another test, I found out that with the same naming convention, the form can be extracted by other extraction methods, like Position Extraction which means these fields can actually be recognized by doc engine. Duo

bbs_jack | Posts: 8

Reply to: Validation Error: "This document has the "NeedAppearances" flag set"

0 votes
Can you explain this further, I'm not sure I follow:
I found out that with the same naming convention, the form can be extracted by other extraction methods, like Position Extraction which means these fields can actually be recognized by doc engine.

Duo_Liang | Posts: 3776

Reply to: Validation Error: "This document has the "NeedAppearances" flag set"

0 votes
Hi, Try this payload:
{
  "roles": [
    {
      "id": "Signer1",
      "type": "SIGNER",
      "signers": [
        {
          "firstName": "John",
          "lastName": "Smith",
          "email": "[email protected]"
        }
      ],
      "name": "Signer1"
    }
  ],
  "documents": [
    {
      "approvals": [
        {
          "fields": [
            {
              "type": "SIGNATURE",
              "extract": true,
              "subtype": "FULLNAME",
              "name": "HabitationalInsuranceApplication[0].Page1[0].General[0].Company[0]"
            }
          ],
          "role": "Signer1"
        }
      ],
      "extract": true,
      "name": "Sample Contract"
    }
  ],
  "name": "Field Position Extraction Example",
  "type": "PACKAGE",
  "language": "en",
  "autoComplete": true,
  "status": "DRAFT"
}
Where I set the field as signature, just for test. But when you log onto the webportal, you will see the field get extracted. Both Position Extraction and Field Injection use PDF forms to tell OneSpan Sign the location and size of field. So I believe they should be similar in doc engine level. Duo

bbs_jack | Posts: 8

Reply to: Validation Error: "This document has the "NeedAppearances" flag set"

0 votes
I'm able to create the package, however, when I go through the whole process, the status does change to "Completed", but I don't see the signature anywhere on the doc.
{
   "documents":[
      {
         "id":"sample-contract",
         "name":"Application Document",
         "extract":true,
         "data":{
            "esl_doc_extract_type":1
         },
         "fields":[
            {
               "value":"Test Insurance",
               "name":"insurance_company_name"
            },
            {
               "value":"Test Test",
               "name":"applicant_full_name"
            }
         ],
         "approvals":[
            {
               "role":"Signer1",
               "fields":[
                  {
                     "type":"SIGNATURE",
                     "extract":true,
                     "subtype":"FULLNAME",
                     "name":"applicant_signature"
                  }
               ]
            }
         ]
      }
   ],
   "status":"SENT",
   "type":"PACKAGE",
   "roles":[
      {
         "id":"Signer1",
         "type":"SIGNER",
         "signers":[
            {
               "email":"[email protected]",
               "firstName":"test",
               "lastName":"test",
               "id":"Signer1"
            }
         ],
         "name":"Signer1"
      }
   ],
   "name":"Application Package"
}

Duo_Liang | Posts: 3776

Reply to: Validation Error: "This document has the "NeedAppearances" flag set"

0 votes
Hi there, I assumed that you've manually simplified the PDF form names. Could you remove the "data" node (from line 7 to 9 of your JSON):
         "data":{
            "esl_doc_extract_type":1
         },
And try creating the package again? Duo

bbs_jack | Posts: 8

Reply to: Validation Error: "This document has the "NeedAppearances" flag set"

0 votes
Thanks Duo! It works, I can now populate the form, and sign it. For anyone else going through this flow, what I am doing is: 1. Fill PDF with Field Injection 2. Create package 3. Sign package 4. Download package

Duo_Liang | Posts: 3776

Reply to: Validation Error: "This document has the "NeedAppearances" flag set"

0 votes
Glad to hear that and thanks a lot for sharing your experience! :) Duo

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