簡體   English   中英

我的問題是如何根據PDF字段名稱放置黃色標簽

[英]My question is how to place yellow tab based on PDF field names

我正在創建一個通用的微服務,它接收PDF並通過電子郵件發送給多個簽名者進行簽名。

我想在簽名者需要簽名的PDF字段上放置黃色框(選項卡)。 似乎有3種方法可以做到這一點:

  1. x, y坐標(不適合項目,因為要求調用程序來測量PDF以提供它是不容易的)
  2. anchorString ,不理想,因為不建議在PDF上進行編輯
  3. CompositeTemplate似乎是唯一的出路。 不確定做錯了什么,黃色標簽只是不顯示。

      byte[] buffer = readFile( docPdf); String docBase64 = Base64.getEncoder().encodeToString(buffer); // Create the DocuSign document object Document document = new Document(); document.setDocumentBase64(docBase64); document.setName(docPdf); // can be different from actual file name document.setFileExtension("pdf"); document.setTransformPdfFields("true"); // many different document types are accepted document.setDocumentId("1"); // a label used to reference the doc ArrayList<CompositeTemplate> compList = new ArrayList<CompositeTemplate>(); CompositeTemplate compoTemplate = new CompositeTemplate(); //Add to Composite template compoTemplate.setDocument(document); //Create Envelope recipients, including them in the first template ArrayList<Signer> signers= new ArrayList<Signer>(); Signer signer1 = new Signer (); signer1.setEmail("***@***"); signer1.setName("Jane Doe"); signer1.setRecipientId("1"); signer1.setRoleName("Test"); signer1.setRoutingOrder("1"); SignHere signHere1 = new SignHere(); signHere1.setTabLabel("aaa"); signHere1.setRecipientId("1"); signHere1.setDocumentId("1"); signHere1.setPageNumber("6"); Tabs recipientTabs = new Tabs(); recipientTabs.setSignHereTabs(Arrays.asList(signHere1)); signer1.setTabs(recipientTabs); signers.add(signer1); Recipients recipientList = new Recipients(); recipientList.signers(signers); //Create the list for InlineTemplates ArrayList<InlineTemplate> inlineTemplateList = new ArrayList<InlineTemplate>(); InlineTemplate inlineTemplate = new InlineTemplate(); inlineTemplate.setSequence ( "1"); inlineTemplate.setRecipients(recipientList); inlineTemplateList.add(inlineTemplate); //Create the composite template, inline template lists. compoTemplate.setCompositeTemplateId("1"); //compoTemplate.ServerTemplates = templateList; compoTemplate.setInlineTemplates(inlineTemplateList); //Take the Composite Template list, add both compList.add(compoTemplate); //Create the definition for the envelope EnvelopeDefinition envelopeDefinition = new EnvelopeDefinition(); //Add the Composite Template list // envelopeDefinition.setCompositeTemplates(templateList); envelopeDefinition.setEmailSubject("composite ***** "); envelopeDefinition.setCompositeTemplates(Arrays.asList(compoTemplate)); // envelopeDefinition.setRecipients(recipientList); envelopeDefinition.setStatus("sent"); // requests that the envelope be created and sent. 

請參閱有關標簽的文檔中的此說明( https://developers.docusign.com/esign-rest-api/guides/concepts/tabs ):

重要說明:PDF字段的名稱必須與要將值傳輸到的DocuSign選項卡的(區分大小寫)tabLabel值匹配。 如果PDF字段名稱與DocuSign tabLabel匹配,則可以為文檔數組中的給定文檔將transformPdfFields屬性設置為true,如下所示。

(我在代碼中看不到tabLabel屬性)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM