Dynamic Web TWAIN: Save or upload all scanned images as a multi-page TIFF file

There are various of APIs available for saving or uploading image(s) in form of TIFF.

Code (Javascript):

//Callback functions for async APIs
function OnSuccess(){ 
    console.log('successful'); 
}
function OnFailure(errorCode, errorString){ 
    alert(errorString); 
}
    
function saveImage() {
    var DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer');
    if (DWObject) {
        DWObject.IfShowFileDialog = true;
        DWObject.SaveAllAsMultiPageTIFF("DynamicWebTWAIN.tiff", OnSuccess, OnFailure);
    }
}

function OnHttpUploadSuccess() {
    console.log('successful');
}
function OnHttpUploadFailure(errorCode, errorString, sHttpResponse) {
    alert(errorString + sHttpResponse);
}

function uploadImage() {
    var DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer');
    if (DWObject) {
        DWObject.HTTPUploadAllThroughPostAsMultiPageTIFF(strHTTPServer, strActionPage, "DynamicWebTWAIN.tif", OnHttpUploadSuccess, OnHttpUploadFailure);
    }
}
Is this page helpful?

Leave a Reply

Your email address will not be published.