TWAIN ActiveX Control, Plug-in, Scanner SDK, Component, HTTP Control/SDK

Dynamsoft TWAIN Products

Support Community for TWAIN Control/Component/SDK for Scanning Solutions
* Login   * Register
* FAQ    * Search

It is currently Sun May 20, 2012 3:19 pm




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Inconsistent blank msg box
PostPosted: Tue Jul 05, 2011 12:05 pm 
Offline

Joined: Wed Jun 29, 2011 7:14 am
Posts: 7
Hello,

I am nearing the end of my evaluation and have only found one problem I can not seem to pin down to get this integrated into our system.

Current setup:
- uploading files via FTP server (Using FTPUploadAsMultiPagePDF, great PDF construction by the way!)
- All functions are identical to examples with the exception of some name changes. (using ADF and SaveToFile examples).

Once in a while, I get a blank error msg box. If I run the scan again, it runs normally. This might be confusing to some of our end users, do you have any current fix for this?

was also wondering if there was a http sample with a code-behind file?


Top
 Profile  
 
 Post subject: Re: Inconsistent blank msg box
PostPosted: Wed Jul 06, 2011 3:44 am 
Offline
User avatar

Joined: Tue Mar 08, 2005 12:23 am
Posts: 1075
Hi JayGalway,

Quote:
Once in a while, I get a blank error msg box. If I run the scan again, it runs normally.

To better pinpoint the cause of the problem, would you please be more specific about this? When did you get the blank error message box? (If you are using the SaveToFile sample, you may get messages returned from ErrorString or HTTPPostResponseString.)
Quote:
was also wondering if there was a http sample with a code-behind file?

Do you mean a http sample which is used to upload scanned images to your web server or database? If yes, you can use the HTTP Post method to achieve your requirement. Also you can refer to the SaveToFile or SaveToDB sample which can be found at:
http://www.dynamsoft.com/Downloads/ASP. ... ample.aspx

_________________
Catherine Sea
TWAIN Support Team
TWAIN ActiveX/Plug-in for Web Applications, Scanner COM Control
TWAIN .NET Component/SDK for Desktop Applications

Follow me @Twitter, Facebook
Image


Top
 Profile  
 
 Post subject: Re: Inconsistent blank msg box
PostPosted: Thu Jul 07, 2011 6:09 am 
Offline

Joined: Wed Jun 29, 2011 7:14 am
Posts: 7
Sorry about the long reply.

I have found that on the first scan for the pages I want to have scan features I am getting a error msg box with no message, but only on the first scan.

Here are the code snippits for the scanning

<object classid="clsid:3d25aba1-caec-11cf-b34a-00aa00a28331" viewastext>
<param name="LPKPath" value="DynamicWebTwain.lpk" />
</object>

<object classid="clsid:FFC6F181-A5CF-4EC4-A441-093D7134FBF2" id="DynamicWebTwain1"
width="1" height="1" codebase="DynamicWebTwain.cab#version=6,0">
<param name="_cx" value="847" />
<param name="_cy" value="847" />
<param name="JpgQuality" value="80" />
<param name="Manufacturer" value="DynamSoft Corporation" />
<param name="ProductFamily" value="Dynamic Web TWAIN" />
<param name="ProductName" value="Dynamic Web TWAIN" />
<param name="VersionInfo" value="Dynamic Web TWAIN 6.0" />
<param name="TransferMode" value="0" />
<param name="BorderStyle" value="0" />
<param name="FTPUserName" value="" />
<param name="FTPPassword" value="" />
<param name="FTPPort" value="21" />
<param name="HTTPUserName" />
<param name="HTTPPassword" />
<param name="HTTPPort" value="80" />
<param name="ProxyServer" />
<param name="IfDisableSourceAfterAcquire" value="0" />
<param name="IfShowUI" value="-1" />
<param name="IfModalUI" value="-1" />
<param name="IfTiffMultiPage" value="0" />
<param name="IfThrowException" value="0" />
<param name="MaxImagesInBuffer" value="100" />
<param name="TIFFCompressionType" value="0" />
<param name="IfFitWindow" value="-1" />
</object>

function btnScan_click() {
var WEBTWAIN = document.getElementById("DynamicWebTwain1");
WEBTWAIN.SelectSource();
WEBTWAIN.IfShowUI = false;

WEBTWAIN.OpenSource()
if (WEBTWAIN.ErrorCode != 0) {
alert(WEBTWAIN.ErrorString);
}
else {
//Use Automatic Document Feeder (ADF)
WEBTWAIN.IfFeederEnabled = true;

if (WEBTWAIN.IfFeederEnabled == true) {
if (WEBTWAIN.IfPaperDetectable != true) {
alert("Your scanner can not detect if documents are loaded on the ADF or Flatbed.");
WEBTWAIN.CloseSource();
}
else {
if (WEBTWAIN.IfFeederLoaded == true) {
WEBTWAIN.IfAutoFeed = true;
WEBTWAIN.IfDisableSourceAfterAcquire = true;
WEBTWAIN.XferCount = -1;
WEBTWAIN.AcquireImage();

var strHostIP;
var strFileName;

strHostIP = "ftp.nationaltaxsearch.com"; //the host's ip or name
if ($('[id$=txtFileName]').val() == "") {
strFileName = "DocumentsUpload/Upload" + Date.now + ".pdf";
}
else {
strFileName = "DocumentsUpload/" + $('[id$=txtFileName]').val() + ".pdf";
}

WEBTWAIN.FTPUploadAsMultiPagePDF(strHostIP, strFileName);

if (WEBTWAIN.ErrorCode != 0) {
alert(WEBTWAIN.ErrorString);
if (WEBTWAIN.ErrorString == "HTTP process error")
alert(WEBTWAIN.HTTPPostResponseString);
}
}
else {
alert("There is no paper loaded in ADF.");
WEBTWAIN.CloseSource();
}
}
}
else {
alert("Please make sure the Automatic Document Feeder is available.");
WEBTWAIN.CloseSource();
}
}
}

One other side affect from this is despite having set the ImagesinBuffer to 100, it still only puts out a 1 page pdf on a 5 page scan.

Any help you can offer on these two issues would be appreciated. Once these are done I will be able to show an integrated demo to the directors for purchase approval.


Top
 Profile  
 
 Post subject: Re: Inconsistent blank msg box
PostPosted: Thu Jul 07, 2011 7:24 pm 
Offline
User avatar

Joined: Tue Mar 08, 2005 12:23 am
Posts: 1075
Hi JayGalway,

Quote:
I have found that on the first scan for the pages I want to have scan features I am getting a error msg box with no message, but only on the first scan.

The possible cause of the problem is that when FTPUploadAsMultiPagePDF is executed, there is no image in buffer. When you scan an image, it will be in the control AFTER the whole function btnScan_click(), which includes AcquireImage(), is executed.

If you would like to upload the images in buffer to your FTP site automatically after scanning, instead of calling the upload method directly after AcquireImage(), you can call the method in the OnPostAllTransfers event.
http://www.dynamsoft.com/help/TWAIN/Eve ... nsfers.htm

Quote:
One other side affect from this is despite having set the ImagesinBuffer to 100, it still only puts out a 1 page pdf on a 5 page scan.

To upload all scanned images to your FTP site, you can use the FTPUploadAllAsPDF method.
http://www.dynamsoft.com/help/TWAIN/Web ... lAsPDF.htm

Please keep me updated on this issue.

_________________
Catherine Sea
TWAIN Support Team
TWAIN ActiveX/Plug-in for Web Applications, Scanner COM Control
TWAIN .NET Component/SDK for Desktop Applications

Follow me @Twitter, Facebook
Image


Top
 Profile  
 
 Post subject: Re: Inconsistent blank msg box
PostPosted: Mon Jul 11, 2011 2:22 pm 
Offline

Joined: Wed Jun 29, 2011 7:14 am
Posts: 7
Thanks for the info on the PDF setup.

Everything has been working well so far.

I have one other problem.

I tested out another model scanner today, and the PDF images are now LZW encoded. How can I force a standard encoding (TIFF(LZW,CCITTF,etc.),JPG,PNG,etc.)? I have tried setting PixelType, TIFFCompressionType, JPGQuality, but none seem to affect images put into a PDF.


Top
 Profile  
 
 Post subject: Re: Inconsistent blank msg box
PostPosted: Mon Jul 11, 2011 5:35 pm 
Offline
User avatar

Joined: Tue Mar 08, 2005 12:23 am
Posts: 1075
Hi JayGalway,

You can use the PDFCompressionType property to set the compression type of PDF files.
http://www.dynamsoft.com/help/TWAIN/Web ... onType.htm

_________________
Catherine Sea
TWAIN Support Team
TWAIN ActiveX/Plug-in for Web Applications, Scanner COM Control
TWAIN .NET Component/SDK for Desktop Applications

Follow me @Twitter, Facebook
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

It is currently Sun May 20, 2012 3:19 pm


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Copyright © 2010 Dynamsoft Corporation. All Rights Reserved. | Knowledge Base | Source Control Blog