下载的数据指定的文档ID。
公共静态长DownloadDocument (DownloadDocumentOptions选项)
vb (vb语法)公共共享函数DownloadDocument (按值传递_options_作为DownloadDocumentOptions)一样长
公共:静态Int64 DownloadDocument (DownloadDocumentOptions^选项)
选项
包含文档属性的选择和下载选项来使用。这个值不能零。
读入的字节总数DownloadDocumentOptions.Data或DownloadDocumentOptions.Stream。这可以小于请求的字节数DownloadDocumentOptions.Length如果目前许多字节不,或者零(0)如果数据的结束。
类似于UploadDocument,数据可以在块或下载。指使用文档库上传详细的信息关于如何使用这些方法和所使用的各种选项。
GetDocumentCacheInfo可以用来确定一个文档是否在缓存中并得到它的信息。
DownloadAnnotations可以用来下载文档的注释(如果有的话)。
这个示例将展示如何下载文档的数据存储在缓存到一个流一次,然后使用块缓冲区数组。
使用Leadtools;使用Leadtools.Codecs;使用Leadtools.Document.Writer;使用Leadtools.Document;使用Leadtools.Caching;使用Leadtools.Annotations.Engine;使用Leadtools.Ocr;使用Leadtools.Barcode;使用Leadtools.Document.Converter;公共无效DownloadDocumentExample (){vardocumentUri =新Uri (“https://demo.leadtools.com/images/pdf/leadtools.pdf”);字符串documentFile1 = Path.Combine (LEAD_VARS.ImagesDir,“downloaded1.pdf”);字符串documentFile2 = Path.Combine (LEAD_VARS.ImagesDir,“downloaded2.pdf”);/ /设置一个缓存FileCache缓存=新FileCache ();缓存。CacheDirectory =@“c: \ cache-dir”;字符串documentId;/ /文档加载到缓存中varloadDocumentOptions =新LoadDocumentOptions ();loadDocumentOptions。缓存=缓存;使用(var文档= DocumentFactory。LoadFromUri (documentUri loadDocumentOptions)){/ /文档ID,并将其保存documentId = document.DocumentId;文档。AutoDeleteFromCache =假;文档。AutoSaveToCache =假;document.SaveToCache ();}/ /现在一次性下载到内存流vardownloadDocumentOptions =新DownloadDocumentOptions ();downloadDocumentOptions。缓存=缓存;downloadDocumentOptions。DocumentId = DocumentId;downloadDocumentOptions。抵消= 0;downloadDocumentOptions。长度= 1;使用(var流=新MemoryStream ()){downloadDocumentOptions。流=流;长字节= DocumentFactory.DownloadDocument (downloadDocumentOptions);Console.WriteLine (“{0}个字节到下载流”字节);/ /保存流到一个文件中并表现出来使用(var输出= File.Create (documentFile1))stream.WriteTo(输出);Process.Start (documentFile1);}/ /下载一遍,这一次我们将缓冲区32 kdownloadDocumentOptions =新DownloadDocumentOptions ();downloadDocumentOptions。缓存=缓存;downloadDocumentOptions。DocumentId = DocumentId;字节[]缓冲=新字节(1024 * 32);使用(var输出= File.Create (documentFile2)){/ /抵消,我们有:长抵消= 0;int字节;做{downloadDocumentOptions。抵消=抵消;downloadDocumentOptions。长度= buffer.Length;downloadDocumentOptions。数据=缓冲区;downloadDocumentOptions。DataOffset = 0;字节数= (int)DocumentFactory.DownloadDocument (downloadDocumentOptions);如果(字节> 0){Console.WriteLine (“{0}下载字节缓冲区”字节);/ /下一个块+ =字节抵消;输出。写(缓冲0字节);}}而(字节> 0);}Process.Start (documentFile2);/ /我们正在做,清理vardeleteFromCacheOptions =新LoadFromCacheOptions ();deleteFromCacheOptions。缓存=缓存;deleteFromCacheOptions。文档Id = documentId;DocumentFactory.DeleteFromCache (deleteFromCacheOptions);}静态类LEAD_VARS{公共常量字符串ImagesDir =@“C: \ LEADTOOLS22 \ Resources \图片”;}
帮助收藏
光栅net|C API|c++类库|HTML5 JavaScript
文档net|C API|c++类库|HTML5 JavaScript
医疗net|C API|c++类库|HTML5 JavaScript
医疗Web查看器net
188宝金博怎么下载
支持的平台上
net, Java, Android和iOS / macOS组件
C / c++类库的API
HTML5 JavaScript库
你的邮件已经发送到支持!有人应该联系!如果你的问题是紧急请回到聊天。
聊天时间:
周一——周五,上午6点等
谢谢你的反馈!
请填写表单重新开始一个新的聊天。
所有代理目前离线。
聊天时间:
周一-周五
早上8:30 - 6点
联系我们请填写这张表格,我们将通过电子邮件联系你。
