Asp.net mvc 想要准确的文件格式下载,我们上传了文件签名签名
我正在遵循这些步骤Asp.net mvc 想要准确的文件格式下载,我们上传了文件签名签名,asp.net-mvc,angular,asp.net-web-api,docusignapi,docusigncompositetmplts,Asp.net Mvc,Angular,Asp.net Web Api,Docusignapi,Docusigncompositetmplts,我正在遵循这些步骤 我正在为DocuSign上传TEXT/PNG/DOCX/PPTX文件,使用 c#API 当我在文件签名后下载该文件时,我得到了该签名文件的PDF格式,上传的文件格式除外 在签名完成后,我如何在下载时获得相同的扩展名文件,是否有其他的代码或API方法 信封ID:-3a6b752a-92f1-4751-b06a-ffb2c236f65d、93409bdc-edcf-4e4b-8c6f-3c76c6305dcf、5a32979b-3739-4585-a554-B725E1D6554
// 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;
}
没有
上传到DocuSign后,所有文件都将转换为PDF。如果需要,您可以使用外部工具将该PDF转换为另一种文件格式,但您将破坏文档上的“防篡改”数字印章。否
上传到DocuSign后,所有文件都将转换为PDF。如果需要,您可以使用外部工具将该PDF转换为另一种文件格式,但您将破坏文档上的“防篡改”数字印章