锚标记未显示在文档中 我们有一个14页的文档,用户必须在文档末尾的指定字段上签名。文件pdf看起来像是'
在“按”字段附近,我有/s1/
标签,它是不可见的。在Docusign自定义按钮控制器中,我也有类似的代码
................
Attachment att = [Select id,Name,Body,parentid from Attachment where parentid =: OppLst.id order by createddate DESC LIMIT 1 ];
DocuSignTK.Document document = new DocuSignTK.Document();
document.ID = 1;
document.Name = 'Quote Document';
document.FileExtension = 'html';
document.pdfBytes = EncodingUtil.base64Encode(attach.Body);
DocuSignTK.Recipient recipient = new DocuSignTK.Recipient();
recipient.Email = 'dh@gmail.com';
recipient.UserName = 'Dh';
recipient.ID = 1;
recipient.Type_x = 'Signer';
recipient.RoutingOrder = 1;
// The signer tab...
DocuSignTK.Tab signHereTab = new DocuSignTK.Tab();
signHereTab.Type_x = 'SignHere';
signHereTab.AnchorTabItem = new DocuSignTK.AnchorTab();
signHereTab.AnchorTabItem.AnchorTabString = 'signer1sig';
signHereTab.AnchorTabItem.XOffset = 8;
signHereTab.RecipientID = 1;
signHereTab.Name = 'Please sign here';
signHereTab.ScaleValue = 1;
signHereTab.TabLabel = 'signer1sig';
// The dateSigned tab
DocuSignTK.Tab dateSignedTab = new DocuSignTK.Tab();
dateSignedTab.Type_x = 'DateSigned';
dateSignedTab.AnchorTabItem = new DocuSignTK.AnchorTab();
dateSignedTab.AnchorTabItem.AnchorTabString = 'signer1date';
dateSignedTab.AnchorTabItem.YOffset = -6;
dateSignedTab.RecipientID = 1;
dateSignedTab.Name = 'Date Signed';
dateSignedTab.TabLabel = 'date_signed';
// Create an envelope and fill it in
DocuSignTK.Envelope envelope = new DocuSignTK.Envelope();
envelope.Subject = 'Please sign the Quote Document';
envelope.AccountId = account_id;
envelope.Tabs = new DocuSignTK.ArrayOfTab();
envelope.Tabs.Tab = new DocuSignTK.Tab[2];
envelope.Tabs.Tab.add(signHereTab);
envelope.Tabs.Tab.add(dateSignedTab);
envelope.Recipients = new DocuSignTK.ArrayOfRecipient();
envelope.Recipients.Recipient = new DocuSignTK.Recipient[1];
envelope.Recipients.Recipient.add(recipient);
envelope.Documents = new DocuSignTK.ArrayOfDocument();
envelope.Documents.Document = new DocuSignTK.Document[1];
envelope.Documents.Document.add(document);
if (String.isNotBlank(email_message))
{
envelope.EmailBlurb = email_message;
}
答案 0 :(得分:0)
在文档中用于“锚定”选项卡的字符串应与在选项卡的AnchorTabString属性中指定的字符串相同。
您提到文档在文本中有一个不可见的/s1/
标记,但是看起来在代码中您为锚定字符串设置了不同的值:
signHereTab.AnchorTabItem.AnchorTabString = 'signer1sig';
如果您更新此值以使其与文档中的/s1/
值匹配,则它将起作用。
解决此问题的一种方法是登录您的DocuSign帐户,使用上面的文档创建新的信封,添加收件人并转到标签页。
在标记页中,您可以使用与定位字符串相同的“自动放置”功能,以测试要用作定位的字符串可以在文档中找到。
一旦确认您具有正确的字符串,就可以在API调用中使用该字符串,并且一切正常。
如何使用自动放置功能: https://support.docusign.com/en/guides/AutoPlace-New-DocuSign-Experience