Several editable PDF

穿精又带淫゛_ 提交于 2019-12-13 23:59:12

问题


I'm working on creating a DocuSign envelope with the Java API. Everything is perfect, I can add documents, recipients and tabs.

Now, I'd like to take advantage of the editable PDF. I saw than DocuSign is capable of converting editable PDF tabs into DocuSign tabs, like describing here.

My situation is a little different as I can have several documents, some which are fillable, others that are not.

Imagine that I have three documents. DocA and DocB are fillable, DocC isn't.

I see several solutions :

  • DocA et DocB are each associated with a CompositeTemplate, DocC isn't in a Template ;
  • The three documents are each in a CompositeTemplate.

What do you think is the best solution ? And where am I suppose to define my recipients ? You need to know that I will add documents and tabs into the envelope, once it will be sent.

Any help is welcome ! Thanks

EDIT : Why a downvote without explanation ?


回答1:


You need to have an array of compositetemplates, DocA and DocB will come from ServerTemplates and DocC will add as an inlineTemplates. I have put a sample CompositeTemplate calls, where templatedId - E5577130-E7C4-4601-B618-95DD79644971 is having adding document to the envelope from first composite template (Your DocA/DocB scenario) and "documentId" : "2" coming from inlineTemplate. And recipients are declared in each composite templates separately.

POST /restapi/v2/accounts/{{acctID}}/envelopes HTTP/1.1
Host: demo.docusign.net
X-DocuSign-Authentication: <DocuSignCredentials><Username>{{user}}
</Username><Password>{{pwd}}</Password><IntegratorKey>{{IntegratorKey}}
</IntegratorKey></DocuSignCredentials>
Content-Type: multipart/form-data; boundary=BOUNDARY

--BOUNDARY
Content-Type: application/json
Content-Disposition: form-data

{
"emailSubject": "REST example - two docs, one from template and one direct",
"enableWetSign": false,
"enforceSignerVisibility": false,
"status": "created",
"compositeTemplates": [
 {
    "compositeTemplateId": "1",
    "inlineTemplates": [
      {
            "recipients": {
                "signers": [
                 {
                    "email": "abc.from.docusign@gmail.com",
                    "name": "Daffy Duck",
                    "recipientId": "1",
                    "roleName": "Primary_Signer",
                    "tabs":{
                        "textTabs":[
                            {
                                 "documentId":"1",
                                 "pageNumber":"1",
                                 "xPosition":"525",
                                 "yPosition":"750",
                                 "recipientId":"1",
                                 "locked":"true",
                                 "tabLabel":"Primary_TrxID",
                                 "value": "e93k33"
                            }
                        ]
                    }
                  }
                ]
            },
            "sequence": "2"
        }
      ],
       "serverTemplates": 
      [
        {
            "sequence": "1",
            "templateId": "E5577130-E7C4-4601-B618-95DD79644971"
        }
      ]
  },
  {
    "compositeTemplateId": "2",
      "inlineTemplates": [
         {
            "recipients": {
            "signers": [
                {
                    "email": "abc.from.docusign@gmail.com",
                    "name": "Daffy Duck",
                    "recipientId": "1",
                    "roleName": "Primary_Signer",
                    "tabs":{
                        "textTabs":[
                            {
                                 "documentId":"2",
                                 "pageNumber":"1",
                                 "xPosition":"525",
                                 "yPosition":"750",
                                 "recipientId":"1",
                                 "locked":"true",
                                 "tabLabel":"Primary_TrxID",
                                 "value": "e93k33"
                            }
                        ]
                    }
                  }
                ]
            },
            "sequence": "1"
        }
     ],
    "document" : 
    {
        "documentId" : "2",
        "name": "Option2"
    }
   }
  ]
}

--BOUNDARY
Content-Disposition: file; documentid=2; name="Option2"; 
filename="Option2.pdf"; compositeTemplateId=2
Content-Type: application/pdf
Content-Transfer-Encoding: base64

 <DocBytesBase64>

--BOUNDARY--


来源:https://stackoverflow.com/questions/45510595/several-editable-pdf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!