Error processing SSI file
LEADTOOLS Leadtools.Documents (Leadtools.Documents assembly)

DownloadDocument Method

Show in webframe
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.
Downloads a document from the cache.
Syntax
 function Leadtools.Documents.DocumentFactory.downloadDocument( 
   documentId ,
   uri ,
   position ,
   dataSize 
)

Parameters

ParameterTypeDescription
documentIdstringThe document ID to download. This can be null.
uristringThe URL to the resource to download. This can be null.
positionintCurrent byte position.
dataSizeintMaximum data chunk size to download.

Return Value

TypeDescription
jQueryApi.IDeferred A Promise object that may resolve succesfully to an array of bytes.
Remarks

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.

Example

For an example, refer to UploadDocument.

See Also

Reference

DocumentFactory Object
DocumentFactory Members

Error processing SSI file