Accusoft.TwainPro9.ActiveX
Debug

1 - I am encountering a problem with a TWAIN Device.

If you have a problem with a Twain device we recommend trying the following things:

  1. Get the latest version of the scanner's drivers from the manufacturer's web site and re-install them.

  2. Get the latest Twain Data Source Manager files from www.Twain.org and put them in your windows directory (NOT the windows\system directory). Also, make sure you don't have older versions of those DLLs or EXEs anywhere else in your path.

  3. Make sure you have the latest version of TwainPRO™.

  4. If you still have a problem with a particular scanner, let us know, but remember, not all TWAIN capabilities are supported by all devices and there are TWAIN drivers out there that have bugs in them and are not fully TWAIN compliant.

2 - It appears that setting a capability has no effect on the scanned image.

There are a couple of reasons this issue may be occurring:

Resolution 1:

Please make sure that you call OpenSession before setting the capabilities. For example: 

Example
Copy Code
TwainPRO1.SelectSource
TwainPRO1.ShowUI = False
TwainPRO1.OpenSession

Resolution 2:

Not all TWAIN devices support all TWAIN capabilities. Because of this, you must check to see if a TWAIN capability is supported by your device before setting it.

To do this, TwainPRO™ provides a method called CapSupported, which will return True if the capability is supported and False if not. Note that if a scanner supports a capability, it might only support getting it and does not necessarily support setting it.

Below is an example of how to check this property:

Example
Copy Code
TwainPRO1.Capability = ICAP_PIXELTYPE
If (TwainPRO1.CapSupported) Then
' If setting capability is supported this code will be executed
End If  

3 - I want to drive a scanner via the Kofax VRS TWAIN driver without using the Kofax TWAIN UI.

Kofax VirtualReScan (VRS) works best with an ISIS driver and only supports some scanners with TWAIN drivers. Documentation for Kofax VRS can be found at www.kofax.com.

Error Codes

7000

TWERR_TWAIN

Twain error, check ErrorCode & ErrorDescription properties.

The Data Source has returned an error. Check the ErrorCode and ErrorDescription properties to see if the Data Source has returned an error code.

7001

TWERR_TINIT

Can't find or load TWAIN DSM (TWAINDSM.dll, Version 2).

The 32-bit version should be installed in the SYSTEM32 directory on native 32-bit Windows systems. On native 64-bit Windows systems, the 32-bit version should be installed in the SYSWOW64 directory. The latest version can be found at www.twain.org.

Possible causes:

The file is missing.

The file is in use by another application.

7002

TWERR_FILEOPEN

TwainPRO can’t open an existing TIFF file to append pages.

Possible causes:

The file is open in another control or application.

The file is read-only.

7003

TWERR_MEMORYALLOC

TwainPRO was unable to allocate memory for the requested operation.

Possible causes:

The image being transferred is too large to fit in memory.

Too many applications are open.

7004

TWERR_CANCELLED

The user cancelled the requested operation.

Possible causes:

The user clicked the cancel button on the source selection dialog invoked by the SelectSource method.

7005

TWERR_CREATEFILE

TwainPRO was unable to create the file specified in the SaveFile method.

Possible causes:

The drive or path specified doesn’t exist.

The file exists and is in use by another application.

No file extension or an invalid file extension was specified.

7006

TWERR_FILEWRITE

An error occurred while TwainPRO was attempting to save a file to the path specified in the SaveFile method.

Possible causes:

The drive or path became invalid during the write. This can occur if the drive is a network drive.

The disk is full.

7007

TWERR_FORMATNOTSUPPORTED

A file extension for specified for a file type not supported by TwainPRO. Supported file types are: BMP, JPEG, ePIC, and TIFF.

7008

TWERR_BADLENGTH

A string with too many characters was set to a TwainPRO property.

Possible causes:

The application identity properties can accept a maximum length of 32 characters.

The PICPassword property can accept a maximum length of 8 characters.

7009

TWERR_BADVALUE

The value is out of range. An invalid value was set to a TwainPRO property.

Possible causes:

Many TwainPRO properties can only accept values in a specified range. For example, the SaveJPEGLumFactor property must be in the range 0-255.

7010

TWERR_NODIB

No image is available for the requested operation or an unsupported DIB format was returned in response to a StartSession.

Possible causes:

The hDIB property has already been read.

The SaveFile method was invoked after the hDIB property was read.

7011

TWERR_NOPICFILES

The required Accusoft dll file(s) are missing.

Possible causes:

Accusoft dll files are required when saving JPEG, ePIC, or TIFF files. They are listed in the dependencies section.

7012

TWERR_NONETFILES

The required Internet dll file(s) are missing.

Possible causes:

The following files are not present on the system. These files are not shipped with TwainPRO and are not needed unless an FTP address is specified in the SaveFile method. These files are included with other software such as Internet Explorer, and if the machine has a TCP/IP connection, it should have these files:

  • wininet.dll
  • urlmon.dll

7013

TWERR_FTP

An error occurred trying to FTP an image.

Possible causes:

The machine is not currently connected to a network. The FTPUserName and/or FTPPassword properties are not correct for the requested host specified in the SaveFile method.

The host and or path specified in the SaveFile method doesn’t exist.

The path was not specified in the SaveFile method. A fully qualified URL containing both the servername and file path must be specified. For example, "http://ftp.myserver.com/ftp/public/test.jpg" contains both the server and file information, but "http://ftp.myserver.com" does not.

7014

TWERR_TSEQERROR

Illegal operation for current Source Manager or Source state. The requested action cannot be performed in the current state of the Twain session.

Possible causes:

Certain methods and properties are only valid during certain states. For example, the DataSourceList property is invalid unless the OpenDSM method was called to open the Data Source Manager.

7015

TWERR_BADINDEX

The requested index was out of range for the property array.

7016

TWERR_WRONGCAPTYPE

A property was set or queried that was not valid for the current capability type. Please see the Negotiate Capabilities section for more information.

7017

TWERR_CLIPBOARD

An error occurred trying to open the clipboard with the CopyToClipboard or CutToClipboard method.

Possible causes:

Another application has the clipboard open.

7018

TWERR_INTERNALERROR

Internal error.

7019

TWERR_BADBITCOUNT

Invalid image resolution for selected file format or an unsupported bits per pixel was returned from a StartSession.

Possible causes:

Tried to save a 1-bit or Black and White image to a jpg or pic file.

7020

TWERR_NOTAVAILABLE

The property requested is not currently available.

Possible causes:

This error is returned when the CapAdvanced property is being used and the requested capability function is not available. For instance, this error will be returned when the Capability property is set to TP_Capability_UseCapAdvanced and the property CapDesc is accessed. The CapDesc property is only available for the enumerated Capability values. Also this error will be returned when the Capability property is set to TP_Capability_UseCapAdvancedFOREXTINFO and the "Cap...Out" properties are accessed.

7021

TWERR_NOIMAGE

No compressed image is available for the requested operation or an unsupported compressed image format was returned in response to a StartSession.

Possible causes:

The hImage property has already been read.

The SaveFile method was invoked after the hImage property was read.

7022

TWERR_DSINVALIDOP

The Data Source performed an operation that caused an exception. This error is a critical error. If this error is received then the application should be terminated immediately. No other TwainPRO calls should be made after this error is received. This does give the application the chance to do any non-TWAIN clean-up processing as well as inform the user that a critical error has occurred.

Possible causes:

The Data Source TWAIN driver executed an illegal operation, such as an illegal memory access, a divide by zero, etc.

7023

TWERR_INVALIDLICENSE

Invalid license.

7024

TWERR_TIFFTAGNOTFOUND

TIFF tag not found.

7025

TWERR_TIFFTAGITEMNOTFOUND

TIFF tag item not found.

7026

TWERR_BADFILEREAD

Error reading file.

7027

TWERR_SETTINGSFILEINIT

An error occurred while initializing the settings file reader system.

7028

TWERR_SETTINGSFILETERM

An error occurred while terminating the settings file reader system.

7029

TWERR_FILENOTOPEN

An error occurred when opening the settings file.

7030

TWERR_NAMENOTFOUND

The TwainDevice Name attribute was not found in the settings file.

7031

TWERR_SCANNERNOTFOUND

Settings for the current scanner were not found in the settings file.

7032

TWERR_ENUMNOTFOUND

The Capability Enum attribute was not found in the settings file.

7033

TWERR_INVALIDFILENAME

Invalid file name.

7034

TWERR_FILENOTFOUND

The specified file was not found for the current LoadSettings operation.

7035

TWERR_PATHNOTFOUND

The specified path of the filename was not found.

7036

TWERR_FILEINUSE

The file is in use by another process and cannot be opened.

7037

TWERR_FILECLOSE

The file close operation could not be completed.

7038

TWERR_FILERESET

The file reset operation could not be completed.

7039

TWERR_TYPENOTFOUND

The Capability Type attribute was not found in the settings file.

7101 TWERR_DSMV1NOTFOUND Can't find or load TWAIN DSM (twain_32.dll, Version 1) in the Windows directory.  The latest version can be found at www.twain.org.
7102 TWERR_DSMNOTFOUND Can't find or load any version of the Twain Data Source Manager.  The latest version can be found at www.twain.org.
7103 TWERR_DSM1NOTALLOWED64BIT On native 64-bit systems, Version 1 of the DSM (twain_32.dll) can't be used, you must use at least Version 2 (TWAINDSM.dll).
7104 TWERR_DSM2_64NOTFOUND Can't find or load TWAIN DSM (TWAINDSM.dll, Version 2).  The 64-bit version of TwainDSM.dll should be installed in the SYSTEM32 directory. The latest version can be found at www.twain.org.
7105 TWERR_DSM_SETTONONENOTALLOWED DataSourceManagerVersion can't be set to None, please choose a valid version to use.
7106 TWERR_SOURCECOMPRESSIONONLY The image was compressed directly in hardware by the source and not by TwainPro, please use SaveSourceCompressedImageToFile() to save the scanned image.
7107 TWERR_TWAINPROCOMPRESSIONONLY Hardware compression isn't available so only TwainPro can compress the image, please use SaveToFile() to save the scanned image.
7108 TWERR_JPEGLUMFACTORBADVALUE The SaveJPEGLumFactor value is out of range.  It should be within the range of 0 to 255.
7109 TWERR_JPEGCHROMFACTORBADVALUE The SaveJPEGChromFactor value is out of range.  It should be within the range of 0 to 255.
7110 TWERR_JPEGSUBSAMPLINGBADVALUE The SaveJPEGSubSampling value is incorrect.  It should be one of the available enumeration values: 111, 211, 411, or 211v.
7111 TWERR_PNGFILTERBADVALUE The TP_PngFilter value is incorrect. Please check the enumeration declaration for supported values.

Extended Error Codes

The following are error codes and strings that can be returned in the ErrorCode and ErrorDescription properties when TwainPRO™ returns a TWERR_TWAIN error.

1

TWCC_BUMMER

General failure. Unload Source immediately.

2

TWCC_LOWMEMORY

Not enough memory to complete operation.

3

TWCC_NODS

Source Manager unable to find the specified Source.

4

TWCC_MAXCONNECTIONS

Source is connected to maximum supported number of applications.

5

TWCC_OPERATIONERROR

Source or Source Manager reported an error to the user and handled the error; no application action required.

6

TWCC_BADCAP

Capability not supported by Source.

9

TWCC_BADPROTOCOL

Unrecognized operation triplet.

10

TWCC_BADVALUE

Data parameter out of supported range.

11

TWCC_SEQERROR

Illegal operation for current Source Manager or Source state.

12

TWCC_BADDEST

Unknown destination in DSM_Entry.

13

TWCC_CAPUNSUPPORTED

Capability not supported by Source.

14

TWCC_CAPBADOPERATION

Operation not supported on capability.

15

TWCC_CAPSEQERROR

Capability has dependencies on other capabilities and cannot be operated upon at this time.

16

TWCC_DENIED

File System operation is denied (file is protected).

17

TWCC_FILEEXISTS

Operation failed because file already exists.

18

TWCC_FILENOTFOUND

File not found.

19

TWCC_NOTEMPTY

Operation failed because directory is not empty.

20

TWCC_PAPERJAM

Transfer failed because of a feeder error.

21

TWCC_PAPERDOUBLEFEED

Transfer failed because of a feeder error.

22

TWCC_FILEWRITEERROR

Error writing the file.

23

TWCC_CHECKDEVICEONLINE

The device went off-line prior to or during this operation.

24 TWCC_INTERLOCK Operation failed because the cover or door is open.
25 TWCC_DAMAGEDCORNER Operation failed because the document has a damaged corner.
26 TWCC_FOCUSERROR Operation failed because of a focusing error during document capture.
27 TWCC_DOCTOOLIGHT Operation failed because the document is too light.
28 TWCC_DOCTOODARK Operation failed because the document is too dark.
29 TWCC_NOMEDIA Operation failed because no media is present for the source to capture.

See Also

 

 


©2017. Accusoft Corporation. All Rights Reserved.

Send Feedback