Downloads a document from the HTTP server into an image viewer asynchronously.

Syntax, onHttpDownloadSuccess, onHttpDownloadFailure [, onHttpDownloading]));


<string> url: specifies the URL to download the file.
<onHttpDownloadSuccess function> onHttpDownloadSuccess: callback function triggered when the file is downloaded successfully.
<onHttpDownloadFailure function> onHttpDownloadFailure: callback function triggered when the file failed to be downloaded.
<onhttpdownloading function> optional onHttpDownloading: callback function triggered during downloading the document.

Please refer to the function prototype onHttpDownloadSuccess or onHttpDownloadFailure. or onHttpDownloading.

Return value



This method only supports downloading BMP, JPEG, PNG, TIFF and PDF files.

When the document fails to be loaded into the viewer, please check errorCode, errorString and httpResponse in failure callback function for more information.

Previously selected documents/images will be deselected and the newly loaded document will be selected automatically.

When the image buffer is full, that is to say, count equals capacity, the downloaded document will not be imported into the image buffer.


/****Get image01.png from:****/
var imageviewer = DCSObject.getImageViewer ('ImageViewerContainer');  // Gets a specified image viewer'', onHttpDownloadSuccess, onHttpDownloadFailure, onHttpDownloading);

function onHttpDownloadSuccess () {

function onHttpDownloadFailure (errorCode, errorString, httpResponse) {
    console.log('ErrorCode: ' + errorCode+ 'ErrorString: ' + errorString + 'HTTPResponseString: ' + httpResponse);

function onHttpDownloading (percentage) {


See also


Is this page helpful?

Leave a Reply

Your email address will not be published.