我們正在尋找下載合併的pdf,然後提取單個文件(不是我的想法)。我嘗試使用pdfsharp對付我的pdf,但沒有在單個文檔上看到任何標題信息。我只是想知道這是否可能。如果我使用pdfsharp,它可以取出所有頁面,但我無法真正知道哪些頁面屬於文檔。Docusign合併pdf - 我們可以提取單個文件嗎?
1
A
回答
2
後創建的DocuSign信封您可以閱讀信封中的文件信息,並記住每個文檔的頁數。如果您正在使用模板,這也應該可以工作。
您可以使用EnvelopeDocuments: list API來獲取文檔信息,其中包括每個文檔的頁面。然後,當您需要從組合PDF中提取單個文檔時,您將知道將單個文檔分開的位置。
這裏有一個列表文件調用示例API響應:
{
"envelopeDocuments": [
{
"availableDocumentTypes": [
{
"isDefault": "true",
"type": "electronic"
}
],
"display": "inline",
"documentId": "1",
"includeInDownload": "true",
"name": "NDA.pdf",
"order": "1",
"pages": "3",
"signerMustAcknowledge": "no_interaction",
"type": "content",
"uri": "/envelopes/44efc9e6-915e-4b1d-9b54-801410d6922d/documents/1"
},
{
"availableDocumentTypes": [
{
"isDefault": "true",
"type": "electronic"
}
],
"display": "inline",
"documentId": "2",
"includeInDownload": "true",
"name": "House.pdf",
"order": "2",
"pages": "1",
"signerMustAcknowledge": "no_interaction",
"type": "content",
"uri": "/envelopes/44efc9e6-915e-4b1d-9b54-801410d6922d/documents/2"
},
{
"availableDocumentTypes": [
{
"isDefault": "true",
"type": "electronic"
}
],
"display": "inline",
"documentId": "3",
"includeInDownload": "true",
"name": "contractor_agreement.docx",
"order": "3",
"pages": "2",
"signerMustAcknowledge": "no_interaction",
"type": "content",
"uri": "/envelopes/44efc9e6-915e-4b1d-9b54-801410d6922d/documents/3"
},
{
"availableDocumentTypes": [
{
"isDefault": "true",
"type": "electronic"
}
],
"display": "inline",
"documentId": "certificate",
"includeInDownload": "true",
"name": "Summary",
"order": "999",
"pages": "4",
"signerMustAcknowledge": "no_interaction",
"type": "summary",
"uri": "/envelopes/44efc9e6-915e-4b1d-9b54-801410d6922d/documents/certificate"
}
],
"envelopeId": "44efc9e6-915e-4b1d-9b54-801410d6922d"
}
2
getEnvelopeDocuments api有一個選項,可以將信封中的所有文檔作爲zip文件下載。您可以解壓縮文件並獲取單個文檔。
GET /v2/accounts/{accountId}/envelopes/{envelopeId}/documents/archive
檢索包含所有用於語音認證的PDF文檔,證書,以及任何.WAV文件的ZIP文件。
這裏是一個示例代碼下載的zip文件,並使用Docusign C# SDK將其解壓縮。
完整示例here。
var envApi = new EnvelopesApi();
// GetDocument() API call returns a MemoryStream
var docStream = envApi.GetDocument(accountId, envelopeId, "archive");
// let's save the document to local file system
string zipName = Path.GetRandomFileName();
string zipfilePath = @"C:\temp\" + zipName + ".zip";
using (var fs = new FileStream(zipfilePath, FileMode.Create))
{
docStream.Seek(0, SeekOrigin.Begin);
docStream.CopyTo(fs);
}
string extractPath = @"c:\temp\" + zipName;
System.IO.Compression.ZipFile.ExtractToDirectory(zipfilePath, extractPath);
編輯(凱西 - 洛瑞)
出於某種原因,我不得不鑄流到FileStream對象的問題。我所做的卻是以下幾點:
Stream docStream = envApi.GetDocument(AccountId, envelopeId, "archive");
MemoryStream ret = new MemoryStream();
byte[] buffer = new byte[8192];
int bytesRead;
while ((bytesRead = docStream.Read(buffer, 0, buffer.Length)) > 0)
{
ret.Write(buffer, 0, bytesRead);
}
ret.Position = 0;
using (var fs = new FileStream(@"C:\temp\envelopeDocuments.zip", FileMode.Create))
{
ret.CopyTo(fs);
}
相關問題
- 1. 我們可以提交單個文件嗎?
- 2. 我們可以從刻錄設置中提取msi文件嗎?
- 3. 我們可以從evernote文件中提取文本內容嗎
- 4. 取消合併XML文件,可以嗎?
- 5. 我可以從PDF中提取中文文本並轉換成英文嗎?
- 6. 我們可以提交沒有提交按鈕的PDF表單嗎?
- 7. 我們可以將兩個dgml圖合併成一個嗎?
- 8. 我們可以使用iText壓縮PDF文件大小嗎?
- 9. 我們可以使用php閱讀pdf文件的內容嗎?
- 10. iPhone:我們可以使用UIWebView打開pdf文件嗎?
- 11. 我們可以使用Hadoop MapReduce合併兩個文件代碼
- 12. 我可以將這兩個.htaccess文件合併爲一個嗎?
- 13. 我們可以合併兩個片段容器嗎?
- 14. 我們可以使用Flex合併2個視頻嗎?
- 15. PowerShell可以提取.tgz文件嗎?
- 16. 我可以將html5shiv.js和respond.min.js合併到一個文件中嗎?
- 17. 你可以將多個文件合併成一個文件嗎?
- 18. 我們可以將CSS和JS文件組合成一個文件嗎?
- 19. 我們可以使用reportlab創建交互式PDF表單嗎?
- 20. 合併幾個pdf文件
- 21. 我們可以使用單個ASP.NET FileUpload控件添加多個文件嗎?
- 22. 我們可以將iFrame整合到PHP文件中嗎?
- 23. 我們可以通過solr配置文件提升字段嗎?
- 24. 我們可以使用lua腳本提取PDF頁面
- 25. treeview.resources:它們可以被提取嗎?
- 26. Docusign API與ColdFusion檢索PDF - 文件/合併
- 27. 可以將sIFR js文件合併爲1個js文件嗎?
- 28. 我們可以整合聲納嗎?
- 29. 我們可以結合git標籤嗎?
- 30. 我們可以整合Dynamodb和Wavemaker嗎?
我不知道該存檔選項。很高興知道。 –
我會在這裏向所有人介紹我的所有發現,他們可以做出決定。知道如何以不同的方式去皮膚,這是很好的。感謝所有的幫助。 –
哇。我不知道有語音驗證功能。我不認爲我們會使用它,但如果我們確實需要它,它確實有它。 –