Downloads a document from the cache.
downloadDocument = function(documentId, uri, position, dataSize)
static downloadDocument(documentId: string, uri: string, position: number, dataSize: number): JQueryPromise<number[]>;
documentId
The document ID to download. This can be null.
uri
The URL to the resource to download. This can be null.
position
Current byte position.
dataSize
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.
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET