DocusignApi - Attachment with SignHere tab on the third page

妖精的绣舞 提交于 2019-12-25 17:23:47

问题


I'm using the C# DocuSign SDK to create and send an envelope with a document attached to it. The document has multiple pages, with SignHere tabs appearing in various positions in the document, depending on the recipient. I used Anchor-Tabs to get the SignHere tab to position correctly.

When the recipient receives the document, I see that the SignHere tab was placed at the bottom of every page till it finds the first match for the anchor text. Say for example, the anchor text was on page three, and the document was 5 pages long, SignHere tab would be placed on the bottom of pages 1 and 2, and then correctly placed on page 3. Pages 4 and 5 would have no SignHere tabs (as expected).

I have attached sample / simplified code below:

var envelopeDefinition = new EnvelopeDefinition
{
    EmailSubject = "Please sign this agreement.",
    Status = "sent",
    Documents = new List<Document>(),
    Recipients = new Recipients { Signers = new List<Signer>() }
};

envelopeDefinition.Documents.Add(new Document
{
    DocumentId = "1", Name = attachment.Name, DocumentBase64 = Convert.ToBase64String(attachment.Bytes),
});

envelopeDefinition.Recipients.Signers.Add(new Signer
{
    RecipientId = "1",
    Email = recipient.Email,
    Name = recipient.Name,
    Tabs = new Tabs
    {
        SignHereTabs = new List<SignHere>
        {
            new SignHere
            {
                RecipientId = "1",
                AnchorString = "||signhere||",
                AnchorXOffset = "1",
                AnchorYOffset = "1",
                AnchorIgnoreIfNotPresent = "true"
            }
        }
    }
});

var envelopesApi = new EnvelopesApi();
var envelopeSummary = envelopesApi.CreateEnvelope(accountId, envelopeDefinition);

I have a sample attachment uploaded at https://s3-us-west-2.amazonaws.com/sof-docusignq/Test_Attachment.pdf and a completed signed version of the same attachment at https://s3-us-west-2.amazonaws.com/sof-docusignq/Test_Completed.pdf.

What am I doing wrong?


回答1:


Figured this one out. I used PdfSharp to generate the pdf from my template, PdfSharp apparently has this weird way in which they split content to pages. I switched to EO Pdf and it works great now.



来源:https://stackoverflow.com/questions/36684981/docusignapi-attachment-with-signhere-tab-on-the-third-page

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