当前位置: 首页 > 知识库问答 >
问题:

当通过API获得签名文档时,我下载时没有签名

长孙燕七
2023-03-14

我的问题的背景

    null
EnvelopesApi envelopesApi = new EnvelopesApi();
EnvelopeDocumentsResult docsList = envelopesApi.ListDocuments(accountId, envelopeId);

// print the JSON response
Console.WriteLine("EnvelopeDocumentsResult:\n{0}", JsonConvert.SerializeObject(docsList));
// instantiate a new EnvelopesApi object
EnvelopesApi envelopesApi = new EnvelopesApi();
String filePath = String.Empty;
FileStream fs = null;

for (int i = 0; i < docsList.EnvelopeDocuments.Count; i++ ) 
{
    // GetDocument() API call returns a MemoryStream
    MemoryStream docStream = (MemoryStream)envelopesApi.GetDocument(accountId, docsList.EnvelopeId, docsList.EnvelopeDocuments[i].DocumentId);
    // let's save the document to local file system
    filePath = Path.GetTempPath() + Path.GetRandomFileName() + ".pdf";
    fs = new FileStream(filePath, FileMode.Create);
    docStream.Seek(0, SeekOrigin.Begin);
    docStream.CopyTo(fs);
    fs.Close();
    Console.WriteLine("Envelope Document {0} has been downloaded to:  {1}", i, filePath);
}

谢谢你的帮助!

共有1个答案

叶弘深
2023-03-14

尝试在末尾添加可选参数,如下所示:

// produce a ZIP file with all documents including the CoC
Stream results1 = envelopesApi.GetDocument(accountId, envelopeId, "archive");
// produce a PDF combining all signed documents as well as the CoC
Stream results2 = envelopesApi.GetDocument(accountId, envelopeId, "combined");

(此代码摘自关于此主题的博客文章)

 类似资料: