httpDownloadDocument()

Description

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

Syntax

ImageViewerObject.io.httpDownloadDocument(url);

Parameters

<string> url: specifies the URL to download the file.

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

Return value

bool

true indicates success. false indicates failure.

When false is returned, check getErrorCode() or getErrorString() for error information.

Remarks

Previously selected images/documents 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.

Example

/****Get image01.png from: http://www.dynamsoft.com/images/image01.png****/
var imageviewer = DCSObject.getImageViewer('ImageViewerContainer');  // Get a specified image viewer
imageviewer.io.httpDownloadDocument('https://www.dynamsoft.com/images/image01.png');

See also

.io.httpDownloadDocumentAsync()

Is this page helpful?

Leave a Reply

Your email address will not be published.