Downloads a document from the cache.
downloadDocument = function(documentId, uri, position, dataSize)
static downloadDocument(documentId: string, uri: string, position: number, dataSize: number): JQueryPromise<number>;
The document ID to download. This can be null.
The URL to the resource to download. This can be null.
Current byte position.
Maximum data chunk size to download.
A Promise object that may resolve successfully to an array of bytes.
DownloadDocument allows downloading any document output file from a conversion result. If the value of
documentId is not null, then the data of the main file of the document will be downloaded. This is the content of the original PDF or DOCX file if the document was uploaded from a PDF file or DOCX file respectively.
In this mode, the entire document can be downloaded in one call by passing 0 for the dataSize parameter. The data can also be downloaded in chunks by using the dataSize and position parameters. For a document in the cache, the length of the original file is set in the Document.FileLength property.
If the value of uri is not null, then the data of this URL will be downloaded. The URL most me an item on the documents service cache, for example, the result of a convert operation through Document.Convert. The result of this method is a DocumentConvertResult object that contains the URL, MIME Type and length of any output files. The URL can be passed to DownloadDocument to obtain the file data as a byte array. Similar to the discussion above, passing 0 for dataSize result in downloading the whole of the file in one call. Otherwise, ConvertItem.Length can be used to download the data in chunks.
For an example, refer to UploadDocument.
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.