0

我正在遵循这些步骤。

  1. 我正在使用 c# API 为 DocuSign 上传 TEXT / PNG / DOCX / PPTX 文件。
  2. 当我在文件签名后下载该文件时,我得到了该签名文件的 PDF 格式,上传的文件格式除外。

签名完成后,是否有任何替代的代码或 API 方式如何在下载时获得相同的扩展文件。

信封 ID:- 3a6b752a-92f1-4751-b06a-ffb2c236f65d、93409bdc-edcf-4e4b-8c6f-3c76c6305dcf、5a32979b-3739-4585-a554-b725e1d65504

我在 asp.net 中使用下面的代码。

// get Lists the envelope documents.
public static EnvelopeDocumentsResult ListEnvelopeDocuments(string accountId, string envelopeId)
{
   EnvelopesApi envelopesApi = new EnvelopesApi();
   EnvelopeDocumentsResult docsList = envelopesApi.ListDocuments(accountId, 
   envelopeId);
   return docsList;
}
// download file using envelopeId and that I get .pdf format 

public static string DownloadSignedDocument(string envelopeId, string tempFileName, string companyCode, string apiUserName, string apiPassword, string integratorkey, string restApi)
{
  ApiClient apiClient = new ApiClient(restApi);
  Configuration.Default.ApiClient = apiClient;
// call the Login() API which sets the user's baseUrl and returns their accountId
string accountId = LoginApi(apiUserName, apiPassword, integratorkey);
// pass accountid and envelop id to get perticuler document for the download
  EnvelopeDocumentsResult documentList = ListEnvelopeDocuments(accountId, 
  envelopeId);

string SignedPDFPath = string.Empty;
EnvelopesApi envelopesApi = new EnvelopesApi();
foreach (EnvelopeDocument document in documentList.EnvelopeDocuments)
{
   MemoryStream docStream = 
   (MemoryStream)envelopesApi.GetDocument(accountId, 
    envelopeId, documentList.EnvelopeDocuments[0].DocumentId);
    string documentName = document.Name != "Summary" ? document.Name : 
    "Summary";
     SignedPDFPath = 
    systemConfiguration.ConfigurationManager.AppSettings["uploadFolder"] + 
    "/" + companyCode + "/" + "DocuSign/" + envelopeId;
     if (!Directory.Exists(SignedPDFPath))
      {
        Directory.CreateDirectory(SignedPDFPath);
      }
      string[] tempFileExtention = tempFileName.Split('.');
      string[] removeFileExtention = documentName.Split('.');
      // need to give hardcoded ".pdf" extention because **document.Name** 
      //gives pdf file formate
      SignedPDFPath = SignedPDFPath + "/" + removeFileExtention[0] + ".pdf" 
      ;

    // Server.MapPath("~/Uploadfiles/" + recipient.EnvelopeID + "/" + 
 //  recipient.EnvelopeID + "_" + documentName + ".pdf");
     using (FileStream fileStream = File.Create(SignedPDFPath))
      {
       docStream.Seek(0, SeekOrigin.Begin);
       docStream.CopyTo(fileStream);
      }
     break;
    }
     return SignedPDFPath;
    }
4

1 回答 1

2

不。

所有文件在上传到 DocuSign 后都会转换为 PDF。如果需要,您可以使用外部工具将该 PDF 转换为另一种文件格式,但您会破坏文档上的“防篡改”数字印章。

于 2018-12-18T17:53:05.200 回答