1. The SaveAs*** method can be used to save a specified image in buffer as an image file. Currently, Dynamic Web TWAIN supports BMP, PNG, JPEG, PDF and TIFF. Click here to get more information..
2. The HTTPUploadThroughPost method can be used to upload a specified image in buffer as an image file. Click here to get more information about this method.
Here is a sample of saving each image in buffer as a separate PDF file.
Code:
//JavaScript
function btnUpload_onclick()
{
var i;
var strActionPage;
var strHostIP;
var CurrentPathName = unescape(location.pathname); // get current PathName in plain ASCII
var CurrentPath = CurrentPathName.substring(0, CurrentPathName.lastIndexOf("/") + 1);
strActionPage = CurrentPath + "SaveToFile.aspx"; //the ActionPage's file path
strHostIP = "localhost"; //the host's ip or name
frmScan.DynamicWebTwain1.HTTPPort = 80;
for (i=0; i<frmScan.DynamicWebTwain1.HowManyImagesInBuffer; i++)
{
frmScan.DynamicWebTwain1.HTTPUploadThroughPost(strHostIP, i, strActionPage, i+".PDF");
}
}
